Giter Club home page Giter Club logo

intellivoid-python's Introduction

Intellivoid Services API Python Wrapper

This is the official Python Library for Intellivoid Services API, this wrapper is built based off the documentation from here.

This library handles COA (Cross-Over Authentication), and the Intellivoid Services features; in short: you can use this library to authenticate users, retrieve their information and use the other features and services that are available on the Intellivoid Services API. To have a greater understanding of how this is meant to be used, please see the following documentation links

Install

You can either install it from PyPi

pip install intellivoid

Via the Makefile

make install

or traditionally with setup.py

python3 setup.py install

Note on the implementation

The wrapper has been designed to be used both in a synchronous and in an asynchronous way: the package is split across two main subpackages, namely intellivoid.sync, for synchronous behavior, and intellivoid.aio, for asynchronous behavior. The latter requires the trio library to work, which is available on PyPi and listed as a project requirement (Trio's documentation). The packages are identical in their structure and functionality, but note that exception classes are shared and come from the intellivoid.sync package: intellivoid.aio has no dedicated exceptions modules and uses the synchronous' package exceptions instead.

A quick example

This example is taken from placeholder_authenticate.py which demonstrates how you can easily authenticate a user and obtain their Access Token.

from intellivoid.sync.coa import CrossOverAuthentication

# Use your own Application ID and Secret Key. You'll be able to set your own
# logo, name and permissions. These Application is for demonstration purposes only
# and nobody can access your information using these Applications unless they have your Access Token
coa = CrossOverAuthentication()
application_id = "APP65640a935039be5570428b6e74747811b0a290210e9e2d2f6722d8a54966ac171a4d5f1c"
secret_key = "51649e76483ff7de673e299a8056675409c957ec020998223ea02b3ccbaec1220747373d"

print("Requesting authentication token")
request_auth_results = coa.request_authentication(
    application_id=application_id,
    expand_ui=1)

print("Authenticate: {}".format(request_auth_results["authentication_url"]))
print("Waiting for authentication")
process_authentication_results = coa.process_authentication(
    application_id=application_id,
    secret_key=secret_key,
    request_token=request_auth_results["request_token"],
    poll_results=True)

# If poll_results is False, AwaitingAuthenticationError exception will be raised

# If poll_results is True, the method will run in a loop until the user successfully authenticates
# or if an error occurs such as the request token being expired

print("Access Token: {0}".format(process_authentication_results["access_token"]))

More examples can be found here along with README files that explains what the example does, how it works and what it can be used for.

Credits

This library is developed by and copyrighted by Zi Xing Narrakas and/or Intellivoid and may only be used in compliance with the included license, which you can find in this repo inside the LICENSE file.

License

Licensed under GPLv3 or later versions, See the LICENSE for more information.

intellivoid-python's People

Contributors

androidacy-user avatar nocturn9x avatar

Watchers

 avatar  avatar  avatar

Forkers

teameviral

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.