Skip to main content

SDK for origo

Project description

Usage

See the origo-cli repo for implementation and usage of the SDK

Configuration

When calling any classes interacting with the Origo API and there are no Config params passed to the constructor, a config object will be automaticly created for you based on environment variables

Environment variables

Default, will pick up configuration from current environment. The credentials is resolved automatically if you do not set a specific Auth config, in the following order:

  1. Client Credentials: If you have added client_id / client_secret to the config. Or if you use the environment variable equivalent: ORIGO_CLIENT_ID / ORIGO_CLIENT_SECRET.
  2. Username And Password: If you have added username / password to the config. Or if you use the environment variable equivalent: ORIGO_USERNAME / ORIGO_PASSWORD.
# keycloak user
export ORIGO_USERNAME=my-user

# keycloak password for ORIGO_USERNAME
export ORIGO_PASSWORD=my-password

# keycloak client
export ORIGO_CLIENT_ID=my-machine-client

# keycloak secret for ORIGO_CLIENT_ID
export ORIGO_CLIENT_SECRET=some-generated-secure-string


# overrides default environment (dev), but will be trumped by --env=<environment> on the commandline
export ORIGO_ENVIRONMENT=dev|prod

# If you are sending events and have been assigned a API key
export ORIGO_API_KEY=your-api-key

Getting Credentials:

username/password are synced with Oslo municipalities Active Directory so any user with an association can use their personal account to access the SDK.

For client credentials please contact the data platform team. dataplattform[at]oslo.kommune.no

TODO: Named profiles

If environment variables are not available, the system will try to load from a default profile: Located in ~/.origo/configuration

Run

git clone git@github.oslo.kommune.no:origo-dataplatform/origo-sdk-python.git
cd origo-sdk-python
python3.7 -m venv .venv
. .venv/bin/activate
make init

Development

Getting started

Run all tests:

$ make test

Reformat files:

make format

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

origo-sdk-python-0.0.4.tar.gz (8.6 kB view details)

Uploaded Source

Built Distribution

origo_sdk_python-0.0.4-py3-none-any.whl (12.5 kB view details)

Uploaded Python 3

File details

Details for the file origo-sdk-python-0.0.4.tar.gz.

File metadata

  • Download URL: origo-sdk-python-0.0.4.tar.gz
  • Upload date:
  • Size: 8.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.38.0 CPython/3.7.4

File hashes

Hashes for origo-sdk-python-0.0.4.tar.gz
Algorithm Hash digest
SHA256 7129e591816ab82f63ac39598d3f55d46261db2bd68101a45ce77f817a780798
MD5 43681ec197e4a93f1611e2a84d27c83b
BLAKE2b-256 7cd716f25d746bc6f8aa75a21eb4ecc08d901fe61757006ffc7d70d155971333

See more details on using hashes here.

File details

Details for the file origo_sdk_python-0.0.4-py3-none-any.whl.

File metadata

  • Download URL: origo_sdk_python-0.0.4-py3-none-any.whl
  • Upload date:
  • Size: 12.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.38.0 CPython/3.7.4

File hashes

Hashes for origo_sdk_python-0.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 0f25e3b1a587b8c4cd9b6e9f68033a67415c39390b30715221ba27ff759ccd73
MD5 317c1d173f70dc97d0a16b71e208c3e5
BLAKE2b-256 8c4e734a01f2952eabc8a344ebd25b6f56b6c2c6e1de97a7123f6d266272a01f

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