A general purpose library for interacting with the Semaphore Platform API
Project description
S4 Platform API
Requirements
s4-platform-api
requires Python 3.9+.
Contributing
This may change in the future, but for now, please follow conventional commits style. The short summary of this is, when you open a PR or make a commit:
- If you change code, prefix your PR title with
fix:
if it's a fix orfeat:
if it adds a feature. - If you change the API, include the text
BREAKING CHANGE
in your PR title. - If you don't change code at all, prefix the PR title with
ci:
,docs:
,test:
,build:
, or something else.
The version of the library will be incremented according to the text in merged PRs, so that it follows semver.
Clarifications
"Adding a feature" includes, at least, any time you make something available to users of the library which wasn't available before. If you remove or change current behaviour, you're changing the API.
Developer Setup
- Install poetry:
brew install poetry
- Install dependencies:
poetry install
- Export AUTH0_DOMAIN=dev-d3p316sq.us.auth0.com and AUTH0_AUDIENCE=https://dev-d3p316sq.us.auth0.com/api/v2/ as environment variables
- Export AUTH0_TEST_CLIENT_ID=D9wQOscnTJnXEmimsviFiDimppJ7A1bK and AUTH0_TEST_CLIENT_SECRET as environment variables. Secret's value is in LastPass as "Auth0 test client secret" in "Shared-Platypus" folder
Testing
Unit tests
From the root directory: poetry run pytest test/
Integration tests
From the root directory: poetry run pytest integration_test/
All tests
From the root directory: poetry run pytest
Building
To build a source and binary wheel distribution: poetry build
Examples
Scripts from the examples
directory use the library. These can be run from the command line.
`poetry run examples/get_prospective_task 614e1f114640ba4b197af7ea`
The file examples/.env
contains configurable parameters used by the examples scripts. Edit this as necessary or
override by setting environment variables on the system running the scripts.
HOST_URL=http://example.org/orange get_prospective_task 614e1f114640ba4b197af7ea
URI Override
If this library is run within an AWS deployment application queries need to be altered to use local networking. If the
environment variable URI_OVERRIDE
is present queries to the application will be overwritten to use this value.
e.g.
If connection is initialized with a value of https://app.laboratory.plat.s4hq.com
and the environment variable
URI_OVERRIDE
exists with a value http://localhost:8080
, a query intended to go to
https://app.laboratory.plat.s4hq.com/blueHealth
will actually go to http://localhost:8080/blueHealth
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
Built Distribution
Hashes for s4_platform_api-1.1.22-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 571fe038e04105b4ec5549cb90efbb56e93c3d646328162df36fea957d9cd997 |
|
MD5 | 39b3950a668cce6580a642044338c961 |
|
BLAKE2b-256 | 4be06ca0366ee38eac7a6eb619093976ac9fb230f680631dc08963a0511435b2 |