Obelisk-Python
After years of copy-pasting and modifying Obelisk client implementations all over, we've had enough of hearing "construct additional obelisks". Thus, we have decided to build the one client to rule them all.
This project is licensed according to the LICENSE file included with the source. You should have received a copy alongside the code bundle, otherwise you can get it for the most recent version here.
Usage
Take your pick of asynchronous or sync, import the relevant Producer or Consumer and go crazy. There is explicitly minimal documentation on actual filter values, read the Obelisk docs for that. Documentation for the Python API can be found here.
Please never copy the repo into your own project,
rather use pip install obelisk-py.
Retry strategies
Obelisk-py provides first class support for retry behaviours.
These are defined in strategies/retry.py,
we provide NoRetryStrategy, ImmediateRetryStrategy,
and ExponentialBackoffRetryStrategy.
These do exactly what it says on the tin,
when provided in the constructor of your producer, consumer or client,
they will cause the client to retry requests according to the strategy
whenever the response status is not in the 2XX range.
The default strategy is no retry, we do recommend setting at least some form of retry as the token validity behaviour sometimes encounters edge cases.
Async and Sync support
The library has an async and blocking edition.
The async edition is contained in the module asynchronous
due to async being a reserved keyword and invalid package name,
synchronous can be found in sync.
The sync edition is simply a wrapper around asynchronous,
maintaining an own event loop.
HFS and Classic support
All constructors take an optional kind argument,
set this to the appropriate variety for you.
There is no special handling for HFS userId / patientId fields as those are never
directly touched by the library.
The only exception is that Datapoint has explicit support for userId
and allows extra fields to provide naive support for other field names.
Building and Docs
uv is used to manage this project.
Tests can be run using uv run pytest, building and deployment are handled by uv build and uv publish.
Documentation uses the classic sphinx setup.
Building is as follows:
# uv run sphinx-build -M html docs/source/ docs/build/
In case of major restructuring, it may be needed to clean up the contents of docs/_autosummary and potentially other rst files in docs,
followed by re-running the build.
Manually triggering sphinx-apidoc is unnecessary.
Hooks
We use some simple Git hooks to avoid fighting the CI too often.
These are stored in the hooks/ directory, and can be enabled by setting git config core.hooksPath hooks/.
Credits
Base implementation originally by Pieter Moens Pieter.Moens@ugent.be, modified by Kyana Bosschaerts Kyana.Bosschaerts@ugent.be and finally consolidated by Stef Pletinck Stef.Pletinck@ugent.be.
Metadata
Release files for obelisk-py 2.3.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| obelisk_py-2.3.1.tar.gz | 48.3 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| obelisk_py-2.3.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 71.2 kB
Release files / obelisk_py-2.3.1.tar.gz
| Download URL | obelisk_py-2.3.1.tar.gz |
|---|---|
| Size | 48.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
0ff194cf5513e3057b743bf0253449993887b74cccf62a79ea1add8bcb803ef0
|
|
BLAKE2b-256 checksum How to use checksums |
2df16a65fdfe3a58e89e2206456fc932c2326ddace46e16d0c48f7b7fec5ebd2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.12.10 {"installer":{"name":"uv","version":"0.12.10","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / obelisk_py-2.3.1-py3-none-any.whl
| Download URL | obelisk_py-2.3.1-py3-none-any.whl |
|---|---|
| Size | 23.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
853431add59034a7cb205e1a355af2114f094c377916f22a722929afb193149a
|
|
BLAKE2b-256 checksum How to use checksums |
45f99f469c4e796b857b504cb69918572520f2b3b176189c9181c2e9975c3cd5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.12.10 {"installer":{"name":"uv","version":"0.12.10","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|