Giter VIP home page Giter VIP logo

sesam-datasource-havnivaa's Introduction

python-datasource-template

A Python micro service template for feeding a JSON entity stream to a Sesam service instance.

$ python3 service/datasource-service.py
 * Running on http://0.0.0.0:5000/ (Press CTRL+C to quit)
 * Restarting with stat
 * Debugger is active!
 * Debugger pin code: 260-787-156

The service listens on port 5000. JSON entities can be retrieved from 'http://localhost:5000/entities'.

$ curl -s 'http://localhost:5000/entities' | python3 -m json.tool
[
    {
        "name": "entity 0",
        "_id": "entity-0",
        "_updated": "2016-06-26T10:46:13.351467Z"
    },
    {
        "name": "entity 1",
        "_id": "entity-1",
        "_updated": "2016-06-26T10:46:13.351468Z"
    },
    {
        "name": "entity 2",
        "_id": "entity-2",
        "_updated": "2016-06-26T10:46:13.351469Z"
    },
    {
        "name": "entity 3",
        "_id": "entity-3",
        "_updated": "2016-06-26T10:46:13.351470Z"
    },
    {
        "name": "entity 4",
        "_id": "entity-4",
        "_updated": "2016-06-26T10:46:13.351471Z"
    },
    {
        "name": "entity 5",
        "_id": "entity-5",
        "_updated": "2016-06-26T10:46:13.351472Z"
    },
    {
        "name": "entity 6",
        "_id": "entity-6",
        "_updated": "2016-06-26T10:46:13.351473Z"
    },
    {
        "name": "entity 7",
        "_id": "entity-7",
        "_updated": "2016-06-26T10:46:13.351474Z"
    },
    {
        "name": "entity 8",
        "_id": "entity-8",
        "_updated": "2016-06-26T10:46:13.351475Z"
    },
    {
        "name": "entity 9",
        "_id": "entity-9",
        "_updated": "2016-06-26T10:46:13.351476Z"
    }
]
 curl -s 'http://localhost:5000/entities?since=2016-06-26T10:46:13.351474Z' | python3 -m json.tool
[
    {
        "name": "entity 8",
        "_id": "entity-8",
        "_updated": "2016-06-26T10:46:13.351475Z"
    },
    {
        "name": "entity 9",
        "_id": "entity-9",
        "_updated": "2016-06-26T10:46:13.351476Z"
    }
]

sesam-datasource-havnivaa's People

Watchers

 avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.