Skip to main content

Package to interact with the Opinum API

Project description

This package simplifies the Opinum API calls.

No magic. You need to follow the Opinum Swagger Documentation for correct formatting of your requests

You first need to create an instance of the ApiConnector class with following parameters:

environment

a dictionary of environment variables

if None, ApiConnector uses your environment variables (os.environ)

Mandatory environment variables are:

  • OPINUM_USERNAME: the Datahub user.
    TAKE CARE: if this user has access to multiple tenants and if you do not specify a tenant id, ApiConnector will use the last tenant used.
  • OPINUM_PASSWORD: the password for the user
  • OPINUM_CLIENT_ID: the client id for accessing the API
  • OPINUM_SECRET the corresponding secret

Optional environment variables are:

  • OPINUM_API_URL: another API URL than the Europe SaaS one (https://api.opinum.com)
  • OPINUM_AUTH_URL: another authentication URL than the Europe SaaS one (https://identity.opinum.com)
  • DEFAULT_PUSH_URL: another push URL than the Europe SaaS one (https://push.opinum.com)
  • OPINUM_SCOPE: the scope of you session (default: "opisense-api")
    if you want to push data, the scope should be "opisense-api push-data"

account_id

one of the tenant ids available for the Datahub user (default: None)

retries_when_connection_failure

number of extra attempts when no 200 or 204 return code (default: 0, maximum: 5)

Once you have your ApiConnector instance, you may use the class methods

  • get
  • post
  • put
  • delete

All keyword arguments will be converted to path parameters in the API call with one important exception, the data keyword referring to the body of your call.

There are two other class methods for data pushing because we have another API for this

  • push_data
  • push_dataframe_data

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

opinum-api-connector-1.0.1.tar.gz (5.2 kB view details)

Uploaded Source

Built Distribution

opinum_api_connector-1.0.1-py3-none-any.whl (5.0 kB view details)

Uploaded Python 3

File details

Details for the file opinum-api-connector-1.0.1.tar.gz.

File metadata

  • Download URL: opinum-api-connector-1.0.1.tar.gz
  • Upload date:
  • Size: 5.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.7.6

File hashes

Hashes for opinum-api-connector-1.0.1.tar.gz
Algorithm Hash digest
SHA256 b03ef7c8670f76f816e9c446fc096c6642c754f003490ce8be3ce145a00b1506
MD5 8134819718626428da37511608b9c073
BLAKE2b-256 80337431be69685dd586f4422725624c3e7c9a25ca73fbac75563b29099708f9

See more details on using hashes here.

File details

Details for the file opinum_api_connector-1.0.1-py3-none-any.whl.

File metadata

File hashes

Hashes for opinum_api_connector-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 41b214176aba5179ed413f17a584b0f63b6e7310d5db72070ddd179690e9f15e
MD5 22688d8c6d2d22263f33de5c79128112
BLAKE2b-256 b8b65f2e0dd6597a850ac3bbed2ff089cbdee4beb3c6d2243d382b279e481243

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page