Skip to content

Commit bcdcd27

Browse files
authored
Merge pull request #2 from predict-idlab/construct_additional_obelisks
Switch to Construct Additional Obelisks
2 parents ac4a97c + 638ce4e commit bcdcd27

File tree

81 files changed

+2899
-1288
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

81 files changed

+2899
-1288
lines changed

.github/workflows/sphinx-documentation.yml

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,16 +12,14 @@ jobs:
1212
runs-on: ubuntu-latest
1313
name: Sphinx documentation to GitHub pages
1414
steps:
15-
- uses: actions/checkout@v2
15+
- uses: actions/checkout@v4
1616
- name: Installing the library
1717
shell: bash -l {0}
1818
run: |
19-
python setup.py install
20-
pip install -r requirements.txt
21-
pip install sphinx sphinx-rtd-theme recommonmark
19+
curl -LsSf https://astral.sh/uv/install.sh | sh
20+
uv run sphinx-build -M html docs/source/ docs/build/
2221
- name: Deploy
23-
uses: uibcdf/action-sphinx-docs-to-gh-pages@v1.0-beta.2
22+
uses: peaceiris/actions-gh-pages@v4
2423
with:
25-
branch: main
26-
dir_docs: docs
27-
sphinxopts: ''
24+
github_token: ${{ secrets.GITHUB_TOKEN }}
25+
publish_dir: ./docs/build/html

.gitignore

Lines changed: 97 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -1,54 +1,108 @@
1-
# Temporary and binary files
2-
*~
1+
# Byte-compiled / optimized / DLL files
2+
__pycache__/
33
*.py[cod]
4+
*$py.class
5+
6+
# C extensions
47
*.so
5-
*.cfg
6-
!.isort.cfg
7-
!setup.cfg
8-
*.orig
9-
*.log
10-
*.pot
11-
__pycache__/*
12-
.cache/*
13-
.*.swp
14-
*/.ipynb_checkpoints/*
15-
.DS_Store
16-
17-
# Project files
18-
.ropeproject
19-
.project
20-
.pydevproject
21-
.settings
22-
.idea
23-
tags
248

25-
# Package files
26-
*.egg
27-
*.eggs/
9+
# Distribution / packaging
10+
.Python
11+
build/
12+
develop-eggs/
13+
dist/
14+
downloads/
15+
eggs/
16+
.eggs/
17+
lib/
18+
lib64/
19+
parts/
20+
sdist/
21+
var/
22+
wheels/
23+
share/python-wheels/
24+
*.egg-info/
2825
.installed.cfg
29-
*.egg-info
26+
*.egg
27+
MANIFEST
3028

31-
# Unittest and coverage
32-
htmlcov/*
29+
# Installer logs
30+
pip-log.txt
31+
pip-delete-this-directory.txt
32+
33+
# Unit test / coverage reports
34+
htmlcov/
35+
.tox/
36+
.nox/
3337
.coverage
34-
.tox
35-
junit.xml
38+
.coverage.*
39+
.cache
40+
nosetests.xml
3641
coverage.xml
42+
*.cover
43+
*.py,cover
44+
.hypothesis/
3745
.pytest_cache/
46+
cover/
3847

39-
# Build and docs folder/files
40-
build/*
41-
dist/*
42-
sdist/*
43-
docs/api/*
44-
docs/_rst/*
45-
docs/_build/*
46-
cover/*
47-
MANIFEST
48+
# Sphinx documentation
49+
docs/_build/
50+
docs/build/
51+
52+
# PyBuilder
53+
.pybuilder/
54+
target/
55+
56+
# pdm
57+
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
58+
#pdm.lock
59+
# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
60+
# in version control.
61+
# https://pdm.fming.dev/latest/usage/project/#working-with-version-control
62+
.pdm.toml
63+
.pdm-python
64+
.pdm-build/
65+
66+
# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
67+
__pypackages__/
68+
69+
# Environments
70+
.env
71+
.venv
72+
env/
73+
venv/
74+
ENV/
75+
env.bak/
76+
venv.bak/
77+
78+
# Spyder project settings
79+
.spyderproject
80+
.spyproject
81+
82+
# Rope project settings
83+
.ropeproject
84+
85+
# mkdocs documentation
86+
/site
87+
88+
# mypy
89+
.mypy_cache/
90+
.dmypy.json
91+
dmypy.json
92+
93+
# Pyre type checker
94+
.pyre/
95+
96+
# pytype static type analyzer
97+
.pytype/
98+
99+
# Cython debug symbols
100+
cython_debug/
101+
102+
.idea/
48103

49-
# Per-project virtualenvs
50-
.venv*/
104+
# Ruff stuff:
105+
.ruff_cache/
51106

52-
# Configuration file
53-
example/out/
54-
example/config.py
107+
# PyPI configuration file
108+
.pypirc

CHANGELOG.rst

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
Version 1.0.0
2+
-------------
3+
4+
:Date: March 12, 2025
5+
6+
* Switch to new Construct Additional Obelisks implementation
7+
18
Version 0.2.0
29
-------------
310

@@ -63,4 +70,4 @@ Version 0.0.2
6370
Version 0.0.1
6471
-------------
6572

66-
:Date: June 15, 2020
73+
:Date: June 15, 2020

README.md

Lines changed: 63 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,69 @@
1-
# Obelisk Python Client
1+
# Obelisk-Python
22

3-
![version](https://img.shields.io/pypi/v/obelisk-py)
4-
![build-docs](https://img.shields.io/github/workflow/status/predict-idlab/obelisk-python/pages%20build%20and%20deployment?label=docs)
3+
After years of copy-pasting and modifying Obelisk client implementations all over,
4+
we've had enough of hearing "construct additional obelisks".
5+
Thus, we have decided to build the one client to rule them all.
56

6-
## Installation
7+
## Usage
78

9+
Take your pick of asynchronous or sync,
10+
import the relevant Producer or Consumer and go crazy.
11+
There is explicitly minimal documentation on actual filter values,
12+
read the [Obelisk docs](https://obelisk.docs.apiary.io/) for that.
13+
Documentation for the Python API can be found [here](https://predict-idlab.github.io/obelisk-python/).
14+
15+
Please never copy the repo into your own project,
16+
rather use `pip install obelisk-py`.
17+
18+
### Retry strategies
19+
20+
Obelisk-py provides first class support for retry behaviours.
21+
These are defined in `strategies/retry.py`,
22+
we provide `NoRetryStrategy`, `ImmediateRetryStrategy`,
23+
and `ExponentialBackoffRetryStrategy.`
24+
These do exactly what it says on the tin,
25+
when provided in the constructor of your producer, consumer or client,
26+
they will cause the client to retry requests according to the strategy
27+
whenever the response status is not in the 2XX range.
28+
29+
The default strategy is no retry,
30+
we do recommend setting at least some form of retry
31+
as the token validity behaviour sometimes encounters edge cases.
32+
33+
### Async and Sync support
34+
35+
The library has an async and blocking edition.
36+
The async edition is contained in the module `asynchronous`
37+
due to `async` being a reserved keyword and invalid package name,
38+
synchronous can be found in `sync`.
39+
The `sync` edition is simply a wrapper around `asynchronous`,
40+
maintaining an own event loop.
41+
42+
### HFS and Classic support
43+
44+
All constructors take an optional `kind` argument,
45+
set this to the appropriate variety for you.
46+
47+
There is no special handling for HFS userId / patientId fields as those are never
48+
directly touched by the library.
49+
The only exception is that `Datapoint` has explicit support for userId
50+
and allows extra fields to provide naive support for other field names.
51+
52+
## Building and Docs
53+
54+
`uv` is used to manage this project.
55+
Tests can be run using `uv run pytest`, building and deployment are handled by `uv build` and `uv publish`.
56+
57+
Documentation uses the classic `sphinx` setup, with numpydoc for their lovely layouts and conventions.
58+
Building is as follows:
59+
60+
``` sh
61+
# uv run sphinx-build -M html docs/source/ docs/build/
862
```
9-
pip install obelisk-py
10-
```
1163

12-
## Documentation
64+
## Credits
65+
66+
Base implementation originally by Pieter Moens <[email protected]>,
67+
modified by Kyana Bosschaerts <[email protected]>
68+
and finally consolidated by Stef Pletinck <[email protected]>.
1369

14-
[Read the docs](https://predict-idlab.github.io/obelisk-python/)

docs/Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
# from the environment for the first two.
66
SPHINXOPTS ?=
77
SPHINXBUILD ?= sphinx-build
8-
SOURCEDIR = .
9-
BUILDDIR = _build
8+
SOURCEDIR = source
9+
BUILDDIR = build
1010

1111
# Put it first so that "make" without argument is like "make help".
1212
help:

docs/changelog.rst

Lines changed: 0 additions & 4 deletions
This file was deleted.

docs/conf.py

Lines changed: 0 additions & 87 deletions
This file was deleted.

0 commit comments

Comments
 (0)