Giter Club home page Giter Club logo

python-optimcios's Introduction

Optim CIOS APIv1,v2 Python Package

Usage

Clone from GitHub.

git clone https://github.com/UNILORN/python-optimcios

Execute the following command.

$ cd python-optimcios
$ make

CIOSv1 Sample Codes In Messaging

from python_optimcios.v1 import messaging

channel_id = ""
access_token = ""
cios = messaging.Messaging('ws://0.0.0.0:9999',channel_id,access_token)

cios.connection()

cios.sendMessage('Hello world')

mes = cios.receiveMessage()
print(mes)

CIOSv2 Sample Codes

Authorization

from python_optimcios.v2 import authorization

auth = authorization.Authorization(
            auth_uri="AUTH_URI",
            client_id="CLIENT_ID",
            client_secret="CLIENT_SECRET",
            log=True
        )

access_token = auth.getRefreshAccessToken(
    scope="SCOPE",
    refresh_token="REFRESH_TOKEN"
)

print(access_token)

Datastore

from python_optimcios.v2 import authorization, datastore

auth = authorization.Authorization(
            auth_uri="AUTH_URI",
            client_id="CLIENT_ID",
            client_secret="CLIENT_SECRET",
            log=True
        )
access_token = auth.getRefreshAccessToken(
    scope="SCOPE",
    refresh_token="REFRESH_TOKEN"
)

datastore = datastore.Datastore(
            access_token=access_token,
            api_uri="API_URI",
            log=True
        )

# Datastore Channel List
datastore.getListChannel()

# Datastore Channel Info
datastore.getChannel(channel_id="CHANNEL_ID")

# Datastore Object List
datastore.getListObjects(channel_id="CHANNEL_ID")

# Datastore Create Object
datastore.postObject(channel_id="CHANNEL_ID",data="POST_DATA_JSON")

# Datastore Object Info
datastore.getObject(channel_id="CHANNEL_ID",object_id="OBJECT_ID")

# Datastore Latest Object Info
datastore.getObject(channel_id="CHANNEL_ID")

# Datasotre Delete Object
datastore.deleteObject(channel_id="CHANNEL_ID",object_id="OBJECT_ID")

Messaging

In Development

Development

Required


Python >= 3.6.0
pip >= 10.0.1

It work

  1. Please install with the following command.

    $ make inst-dev
    
  2. Change the .env file

  3. Run the test and make sure there are no errors

    $ python3 setup.py test

python-optimcios's People

Contributors

unilorn avatar

Watchers

 avatar

python-optimcios's Issues

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.