dhis2-fetch-core 0.0.1__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- dhis2_fetch_core/__init__.py +8 -0
- dhis2_fetch_core/py.typed +0 -0
- dhis2_fetch_core-0.0.1.dist-info/METADATA +119 -0
- dhis2_fetch_core-0.0.1.dist-info/RECORD +7 -0
- dhis2_fetch_core-0.0.1.dist-info/WHEEL +5 -0
- dhis2_fetch_core-0.0.1.dist-info/licenses/LICENSE +21 -0
- dhis2_fetch_core-0.0.1.dist-info/top_level.txt +1 -0
|
File without changes
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: dhis2-fetch-core
|
|
3
|
+
Version: 0.0.1
|
|
4
|
+
Summary: Read-only core for DHIS2 Web API clients: connection, error codes, version differences and query builders
|
|
5
|
+
Author: Elijah Filip, Valérian Turbé
|
|
6
|
+
License-Expression: MIT
|
|
7
|
+
Project-URL: Homepage, https://github.com/elifilip/dhis2-fetch-core
|
|
8
|
+
Project-URL: Repository, https://github.com/elifilip/dhis2-fetch-core
|
|
9
|
+
Project-URL: Issues, https://github.com/elifilip/dhis2-fetch-core/issues
|
|
10
|
+
Keywords: dhis2,health,hmis,api
|
|
11
|
+
Classifier: Development Status :: 1 - Planning
|
|
12
|
+
Classifier: Intended Audience :: Developers
|
|
13
|
+
Classifier: Intended Audience :: Healthcare Industry
|
|
14
|
+
Classifier: Operating System :: OS Independent
|
|
15
|
+
Classifier: Programming Language :: Python :: 3
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
20
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
21
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
22
|
+
Classifier: Typing :: Typed
|
|
23
|
+
Requires-Python: >=3.9
|
|
24
|
+
Description-Content-Type: text/markdown
|
|
25
|
+
License-File: LICENSE
|
|
26
|
+
Requires-Dist: requests
|
|
27
|
+
Provides-Extra: dev
|
|
28
|
+
Requires-Dist: pytest>=7; extra == "dev"
|
|
29
|
+
Requires-Dist: responses>=0.23; extra == "dev"
|
|
30
|
+
Dynamic: license-file
|
|
31
|
+
|
|
32
|
+
# dhis2-fetch-core
|
|
33
|
+
|
|
34
|
+
A small read-only Python library that holds what a DHIS2 Web API client has to know: how to connect
|
|
35
|
+
without overloading a server, what DHIS2's error codes mean, how the API differs between DHIS2 versions,
|
|
36
|
+
and how to build and batch queries.
|
|
37
|
+
|
|
38
|
+
It exists so that two projects stop keeping separate copies of that knowledge:
|
|
39
|
+
|
|
40
|
+
- [dhis2-fetch](https://pypi.org/project/dhis2-fetch/), which returns pandas DataFrames to analysts in
|
|
41
|
+
notebooks, scripts and pipelines.
|
|
42
|
+
- [DHIS2 Analytics MCP](https://github.com/elifilip/dhis2-analytics-mcp), which lets people ask an AI
|
|
43
|
+
assistant questions about a DHIS2 instance.
|
|
44
|
+
|
|
45
|
+
Each keeps its own front end and depends on this package. The core decides nothing about how results are
|
|
46
|
+
shown.
|
|
47
|
+
|
|
48
|
+
## Status
|
|
49
|
+
|
|
50
|
+
**Skeleton only.** Version `0.0.1` contains the packaging, the rules below and the tests that enforce
|
|
51
|
+
them. There is no public API yet. Code arrives in stages, copied from the two projects with its tests:
|
|
52
|
+
|
|
53
|
+
| Release | What it adds |
|
|
54
|
+
| --- | --- |
|
|
55
|
+
| 0.1 | Functions that build requests and read errors but send nothing: error codes, version differences, dimension helpers, the batch planner, saved-layout queries, periods |
|
|
56
|
+
| 0.2 | The connection: login, the single GET, retries, limits that protect the server, a hook per request |
|
|
57
|
+
| 0.3 | Shared fetch loops, size estimates before a pull, a resumable job store |
|
|
58
|
+
|
|
59
|
+
Do not depend on it before 0.1.
|
|
60
|
+
|
|
61
|
+
## Rules
|
|
62
|
+
|
|
63
|
+
The core is useful to both projects only if it never does anything a front end would have to undo.
|
|
64
|
+
|
|
65
|
+
- **Read-only.** It sends GET requests and nothing else, from one place (`connection.py`).
|
|
66
|
+
- **No side effects.** No printing, no prompts, no file writes, no environment variables. The front end
|
|
67
|
+
passes everything in, and a hook hands each request's details back.
|
|
68
|
+
- **Plain data.** No pandas or numpy. Functions return dicts and lists and raise typed exceptions.
|
|
69
|
+
- **Thread-safe per connection.** One connection may be called from several threads at once.
|
|
70
|
+
- **Estimate before fetching.** Any bulk pull can be sized before it runs. The core reports the size; the
|
|
71
|
+
front end decides what is too much.
|
|
72
|
+
- **Documented.** Every public function documents its parameters, and messages are plain ASCII.
|
|
73
|
+
- **Neutral identity.** No employer names, real instance URLs or credentials in the repository.
|
|
74
|
+
|
|
75
|
+
`tests/test_core_rules.py`, `tests/test_docstrings.py` and `tests/test_ascii_messages.py` check the rules
|
|
76
|
+
that can be checked.
|
|
77
|
+
|
|
78
|
+
## Decisions
|
|
79
|
+
|
|
80
|
+
| Decision | Choice |
|
|
81
|
+
| --- | --- |
|
|
82
|
+
| Name | `dhis2-fetch-core` on PyPI, imported as `dhis2_fetch_core` |
|
|
83
|
+
| Licence | MIT |
|
|
84
|
+
| HTTP library | requests |
|
|
85
|
+
| Python | 3.9 and later, tested through 3.14 |
|
|
86
|
+
| DHIS2 | Tested from 2.40; older versions on a best-effort basis |
|
|
87
|
+
| Code style | dhis2-fetch's rules (see `CLAUDE.md`) |
|
|
88
|
+
|
|
89
|
+
## Development
|
|
90
|
+
|
|
91
|
+
```
|
|
92
|
+
pip install -e ".[dev]"
|
|
93
|
+
pytest -q
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
To work on the core and a front end together, install the core from your local clone into the front
|
|
97
|
+
end's environment:
|
|
98
|
+
|
|
99
|
+
```
|
|
100
|
+
pip install -e ../dhis2-fetch-core
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
A change to how DHIS2 is called goes into the core first, then each front end raises the version it
|
|
104
|
+
depends on. dhis2-fetch pins a range and the MCP pins an exact version.
|
|
105
|
+
|
|
106
|
+
## Releasing
|
|
107
|
+
|
|
108
|
+
1. Set the new `version` in `pyproject.toml` and move the CHANGELOG's entries under it.
|
|
109
|
+
2. Commit, then tag that commit `vX.Y.Z` and push the tag.
|
|
110
|
+
3. The `publish` workflow checks the tag against `pyproject.toml`, runs the tests, builds and uploads to
|
|
111
|
+
PyPI.
|
|
112
|
+
|
|
113
|
+
The upload uses PyPI's trusted publishing, which has to be set up once on PyPI for this repository and
|
|
114
|
+
the `publish.yml` workflow. A version number can never be reused on PyPI.
|
|
115
|
+
|
|
116
|
+
## Licence and affiliation
|
|
117
|
+
|
|
118
|
+
MIT. This is an independent, unofficial project. It is not affiliated with or endorsed by the DHIS2
|
|
119
|
+
project.
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
dhis2_fetch_core/__init__.py,sha256=V4O8kHhc0Bm-YFCAKqKb3PqYw_pK7mHCAC8K875C8yc,259
|
|
2
|
+
dhis2_fetch_core/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
3
|
+
dhis2_fetch_core-0.0.1.dist-info/licenses/LICENSE,sha256=u1QBcq-S38LWSlJWEFgqv1y_xmooJVW0VY4U1R3gemY,1086
|
|
4
|
+
dhis2_fetch_core-0.0.1.dist-info/METADATA,sha256=G7JeoBloIWpIHUgUMh_yCdyc7biHfQiykxogPQSA-H8,5052
|
|
5
|
+
dhis2_fetch_core-0.0.1.dist-info/WHEEL,sha256=mOdXR9C3wMVov7cSY8PY-XCzo3SmmWCHvGQr5csJoao,91
|
|
6
|
+
dhis2_fetch_core-0.0.1.dist-info/top_level.txt,sha256=9vIIuZ-Pdb7WsX6rHWk3rOSci8ZIqa7I2tImfigf7N4,17
|
|
7
|
+
dhis2_fetch_core-0.0.1.dist-info/RECORD,,
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 dhis2-fetch-core contributors
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
dhis2_fetch_core
|