Python client for OrderlyWeb API
Project description
orderlyweb-api
Python client for OrderlyWeb.
Initial use case is to run a report only.
Usage
Instantiate the OrderlyWebAPI
class, providing base url and bearer token as parameters:
api = OrderlyWebAPI('http://localhost:8080', 'H2AAbjvhjbbhbhjlh')
The bearer token must be obtained externally to this client. Use the Montagu Python client to obtain a token by authenticating with Montagu.
To run a report:
api.run_report(report_name, report_paraneters, timeout)
where report_parameters
is a dictionary or JSON string, and timeout
is an
integer. Timeout
sets a timeout for the report run in seconds, after which the
run will be halted. The default timeout is 600.
Development
Clone the repo anywhere and install dependencies with (from the repo root):
pip3 install --user -r requirements.txt
Run dependencies (a local copy of Montagu API and database, and OrderlyWeb) with scripts/run-dev-dependencies.sh
. This will also
add a test user to Montagu.
Testing
Run dependencies as described above, then run pytest
Publishing
This repository is published to PyPI.
Building and publishing is done manually, with local sources.
Publishing configuration can be found in setup.py
, and any classes, methods etc which should be accessible to users of the package
must be added to orderlyweb_api/__init__.py
.
Remember to increment version
in setup.py
before publishing a new build.
To publish:
- Delete the following folders:
.eggs
,build
,dist
,orderlyweb_api.egg-info
. - Build the package with:
python3 setup.py sdist bdist_wheel
- Publish with:
python3 -m twine upload dist/*
To use the OrderlyWebAPI class as a client of the package, include orderlyweb-api
in your requirements.txt
. Import with
import orderlyweb_api
, and instantiate the API class with orderlyweb_api.OrderlyWebAPI(url, token)
See general instructions for publishing Python packages here.
Some troubleshooting tips for publishing Python packages can be found in the consellations repo.
Project details
Release history Release notifications | RSS feed
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
File details
Details for the file orderlyweb-api-0.0.8.tar.gz
.
File metadata
- Download URL: orderlyweb-api-0.0.8.tar.gz
- Upload date:
- Size: 5.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.1.0 requests-toolbelt/0.9.1 tqdm/4.47.0 CPython/3.6.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1d179b4ab3c3677deaa73664eeaa9501c57b46c4e6f1852f6bc7db1b2961dcb4 |
|
MD5 | cfe9915e715549792d5f112917f084bb |
|
BLAKE2b-256 | 6e56cb129271a281b5cd0ebe6f7dcc967b35649e587a6000deda88fd838209fd |
File details
Details for the file orderlyweb_api-0.0.8-py3-none-any.whl
.
File metadata
- Download URL: orderlyweb_api-0.0.8-py3-none-any.whl
- Upload date:
- Size: 9.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.1.0 requests-toolbelt/0.9.1 tqdm/4.47.0 CPython/3.6.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d3f234ef7f71765d9a307e10f3ed6eb45eacc062c10aff7bc1c30f703be88834 |
|
MD5 | bb7b5bff659f922d0f350364dbc4cf2a |
|
BLAKE2b-256 | f2563f2bf957d7f3b298a6944fc31ba75245847d76c737061d538b25ee8a1537 |