elapi 2.3.2__tar.gz → 2.4.0__tar.gz
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.
- {elapi-2.3.2 → elapi-2.4.0}/PKG-INFO +79 -52
- {elapi-2.3.2 → elapi-2.4.0}/README.md +50 -31
- {elapi-2.3.2 → elapi-2.4.0}/pyproject.toml +33 -13
- elapi-2.4.0/src/elapi/.DS_Store +0 -0
- elapi-2.4.0/src/elapi/VERSION +1 -0
- elapi-2.4.0/src/elapi/_core_init/__init__.py +55 -0
- elapi-2.4.0/src/elapi/_core_init/_loggers/__init__.py +26 -0
- elapi-2.4.0/src/elapi/_core_init/_loggers/base.py +151 -0
- elapi-2.4.0/src/elapi/_core_init/_loggers/handlers/__init__.py +11 -0
- elapi-2.4.0/src/elapi/_core_init/_loggers/handlers/base.py +64 -0
- elapi-2.4.0/src/elapi/_core_init/_loggers/handlers/callback.py +30 -0
- elapi-2.4.0/src/elapi/_core_init/_loggers/handlers/stderr.py +78 -0
- elapi-2.4.0/src/elapi/_core_init/_utils.py +116 -0
- {elapi-2.3.2 → elapi-2.4.0}/src/elapi/_names.py +1 -0
- elapi-2.4.0/src/elapi/_vendor/haggis/LICENSE +661 -0
- elapi-2.4.0/src/elapi/_vendor/haggis/__init__.py +82 -0
- elapi-2.4.0/src/elapi/_vendor/haggis/logs.py +689 -0
- elapi-2.4.0/src/elapi/_vendor/haggis/version.py +40 -0
- {elapi-2.3.2 → elapi-2.4.0}/src/elapi/api/api.py +73 -35
- {elapi-2.3.2 → elapi-2.4.0}/src/elapi/api/endpoint.py +13 -12
- {elapi-2.3.2 → elapi-2.4.0}/src/elapi/cli/elapi.py +154 -72
- {elapi-2.3.2 → elapi-2.4.0}/src/elapi/configuration/__init__.py +49 -45
- {elapi-2.3.2 → elapi-2.4.0}/src/elapi/configuration/_config_history.py +8 -6
- {elapi-2.3.2 → elapi-2.4.0}/src/elapi/configuration/_overload_history.py +22 -20
- {elapi-2.3.2 → elapi-2.4.0}/src/elapi/configuration/config.py +30 -25
- {elapi-2.3.2 → elapi-2.4.0}/src/elapi/configuration/overridable_vars.py +16 -9
- {elapi-2.3.2 → elapi-2.4.0}/src/elapi/configuration/validators.py +111 -35
- elapi-2.4.0/src/elapi/core_validators/__init__.py +20 -0
- {elapi-2.3.2 → elapi-2.4.0}/src/elapi/core_validators/base.py +14 -4
- {elapi-2.3.2 → elapi-2.4.0}/src/elapi/core_validators/path.py +6 -6
- elapi-2.4.0/src/elapi/loggers/__init__.py +35 -0
- elapi-2.4.0/src/elapi/loggers/base.py +71 -0
- elapi-2.4.0/src/elapi/loggers/handlers/__init__.py +4 -0
- {elapi-2.3.2 → elapi-2.4.0}/src/elapi/loggers/handlers/file.py +4 -4
- {elapi-2.3.2/src/elapi/configuration → elapi-2.4.0/src/elapi/loggers}/log_file.py +1 -1
- {elapi-2.3.2 → elapi-2.4.0}/src/elapi/path.py +66 -56
- elapi-2.4.0/src/elapi/plugins/.DS_Store +0 -0
- {elapi-2.3.2 → elapi-2.4.0}/src/elapi/plugins/bill_teams/cli.py +76 -66
- {elapi-2.3.2 → elapi-2.4.0}/src/elapi/plugins/bill_teams/configuration.py +9 -8
- elapi-2.4.0/src/elapi/plugins/bill_teams/logger.py +52 -0
- {elapi-2.3.2 → elapi-2.4.0}/src/elapi/plugins/bill_teams/names.py +10 -4
- {elapi-2.3.2 → elapi-2.4.0}/src/elapi/plugins/bill_teams/validators.py +20 -17
- elapi-2.4.0/src/elapi/plugins/commons/__init__.py +17 -0
- {elapi-2.3.2 → elapi-2.4.0}/src/elapi/plugins/commons/cli_helpers.py +47 -6
- {elapi-2.3.2 → elapi-2.4.0}/src/elapi/plugins/commons/get_information.py +1 -1
- {elapi-2.3.2 → elapi-2.4.0}/src/elapi/plugins/experiments/cli.py +24 -24
- {elapi-2.3.2 → elapi-2.4.0}/src/elapi/plugins/experiments/experiments.py +1 -1
- elapi-2.4.0/src/elapi/plugins/mail/__init__.py +22 -0
- elapi-2.4.0/src/elapi/plugins/mail/_yagmail_patch.py +266 -0
- elapi-2.4.0/src/elapi/plugins/mail/cli.py +47 -0
- elapi-2.4.0/src/elapi/plugins/mail/configuration.py +426 -0
- elapi-2.4.0/src/elapi/plugins/mail/mail.py +282 -0
- elapi-2.4.0/src/elapi/plugins/mail/names.py +53 -0
- elapi-2.4.0/src/elapi/plugins/mail/yagmail_configuration.py +132 -0
- {elapi-2.3.2 → elapi-2.4.0}/src/elapi/plugins/show_config.py +50 -24
- {elapi-2.3.2 → elapi-2.4.0}/src/elapi/styles/formats.py +17 -14
- elapi-2.4.0/src/elapi/utils/__init__.py +36 -0
- {elapi-2.3.2 → elapi-2.4.0}/src/elapi/utils/messages.py +5 -3
- {elapi-2.3.2 → elapi-2.4.0}/src/elapi/utils/utils.py +1 -9
- elapi-2.3.2/.assets/.old/urz-elabftw-light-dark-border.png +0 -0
- elapi-2.3.2/.assets/.old/urz-elabftw-light-dark-border.svg +0 -27
- elapi-2.3.2/.assets/.old/urz-elabftw-original.svg +0 -27
- elapi-2.3.2/.assets/.old/urz-elabftw-white-border.png +0 -0
- elapi-2.3.2/.assets/elAPI_logo.png +0 -0
- elapi-2.3.2/.gitignore +0 -290
- elapi-2.3.2/.vscode/launch.json +0 -14
- elapi-2.3.2/.vscode/settings.json +0 -3
- elapi-2.3.2/CHANGELOG.md +0 -337
- elapi-2.3.2/CITATION.cff +0 -16
- elapi-2.3.2/examples/README.md +0 -57
- elapi-2.3.2/examples/bash/create_user/create_new_user.sh +0 -40
- elapi-2.3.2/examples/bash/manage_resources/create_and_modify_new_resource.sh +0 -44
- elapi-2.3.2/examples/bash/manage_resources/get_all_resources.sh +0 -29
- elapi-2.3.2/examples/python/add_attachment_to_an_experiment/add_attachment_advanced.py +0 -103
- elapi-2.3.2/examples/python/add_attachment_to_an_experiment/add_attachment_simple.py +0 -61
- elapi-2.3.2/examples/python/add_attachment_to_an_experiment/attachments/ChemischeElemente_Beispiel.csv +0 -110
- elapi-2.3.2/examples/python/add_attachment_to_an_experiment/attachments/elapi_get_architecture_old.pdf +0 -0
- elapi-2.3.2/examples/python/create_plugins/awesome/cli.py +0 -43
- elapi-2.3.2/examples/python/create_plugins/obfuscate/README.md +0 -11
- elapi-2.3.2/examples/python/create_plugins/obfuscate/_cli_helpers.py +0 -345
- elapi-2.3.2/examples/python/create_plugins/obfuscate/cli.py +0 -248
- elapi-2.3.2/examples/python/create_plugins/obfuscate/names.py +0 -7
- elapi-2.3.2/examples/python/create_plugins/obfuscate/obfuscate.py +0 -74
- elapi-2.3.2/examples/python/create_plugins/obfuscate/pyproject.toml +0 -13
- elapi-2.3.2/examples/python/create_plugins/obfuscate/utils.py +0 -44
- elapi-2.3.2/examples/python/create_users/create_new_user_advanced.py +0 -188
- elapi-2.3.2/examples/python/create_users/create_new_user_in_batch_advanced.py +0 -118
- elapi-2.3.2/examples/python/create_users/create_new_user_simple.py +0 -79
- elapi-2.3.2/examples/python/create_users/create_new_user_with_password_advanced.py +0 -105
- elapi-2.3.2/examples/python/create_users/user_data.csv +0 -7
- elapi-2.3.2/examples/python/download_experiment_attachment/download_single_attachment.py +0 -108
- elapi-2.3.2/examples/python/download_experiments/download_bulk_experiments.py +0 -255
- elapi-2.3.2/examples/python/download_experiments/download_single_experiment.py +0 -85
- elapi-2.3.2/examples/python/manage_teams/expire_teams.py +0 -91
- elapi-2.3.2/examples/python/write_to_experiment/append_new_content_to_experiment.py +0 -80
- elapi-2.3.2/examples/python/write_to_experiment/aspirin_new_reserach_result.txt +0 -1
- elapi-2.3.2/src/elapi/VERSION +0 -1
- elapi-2.3.2/src/elapi/core_validators/__init__.py +0 -10
- elapi-2.3.2/src/elapi/loggers/__init__.py +0 -52
- elapi-2.3.2/src/elapi/loggers/base.py +0 -113
- elapi-2.3.2/src/elapi/loggers/handlers/__init__.py +0 -28
- elapi-2.3.2/src/elapi/loggers/handlers/stderr.py +0 -49
- elapi-2.3.2/src/elapi/plugins/bill_teams/logging_handler.py +0 -34
- elapi-2.3.2/src/elapi/plugins/commons/__init__.py +0 -5
- elapi-2.3.2/src/elapi/utils/__init__.py +0 -11
- elapi-2.3.2/uv.lock +0 -505
- {elapi-2.3.2 → elapi-2.4.0}/LICENSE +0 -0
- {elapi-2.3.2 → elapi-2.4.0}/src/elapi/__init__.py +0 -0
- {elapi-2.3.2/examples/python/create_plugins/obfuscate → elapi-2.4.0/src/elapi/_vendor}/__init__.py +0 -0
- {elapi-2.3.2 → elapi-2.4.0}/src/elapi/api/__init__.py +0 -0
- {elapi-2.3.2 → elapi-2.4.0}/src/elapi/api/validators.py +0 -0
- {elapi-2.3.2 → elapi-2.4.0}/src/elapi/cli/__init__.py +0 -0
- {elapi-2.3.2 → elapi-2.4.0}/src/elapi/cli/__main__.py +0 -0
- {elapi-2.3.2 → elapi-2.4.0}/src/elapi/cli/_plugin_handler.py +0 -0
- {elapi-2.3.2 → elapi-2.4.0}/src/elapi/cli/_venv_state_manager.py +0 -0
- {elapi-2.3.2 → elapi-2.4.0}/src/elapi/cli/doc.py +0 -0
- {elapi-2.3.2 → elapi-2.4.0}/src/elapi/plugins/__init__.py +0 -0
- {elapi-2.3.2 → elapi-2.4.0}/src/elapi/plugins/bill_teams/__init__.py +0 -0
- {elapi-2.3.2 → elapi-2.4.0}/src/elapi/plugins/bill_teams/_doc.py +0 -0
- {elapi-2.3.2 → elapi-2.4.0}/src/elapi/plugins/bill_teams/bill_teams.py +0 -0
- {elapi-2.3.2 → elapi-2.4.0}/src/elapi/plugins/bill_teams/formats.py +0 -0
- {elapi-2.3.2 → elapi-2.4.0}/src/elapi/plugins/bill_teams/generate_table.py +0 -0
- {elapi-2.3.2 → elapi-2.4.0}/src/elapi/plugins/bill_teams/registry.py +0 -0
- {elapi-2.3.2 → elapi-2.4.0}/src/elapi/plugins/bill_teams/specification.py +0 -0
- {elapi-2.3.2 → elapi-2.4.0}/src/elapi/plugins/bill_teams/utils.py +0 -0
- {elapi-2.3.2 → elapi-2.4.0}/src/elapi/plugins/commons/export.py +0 -0
- {elapi-2.3.2 → elapi-2.4.0}/src/elapi/plugins/commons/get_data_from_input_or_path.py +0 -0
- {elapi-2.3.2 → elapi-2.4.0}/src/elapi/plugins/commons/get_location_from_headers.py +0 -0
- {elapi-2.3.2 → elapi-2.4.0}/src/elapi/plugins/experiments/__init__.py +0 -0
- {elapi-2.3.2 → elapi-2.4.0}/src/elapi/plugins/experiments/_doc.py +0 -0
- {elapi-2.3.2 → elapi-2.4.0}/src/elapi/plugins/experiments/formats.py +0 -0
- {elapi-2.3.2 → elapi-2.4.0}/src/elapi/styles/__init__.py +0 -0
- {elapi-2.3.2 → elapi-2.4.0}/src/elapi/styles/_markdown_doc.py +0 -0
- {elapi-2.3.2 → elapi-2.4.0}/src/elapi/styles/_missing.py +0 -0
- {elapi-2.3.2 → elapi-2.4.0}/src/elapi/styles/base.py +0 -0
- {elapi-2.3.2 → elapi-2.4.0}/src/elapi/styles/colors.py +0 -0
- {elapi-2.3.2 → elapi-2.4.0}/src/elapi/styles/highlight.py +0 -0
- {elapi-2.3.2 → elapi-2.4.0}/src/elapi/styles/rich_utils.py +0 -0
- {elapi-2.3.2 → elapi-2.4.0}/src/elapi/utils/typer_patches.py +0 -0
- {elapi-2.3.2 → elapi-2.4.0}/src/elapi/validators.py +0 -0
|
@@ -1,16 +1,14 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: elapi
|
|
3
|
-
Version: 2.
|
|
3
|
+
Version: 2.4.0
|
|
4
4
|
Summary: elAPI is a powerful, extensible API client for eLabFTW.
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
Project-URL: Changelog, https://github.com/uhd-urz/elAPI/blob/main/CHANGELOG.md
|
|
9
|
-
Author-email: "Alexander Haller, Mahadi Xion" <elabftw@uni-heidelberg.de>
|
|
10
|
-
Maintainer-email: Mahadi Xion <mahadi.xion@urz.uni-heidelberg.de>
|
|
5
|
+
Keywords: elabftw,api
|
|
6
|
+
Author: Alexander Haller, Mahadi Xion
|
|
7
|
+
Author-email: Alexander Haller, Mahadi Xion <elabftw@uni-heidelberg.de>
|
|
11
8
|
License-Expression: AGPL-3.0-only
|
|
12
9
|
License-File: LICENSE
|
|
13
|
-
|
|
10
|
+
License-File: src/elapi/_vendor/__init__.py
|
|
11
|
+
License-File: src/elapi/_vendor/haggis/LICENSE
|
|
14
12
|
Classifier: Development Status :: 5 - Production/Stable
|
|
15
13
|
Classifier: Framework :: AnyIO
|
|
16
14
|
Classifier: Framework :: AsyncIO
|
|
@@ -22,20 +20,30 @@ Classifier: Topic :: Internet :: WWW/HTTP
|
|
|
22
20
|
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
23
21
|
Classifier: Topic :: System :: Systems Administration
|
|
24
22
|
Classifier: Topic :: Utilities
|
|
25
|
-
Requires-
|
|
26
|
-
Requires-Dist:
|
|
27
|
-
Requires-Dist:
|
|
28
|
-
Requires-Dist:
|
|
29
|
-
Requires-Dist:
|
|
30
|
-
Requires-Dist:
|
|
31
|
-
Requires-Dist: mistune
|
|
32
|
-
Requires-Dist:
|
|
33
|
-
Requires-Dist:
|
|
34
|
-
Requires-Dist:
|
|
23
|
+
Requires-Dist: dynaconf>=3.2.0,<4
|
|
24
|
+
Requires-Dist: httpx[http2]>=0.28.1,<0.29
|
|
25
|
+
Requires-Dist: httpx-auth>=0.23.1,<0.24
|
|
26
|
+
Requires-Dist: rich>=13.8.0,<14
|
|
27
|
+
Requires-Dist: typer[all]>=0.9.0,<0.10
|
|
28
|
+
Requires-Dist: pyyaml==6.0.2
|
|
29
|
+
Requires-Dist: mistune==3.1.3
|
|
30
|
+
Requires-Dist: click>=8.1.8,<8.2
|
|
31
|
+
Requires-Dist: httpx-limiter>=0.4.0,<0.5
|
|
32
|
+
Requires-Dist: jinja2>=3.1.6,<3.2 ; extra == 'mail'
|
|
33
|
+
Requires-Dist: nameparser>=1.1.3 ; extra == 'mail'
|
|
34
|
+
Requires-Dist: yagmail>=0.15.293,<0.16 ; extra == 'mail'
|
|
35
|
+
Requires-Dist: python-dateutil>=2.9.0.post0,<3 ; extra == 'uhd-urz'
|
|
36
|
+
Requires-Dist: tenacity>=9.1.2,<10 ; extra == 'uhd-urz'
|
|
37
|
+
Requires-Dist: uvloop>=0.21.0,<0.22 ; extra == 'uhd-urz'
|
|
38
|
+
Maintainer: Mahadi Xion
|
|
39
|
+
Maintainer-email: Mahadi Xion <mahadi.xion@urz.uni-heidelberg.de>
|
|
40
|
+
Requires-Python: >=3.11.0, <4
|
|
41
|
+
Project-URL: Changelog, https://github.com/uhd-urz/elAPI/blob/main/CHANGELOG.md
|
|
42
|
+
Project-URL: Homepage, https://www.urz.uni-heidelberg.de/de/service-katalog/software-und-anwendungen/elabftw
|
|
43
|
+
Project-URL: Issues, https://github.com/uhd-urz/elAPI/issues
|
|
44
|
+
Project-URL: Repository, https://github.com/uhd-urz/elAPI.git
|
|
45
|
+
Provides-Extra: mail
|
|
35
46
|
Provides-Extra: uhd-urz
|
|
36
|
-
Requires-Dist: python-dateutil<3,>=2.9.0.post0; extra == 'uhd-urz'
|
|
37
|
-
Requires-Dist: tenacity<10,>=9.0.0; extra == 'uhd-urz'
|
|
38
|
-
Requires-Dist: uvloop<0.21,>=0.20.0; extra == 'uhd-urz'
|
|
39
47
|
Description-Content-Type: text/markdown
|
|
40
48
|
|
|
41
49
|
<p align="center">
|
|
@@ -47,23 +55,24 @@ Description-Content-Type: text/markdown
|
|
|
47
55
|
<img alt="Package version" src="https://badge.fury.io/py/elapi.svg/?branch=main" />
|
|
48
56
|
</a>
|
|
49
57
|
<a href="#compatibility">
|
|
50
|
-
<img alt="Static Badge" src="https://img.shields.io/badge/python-3.
|
|
58
|
+
<img alt="Static Badge" src="https://img.shields.io/badge/python-3.11%20%7C%203.12%20%7C%203.13-%230d7dbe">
|
|
51
59
|
<img alt="Static Badge" src="https://img.shields.io/badge/eLabFTW%20support-4.5%2B%20%7C%205.0%20%7C%205.1-%2323b3be">
|
|
52
60
|
</a>
|
|
53
61
|
</p>
|
|
54
62
|
|
|
55
63
|
elAPI is a powerful, extensible API client for [eLabFTW](https://www.elabftw.net/) developed at
|
|
56
|
-
the [University Computing Centre](https://www.urz.uni-heidelberg.de/en)
|
|
57
|
-
|
|
58
|
-
[University of Heidelberg](https://www.uni-heidelberg.de/en).
|
|
59
|
-
[eLabFTW
|
|
60
|
-
|
|
64
|
+
the [University Computing Centre](https://www.urz.uni-heidelberg.de/en) (
|
|
65
|
+
URZ, [FIRE](https://www.urz.uni-heidelberg.de/en/node/64/organisation/future-it-research-education) division)
|
|
66
|
+
of [University of Heidelberg](https://www.uni-heidelberg.de/en). elAPI has complete support
|
|
67
|
+
for [eLabFTW REST APIv2](https://doc.elabftw.net/api/v2/). elAPI executable comes with a simple CLI interface for
|
|
68
|
+
performing fast and quick API tasks. elAPI Python package brings a suite of convenience APIs to help streamline advanced
|
|
69
|
+
API automation tasks. Check out our [examples](#examples-and-usage).
|
|
61
70
|
|
|
62
71
|
<img src="https://heibox.uni-heidelberg.de/f/7714c7eeb0f54a3ba318/?dl=1" alt="elAPI features in a nutshell" />
|
|
63
72
|
|
|
64
73
|
**Example:**
|
|
65
74
|
|
|
66
|
-
From [the documentation](https://doc.elabftw.net/api/v2/#/Users/read-user):
|
|
75
|
+
From [the API documentation](https://doc.elabftw.net/api/v2/#/Users/read-user):
|
|
67
76
|
> GET /users/{id}
|
|
68
77
|
|
|
69
78
|
With elAPI you can do the following:
|
|
@@ -97,8 +106,8 @@ the terminal. You can move on to ["Getting started"](#getting-started).
|
|
|
97
106
|
|
|
98
107
|
elAPI can be used both as a CLI tool and as a Python library. If you are interested in simply using elAPI's
|
|
99
108
|
off-the-shelf features from the command-line, install elAPI as a CLI tool (see ["Installation"](#installation)). If you
|
|
100
|
-
intend to write automation script for eLabFTW, you should install elAPI as a library inside a virtual environment. Of
|
|
101
|
-
course, if you
|
|
109
|
+
intend to write an automation script for eLabFTW, you should install elAPI as a library inside a virtual environment. Of
|
|
110
|
+
course, if you need both, you can have elAPI installed in both ways.
|
|
102
111
|
|
|
103
112
|
> [!NOTE]
|
|
104
113
|
> Support for installing Python packages with `pip install --user` has been deprecated with the adoption
|
|
@@ -108,9 +117,9 @@ course, if you're interested in both, you can have elAPI installed in both ways.
|
|
|
108
117
|
### Installing elAPI as a library
|
|
109
118
|
|
|
110
119
|
It is recommended to install elAPI inside a Python virtual environment with your preferred package manager (`pip`,
|
|
111
|
-
`poetry`, `pipenv`, `rye`, `uv`, etc.) for
|
|
112
|
-
|
|
113
|
-
|
|
120
|
+
`poetry`, `pipenv`, `rye`, `uv`, etc.). With `uv`, for example, run `uv add elapi`. From inside a virtual environment,
|
|
121
|
+
elAPI CLI can be invoked with `python -m elapi.cli`. At the moment, though, the documentation about using elAPI as a
|
|
122
|
+
library is severely lacking.
|
|
114
123
|
|
|
115
124
|
## Getting started
|
|
116
125
|
|
|
@@ -128,20 +137,19 @@ That's all! Run [`elapi show-config`](#show-config) to view your configuration d
|
|
|
128
137
|
|
|
129
138
|
## Compatibility
|
|
130
139
|
|
|
131
|
-
elAPI is compatible with the following Python versions: `3.
|
|
140
|
+
elAPI is compatible with the following Python versions: `3.11`, `3.12`. elAPI supports
|
|
132
141
|
the [eLabFTW REST API v2](https://doc.elabftw.net/api/v2/), and can be used with the following eLabFTW
|
|
133
|
-
versions: `4.5`, `4.6`, `4.7`, `4.8`, `4.9`, `4.10`, `5.0`, `5.1
|
|
142
|
+
versions: `4.5`, `4.6`, `4.7`, `4.8`, `4.9`, `4.10`, `5.0`, `5.1`, `5.2`, and above.
|
|
134
143
|
|
|
135
144
|
## Configuration
|
|
136
145
|
|
|
137
146
|
elAPI needs to be configured first before you can do anything useful with it. Mainly, elAPI needs to know your eLabFTW
|
|
138
|
-
server's API URL and your API key (or token) for access. See quick configuration method
|
|
147
|
+
server's API URL and your API key (or token) for access. See a quick configuration method
|
|
139
148
|
in "[Getting started](#getting-started)" before you dive into the advanced settings.
|
|
140
149
|
|
|
141
150
|
### Advanced configuration
|
|
142
151
|
|
|
143
|
-
elAPI supports a YAML configuration file in
|
|
144
|
-
the following locations.
|
|
152
|
+
elAPI supports a YAML configuration file in the following locations.
|
|
145
153
|
|
|
146
154
|
- Current directory: `./elapi.yml`
|
|
147
155
|
- User directory: `$HOME/.config/elapi.yml`
|
|
@@ -149,11 +157,10 @@ the following locations.
|
|
|
149
157
|
|
|
150
158
|
elAPI supports configuration overloading. I.e., a keyword set in root configuration file `/etc/elapi.yml` can be
|
|
151
159
|
overridden by setting a different value in user configuration file `$HOME/.config/elapi.yml`. In terms of precedence,
|
|
152
|
-
configuration file present in the currently active directory has the highest priority, and configuration in
|
|
153
|
-
directory has the lowest.
|
|
160
|
+
a configuration file present in the currently active directory has the highest priority, and a configuration file in the
|
|
161
|
+
root directory has the lowest.
|
|
154
162
|
|
|
155
|
-
The following parameters are currently configurable, with `host` and `api_token` being the required fields.
|
|
156
|
-
purposes, it would be safe to store everything in `$HOME/.config/elapi.yml`.
|
|
163
|
+
The following parameters are currently configurable, with `host` and `api_token` being the required fields.
|
|
157
164
|
|
|
158
165
|
```yaml
|
|
159
166
|
# elAPI configuration
|
|
@@ -169,6 +176,8 @@ unsafe_api_token_warning: true
|
|
|
169
176
|
enable_http2: false
|
|
170
177
|
verify_ssl: true
|
|
171
178
|
timeout: 90
|
|
179
|
+
async_rate_limit: 100
|
|
180
|
+
development_mode: false
|
|
172
181
|
```
|
|
173
182
|
|
|
174
183
|
- `export_dir` is where elAPI will export response content to if no path is explicitly provided to `--export/-E`.
|
|
@@ -182,14 +191,20 @@ timeout: 90
|
|
|
182
191
|
trying out a development server that doesn't provide a valid SSL certificate.
|
|
183
192
|
- `timeout` can be modified to your needs. E.g., a poor internet connection might benefit from a higher timeout number.
|
|
184
193
|
The default timeout is `90` seconds.
|
|
194
|
+
- `async_rate_limit` controls the maximum number of requests per second (i.e., throughput) you want to make to the
|
|
195
|
+
server. Default `async_rate_limit` is `null` which is to say no limit. An eLab server might be configured to limit
|
|
196
|
+
a high number of requests to prevent spam, `async_rate_limit` can then be set to the maximum number of requests
|
|
197
|
+
allowed by the server.
|
|
198
|
+
- `development_mode` can be set to `True` to show debug logs, Python traceback on the CLI instead of a clean exit, etc.
|
|
199
|
+
This mode should not be turned on for production-ready scripts.
|
|
185
200
|
|
|
186
201
|
### `show-config`
|
|
187
202
|
|
|
188
203
|
You can get an overview of detected configuration with `elapi show-config`. `show-config` makes it easier to verify
|
|
189
|
-
which configuration values are actually used by elAPI
|
|
204
|
+
which configuration values are actually used by elAPI – especially if you are working with multiple configuration files.
|
|
190
205
|
|
|
191
206
|
```shell
|
|
192
|
-
$ elapi show-config #
|
|
207
|
+
$ elapi show-config # host username: "culdesac"
|
|
193
208
|
```
|
|
194
209
|
|
|
195
210
|

|
|
@@ -229,7 +244,7 @@ $ elapi get experiments --export ~/Downoads/experiments.json
|
|
|
229
244
|
```
|
|
230
245
|
|
|
231
246
|
Enable built-in syntax highlighting with `--highlight` or `-H`. Here, the following command will fetch team information
|
|
232
|
-
of team with team ID 1.
|
|
247
|
+
of the team with team ID 1.
|
|
233
248
|
|
|
234
249
|
```shell
|
|
235
250
|
$ elapi get -H teams --id 1
|
|
@@ -266,7 +281,7 @@ $ elapi patch config -d '{"announcement": "Notice: Server will be down tomorrow
|
|
|
266
281
|
|
|
267
282
|
### `DELETE` requests
|
|
268
283
|
|
|
269
|
-
Delete all the tags associated
|
|
284
|
+
Delete all the tags associated with an experiment:
|
|
270
285
|
|
|
271
286
|
```shell
|
|
272
287
|
$ elapi delete experiments -i <experiment ID> --sub tags
|
|
@@ -287,7 +302,7 @@ to `~/Downloads` directory.
|
|
|
287
302
|
$ elapi experiments get -i <experiment unique elabid> -F pdf --export ~/Downloads/
|
|
288
303
|
```
|
|
289
304
|
|
|
290
|
-
Append text in
|
|
305
|
+
Append text in Markdown to an existing experiment by its ID:
|
|
291
306
|
|
|
292
307
|
```shell
|
|
293
308
|
$ elapi experiments append --id <experiment ID> -M -t "**New content.**"
|
|
@@ -299,12 +314,25 @@ You can also upload an attachment to an experiment.
|
|
|
299
314
|
$ elapi experiments upload-attachment --id <experiment ID> --path <path to attachment file> --comment <comment for your attachment>
|
|
300
315
|
```
|
|
301
316
|
|
|
317
|
+
### `mail` built-in plugin
|
|
318
|
+
|
|
319
|
+
Sometimes when a script has finished, you and your team would want to receive an email about its success/failure. elAPI
|
|
320
|
+
offers a no-code solution for this: the `mail` plugin. The `mail` plugin is not enabled by default. To enable it,
|
|
321
|
+
install elAPI with the optional dependency `mail`: `pip install elapi[mail]` or `uv add elapi[mail]`. [__See the wiki__](https://github.com/uhd-urz/elAPI/wiki/mail-plugin) to read more about how to configure the `mail` plugin with your
|
|
322
|
+
mail server configuration and trigger conditions. In a
|
|
323
|
+
nutshell, the `mail` plugin will scan the logs when a script/plugin is done to look for pre-configured trigger
|
|
324
|
+
conditions, and if found, it will send an email. The trigger conditions can be atomic and scope-based, i.e., an email
|
|
325
|
+
can be sent only when a specific plugin task/command is finished, and/or when a matching log state and/or a matching log
|
|
326
|
+
pattern is found.
|
|
327
|
+
|
|
328
|
+
<img alt="elAPI email trigger screenshot" src="https://github.com/user-attachments/assets/2dc0df3e-0d91-41f3-af28-4040da641a70" />
|
|
329
|
+
|
|
302
330
|
## Creating a plugin
|
|
303
331
|
|
|
304
|
-
elAPI has seamless support with tight
|
|
332
|
+
elAPI has seamless support with tight integration for third-party plugins. A simple third-party plugin can be created in
|
|
305
333
|
a few easy steps:
|
|
306
334
|
|
|
307
|
-
1. Create a new subfolder under `~/.local/share/elapi/plugins` with the name for your new plugin (e.g
|
|
335
|
+
1. Create a new subfolder under `~/.local/share/elapi/plugins` with the name for your new plugin (e.g., a folder named
|
|
308
336
|
"test")
|
|
309
337
|
2. Create a `cli.py` in the subfolder with the following snippet:
|
|
310
338
|
|
|
@@ -318,8 +346,7 @@ app = Typer(name="test", help="Test plugin.")
|
|
|
318
346
|
3. Run `elapi` again to see your plugin name under `Third-party plugins` list
|
|
319
347
|
|
|
320
348
|
Plugins are integrated in a way such that a plugin will **not** fail elAPI. So, even if one erroneous plugin is loaded,
|
|
321
|
-
all
|
|
322
|
-
other plugins and elAPI itself will remain unaffected. elAPI will show the error message on the "Message" panel.
|
|
349
|
+
all other plugins and elAPI itself will remain unaffected. elAPI will show the error message on the "Message" panel.
|
|
323
350
|
|
|
324
351
|
If you try to import a package that is not a dependency of elAPI inside `cli.py`, your plugin will fail. In that case,
|
|
325
352
|
you want to create a plugin metadata file `elapi_plugin_metadata.yml` (notice only `.yml` extension is allowed), and
|
|
@@ -347,7 +374,7 @@ def wiki_status():
|
|
|
347
374
|
print(r)
|
|
348
375
|
```
|
|
349
376
|
|
|
350
|
-
And the path to virtual environment will be defined in the metadata file:
|
|
377
|
+
And, the path to the virtual environment will be defined in the metadata file:
|
|
351
378
|
|
|
352
379
|
```yaml
|
|
353
380
|
# elapi_plugin_metadata.yml
|
|
@@ -7,23 +7,24 @@
|
|
|
7
7
|
<img alt="Package version" src="https://badge.fury.io/py/elapi.svg/?branch=main" />
|
|
8
8
|
</a>
|
|
9
9
|
<a href="#compatibility">
|
|
10
|
-
<img alt="Static Badge" src="https://img.shields.io/badge/python-3.
|
|
10
|
+
<img alt="Static Badge" src="https://img.shields.io/badge/python-3.11%20%7C%203.12%20%7C%203.13-%230d7dbe">
|
|
11
11
|
<img alt="Static Badge" src="https://img.shields.io/badge/eLabFTW%20support-4.5%2B%20%7C%205.0%20%7C%205.1-%2323b3be">
|
|
12
12
|
</a>
|
|
13
13
|
</p>
|
|
14
14
|
|
|
15
15
|
elAPI is a powerful, extensible API client for [eLabFTW](https://www.elabftw.net/) developed at
|
|
16
|
-
the [University Computing Centre](https://www.urz.uni-heidelberg.de/en)
|
|
17
|
-
|
|
18
|
-
[University of Heidelberg](https://www.uni-heidelberg.de/en).
|
|
19
|
-
[eLabFTW
|
|
20
|
-
|
|
16
|
+
the [University Computing Centre](https://www.urz.uni-heidelberg.de/en) (
|
|
17
|
+
URZ, [FIRE](https://www.urz.uni-heidelberg.de/en/node/64/organisation/future-it-research-education) division)
|
|
18
|
+
of [University of Heidelberg](https://www.uni-heidelberg.de/en). elAPI has complete support
|
|
19
|
+
for [eLabFTW REST APIv2](https://doc.elabftw.net/api/v2/). elAPI executable comes with a simple CLI interface for
|
|
20
|
+
performing fast and quick API tasks. elAPI Python package brings a suite of convenience APIs to help streamline advanced
|
|
21
|
+
API automation tasks. Check out our [examples](#examples-and-usage).
|
|
21
22
|
|
|
22
23
|
<img src="https://heibox.uni-heidelberg.de/f/7714c7eeb0f54a3ba318/?dl=1" alt="elAPI features in a nutshell" />
|
|
23
24
|
|
|
24
25
|
**Example:**
|
|
25
26
|
|
|
26
|
-
From [the documentation](https://doc.elabftw.net/api/v2/#/Users/read-user):
|
|
27
|
+
From [the API documentation](https://doc.elabftw.net/api/v2/#/Users/read-user):
|
|
27
28
|
> GET /users/{id}
|
|
28
29
|
|
|
29
30
|
With elAPI you can do the following:
|
|
@@ -57,8 +58,8 @@ the terminal. You can move on to ["Getting started"](#getting-started).
|
|
|
57
58
|
|
|
58
59
|
elAPI can be used both as a CLI tool and as a Python library. If you are interested in simply using elAPI's
|
|
59
60
|
off-the-shelf features from the command-line, install elAPI as a CLI tool (see ["Installation"](#installation)). If you
|
|
60
|
-
intend to write automation script for eLabFTW, you should install elAPI as a library inside a virtual environment. Of
|
|
61
|
-
course, if you
|
|
61
|
+
intend to write an automation script for eLabFTW, you should install elAPI as a library inside a virtual environment. Of
|
|
62
|
+
course, if you need both, you can have elAPI installed in both ways.
|
|
62
63
|
|
|
63
64
|
> [!NOTE]
|
|
64
65
|
> Support for installing Python packages with `pip install --user` has been deprecated with the adoption
|
|
@@ -68,9 +69,9 @@ course, if you're interested in both, you can have elAPI installed in both ways.
|
|
|
68
69
|
### Installing elAPI as a library
|
|
69
70
|
|
|
70
71
|
It is recommended to install elAPI inside a Python virtual environment with your preferred package manager (`pip`,
|
|
71
|
-
`poetry`, `pipenv`, `rye`, `uv`, etc.) for
|
|
72
|
-
|
|
73
|
-
|
|
72
|
+
`poetry`, `pipenv`, `rye`, `uv`, etc.). With `uv`, for example, run `uv add elapi`. From inside a virtual environment,
|
|
73
|
+
elAPI CLI can be invoked with `python -m elapi.cli`. At the moment, though, the documentation about using elAPI as a
|
|
74
|
+
library is severely lacking.
|
|
74
75
|
|
|
75
76
|
## Getting started
|
|
76
77
|
|
|
@@ -88,20 +89,19 @@ That's all! Run [`elapi show-config`](#show-config) to view your configuration d
|
|
|
88
89
|
|
|
89
90
|
## Compatibility
|
|
90
91
|
|
|
91
|
-
elAPI is compatible with the following Python versions: `3.
|
|
92
|
+
elAPI is compatible with the following Python versions: `3.11`, `3.12`. elAPI supports
|
|
92
93
|
the [eLabFTW REST API v2](https://doc.elabftw.net/api/v2/), and can be used with the following eLabFTW
|
|
93
|
-
versions: `4.5`, `4.6`, `4.7`, `4.8`, `4.9`, `4.10`, `5.0`, `5.1
|
|
94
|
+
versions: `4.5`, `4.6`, `4.7`, `4.8`, `4.9`, `4.10`, `5.0`, `5.1`, `5.2`, and above.
|
|
94
95
|
|
|
95
96
|
## Configuration
|
|
96
97
|
|
|
97
98
|
elAPI needs to be configured first before you can do anything useful with it. Mainly, elAPI needs to know your eLabFTW
|
|
98
|
-
server's API URL and your API key (or token) for access. See quick configuration method
|
|
99
|
+
server's API URL and your API key (or token) for access. See a quick configuration method
|
|
99
100
|
in "[Getting started](#getting-started)" before you dive into the advanced settings.
|
|
100
101
|
|
|
101
102
|
### Advanced configuration
|
|
102
103
|
|
|
103
|
-
elAPI supports a YAML configuration file in
|
|
104
|
-
the following locations.
|
|
104
|
+
elAPI supports a YAML configuration file in the following locations.
|
|
105
105
|
|
|
106
106
|
- Current directory: `./elapi.yml`
|
|
107
107
|
- User directory: `$HOME/.config/elapi.yml`
|
|
@@ -109,11 +109,10 @@ the following locations.
|
|
|
109
109
|
|
|
110
110
|
elAPI supports configuration overloading. I.e., a keyword set in root configuration file `/etc/elapi.yml` can be
|
|
111
111
|
overridden by setting a different value in user configuration file `$HOME/.config/elapi.yml`. In terms of precedence,
|
|
112
|
-
configuration file present in the currently active directory has the highest priority, and configuration in
|
|
113
|
-
directory has the lowest.
|
|
112
|
+
a configuration file present in the currently active directory has the highest priority, and a configuration file in the
|
|
113
|
+
root directory has the lowest.
|
|
114
114
|
|
|
115
|
-
The following parameters are currently configurable, with `host` and `api_token` being the required fields.
|
|
116
|
-
purposes, it would be safe to store everything in `$HOME/.config/elapi.yml`.
|
|
115
|
+
The following parameters are currently configurable, with `host` and `api_token` being the required fields.
|
|
117
116
|
|
|
118
117
|
```yaml
|
|
119
118
|
# elAPI configuration
|
|
@@ -129,6 +128,8 @@ unsafe_api_token_warning: true
|
|
|
129
128
|
enable_http2: false
|
|
130
129
|
verify_ssl: true
|
|
131
130
|
timeout: 90
|
|
131
|
+
async_rate_limit: 100
|
|
132
|
+
development_mode: false
|
|
132
133
|
```
|
|
133
134
|
|
|
134
135
|
- `export_dir` is where elAPI will export response content to if no path is explicitly provided to `--export/-E`.
|
|
@@ -142,14 +143,20 @@ timeout: 90
|
|
|
142
143
|
trying out a development server that doesn't provide a valid SSL certificate.
|
|
143
144
|
- `timeout` can be modified to your needs. E.g., a poor internet connection might benefit from a higher timeout number.
|
|
144
145
|
The default timeout is `90` seconds.
|
|
146
|
+
- `async_rate_limit` controls the maximum number of requests per second (i.e., throughput) you want to make to the
|
|
147
|
+
server. Default `async_rate_limit` is `null` which is to say no limit. An eLab server might be configured to limit
|
|
148
|
+
a high number of requests to prevent spam, `async_rate_limit` can then be set to the maximum number of requests
|
|
149
|
+
allowed by the server.
|
|
150
|
+
- `development_mode` can be set to `True` to show debug logs, Python traceback on the CLI instead of a clean exit, etc.
|
|
151
|
+
This mode should not be turned on for production-ready scripts.
|
|
145
152
|
|
|
146
153
|
### `show-config`
|
|
147
154
|
|
|
148
155
|
You can get an overview of detected configuration with `elapi show-config`. `show-config` makes it easier to verify
|
|
149
|
-
which configuration values are actually used by elAPI
|
|
156
|
+
which configuration values are actually used by elAPI – especially if you are working with multiple configuration files.
|
|
150
157
|
|
|
151
158
|
```shell
|
|
152
|
-
$ elapi show-config #
|
|
159
|
+
$ elapi show-config # host username: "culdesac"
|
|
153
160
|
```
|
|
154
161
|
|
|
155
162
|

|
|
@@ -189,7 +196,7 @@ $ elapi get experiments --export ~/Downoads/experiments.json
|
|
|
189
196
|
```
|
|
190
197
|
|
|
191
198
|
Enable built-in syntax highlighting with `--highlight` or `-H`. Here, the following command will fetch team information
|
|
192
|
-
of team with team ID 1.
|
|
199
|
+
of the team with team ID 1.
|
|
193
200
|
|
|
194
201
|
```shell
|
|
195
202
|
$ elapi get -H teams --id 1
|
|
@@ -226,7 +233,7 @@ $ elapi patch config -d '{"announcement": "Notice: Server will be down tomorrow
|
|
|
226
233
|
|
|
227
234
|
### `DELETE` requests
|
|
228
235
|
|
|
229
|
-
Delete all the tags associated
|
|
236
|
+
Delete all the tags associated with an experiment:
|
|
230
237
|
|
|
231
238
|
```shell
|
|
232
239
|
$ elapi delete experiments -i <experiment ID> --sub tags
|
|
@@ -247,7 +254,7 @@ to `~/Downloads` directory.
|
|
|
247
254
|
$ elapi experiments get -i <experiment unique elabid> -F pdf --export ~/Downloads/
|
|
248
255
|
```
|
|
249
256
|
|
|
250
|
-
Append text in
|
|
257
|
+
Append text in Markdown to an existing experiment by its ID:
|
|
251
258
|
|
|
252
259
|
```shell
|
|
253
260
|
$ elapi experiments append --id <experiment ID> -M -t "**New content.**"
|
|
@@ -259,12 +266,25 @@ You can also upload an attachment to an experiment.
|
|
|
259
266
|
$ elapi experiments upload-attachment --id <experiment ID> --path <path to attachment file> --comment <comment for your attachment>
|
|
260
267
|
```
|
|
261
268
|
|
|
269
|
+
### `mail` built-in plugin
|
|
270
|
+
|
|
271
|
+
Sometimes when a script has finished, you and your team would want to receive an email about its success/failure. elAPI
|
|
272
|
+
offers a no-code solution for this: the `mail` plugin. The `mail` plugin is not enabled by default. To enable it,
|
|
273
|
+
install elAPI with the optional dependency `mail`: `pip install elapi[mail]` or `uv add elapi[mail]`. [__See the wiki__](https://github.com/uhd-urz/elAPI/wiki/mail-plugin) to read more about how to configure the `mail` plugin with your
|
|
274
|
+
mail server configuration and trigger conditions. In a
|
|
275
|
+
nutshell, the `mail` plugin will scan the logs when a script/plugin is done to look for pre-configured trigger
|
|
276
|
+
conditions, and if found, it will send an email. The trigger conditions can be atomic and scope-based, i.e., an email
|
|
277
|
+
can be sent only when a specific plugin task/command is finished, and/or when a matching log state and/or a matching log
|
|
278
|
+
pattern is found.
|
|
279
|
+
|
|
280
|
+
<img alt="elAPI email trigger screenshot" src="https://github.com/user-attachments/assets/2dc0df3e-0d91-41f3-af28-4040da641a70" />
|
|
281
|
+
|
|
262
282
|
## Creating a plugin
|
|
263
283
|
|
|
264
|
-
elAPI has seamless support with tight
|
|
284
|
+
elAPI has seamless support with tight integration for third-party plugins. A simple third-party plugin can be created in
|
|
265
285
|
a few easy steps:
|
|
266
286
|
|
|
267
|
-
1. Create a new subfolder under `~/.local/share/elapi/plugins` with the name for your new plugin (e.g
|
|
287
|
+
1. Create a new subfolder under `~/.local/share/elapi/plugins` with the name for your new plugin (e.g., a folder named
|
|
268
288
|
"test")
|
|
269
289
|
2. Create a `cli.py` in the subfolder with the following snippet:
|
|
270
290
|
|
|
@@ -278,8 +298,7 @@ app = Typer(name="test", help="Test plugin.")
|
|
|
278
298
|
3. Run `elapi` again to see your plugin name under `Third-party plugins` list
|
|
279
299
|
|
|
280
300
|
Plugins are integrated in a way such that a plugin will **not** fail elAPI. So, even if one erroneous plugin is loaded,
|
|
281
|
-
all
|
|
282
|
-
other plugins and elAPI itself will remain unaffected. elAPI will show the error message on the "Message" panel.
|
|
301
|
+
all other plugins and elAPI itself will remain unaffected. elAPI will show the error message on the "Message" panel.
|
|
283
302
|
|
|
284
303
|
If you try to import a package that is not a dependency of elAPI inside `cli.py`, your plugin will fail. In that case,
|
|
285
304
|
you want to create a plugin metadata file `elapi_plugin_metadata.yml` (notice only `.yml` extension is allowed), and
|
|
@@ -307,7 +326,7 @@ def wiki_status():
|
|
|
307
326
|
print(r)
|
|
308
327
|
```
|
|
309
328
|
|
|
310
|
-
And the path to virtual environment will be defined in the metadata file:
|
|
329
|
+
And, the path to the virtual environment will be defined in the metadata file:
|
|
311
330
|
|
|
312
331
|
```yaml
|
|
313
332
|
# elapi_plugin_metadata.yml
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "elapi"
|
|
3
|
-
version = "2.
|
|
3
|
+
version = "2.4.0"
|
|
4
4
|
description = "elAPI is a powerful, extensible API client for eLabFTW."
|
|
5
5
|
authors = [{ name = "Alexander Haller, Mahadi Xion", email = "elabftw@uni-heidelberg.de" }]
|
|
6
|
-
requires-python = ">=3.
|
|
6
|
+
requires-python = ">=3.11.0,<4"
|
|
7
7
|
readme = "README.md"
|
|
8
8
|
license = "AGPL-3.0-only"
|
|
9
9
|
maintainers = [{ name = "Mahadi Xion", email = "mahadi.xion@urz.uni-heidelberg.de" }]
|
|
@@ -26,21 +26,30 @@ classifiers = [
|
|
|
26
26
|
]
|
|
27
27
|
dependencies = [
|
|
28
28
|
"dynaconf>=3.2.0,<4",
|
|
29
|
-
"httpx>=0.
|
|
30
|
-
"httpx-auth>=0.
|
|
29
|
+
"httpx[http2]>=0.28.1,<0.29",
|
|
30
|
+
"httpx-auth>=0.23.1,<0.24",
|
|
31
31
|
"rich>=13.8.0,<14",
|
|
32
32
|
"typer[all]>=0.9.0,<0.10",
|
|
33
|
-
"pyyaml
|
|
34
|
-
"mistune
|
|
35
|
-
"
|
|
36
|
-
"
|
|
33
|
+
"pyyaml==6.0.2",
|
|
34
|
+
"mistune==3.1.3",
|
|
35
|
+
"click>=8.1.8,<8.2",
|
|
36
|
+
"httpx-limiter>=0.4.0,<0.5",
|
|
37
|
+
]
|
|
38
|
+
license-files = [
|
|
39
|
+
"LICENSE",
|
|
40
|
+
"src/elapi/_vendor/*/LICENSE"
|
|
37
41
|
]
|
|
38
42
|
|
|
39
43
|
[project.optional-dependencies]
|
|
40
44
|
uhd-urz = [
|
|
41
45
|
"python-dateutil>=2.9.0.post0,<3",
|
|
42
|
-
"tenacity>=9.
|
|
43
|
-
"uvloop>=0.
|
|
46
|
+
"tenacity>=9.1.2,<10",
|
|
47
|
+
"uvloop>=0.21.0,<0.22",
|
|
48
|
+
]
|
|
49
|
+
mail = [
|
|
50
|
+
"jinja2>=3.1.6,<3.2",
|
|
51
|
+
"nameparser>=1.1.3",
|
|
52
|
+
"yagmail>=0.15.293,<0.16",
|
|
44
53
|
]
|
|
45
54
|
|
|
46
55
|
[project.urls]
|
|
@@ -53,8 +62,19 @@ Changelog = "https://github.com/uhd-urz/elAPI/blob/main/CHANGELOG.md"
|
|
|
53
62
|
elapi = "elapi.cli.elapi:app"
|
|
54
63
|
|
|
55
64
|
[build-system]
|
|
56
|
-
requires = ["
|
|
57
|
-
build-backend = "
|
|
65
|
+
requires = ["uv_build>=0.7.19,<0.8.0"]
|
|
66
|
+
build-backend = "uv_build"
|
|
58
67
|
|
|
59
68
|
[dependency-groups]
|
|
60
|
-
dev = [
|
|
69
|
+
dev = [
|
|
70
|
+
"pip>=25.1.1", # vendy requires pip
|
|
71
|
+
"ptpython>=3.0.23,<4",
|
|
72
|
+
"vendy>=0.0.3",
|
|
73
|
+
]
|
|
74
|
+
|
|
75
|
+
[tool.vendy]
|
|
76
|
+
target = 'src/elapi/'
|
|
77
|
+
# vendy will auto-crate src/elapi/_vendor
|
|
78
|
+
packages = [
|
|
79
|
+
"haggis==0.14.1",
|
|
80
|
+
]
|
|
Binary file
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
2.4.0
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
__all__ = [
|
|
2
|
+
"DefaultLogLevels",
|
|
3
|
+
"LogMessageTuple",
|
|
4
|
+
"SimpleLogger",
|
|
5
|
+
"STDERRBaseHandler",
|
|
6
|
+
"Logger",
|
|
7
|
+
"BaseHandler",
|
|
8
|
+
"LoggerUtil",
|
|
9
|
+
"add_logging_level",
|
|
10
|
+
"get_app_version",
|
|
11
|
+
"NoException",
|
|
12
|
+
"GlobalCLIResultCallback",
|
|
13
|
+
"GlobalCLISuperStartupCallback",
|
|
14
|
+
"ResultCallbackHandler",
|
|
15
|
+
"GlobalLogRecordContainer",
|
|
16
|
+
"GlobalCLIGracefulCallback",
|
|
17
|
+
"LogItemList",
|
|
18
|
+
"PatternNotFoundError",
|
|
19
|
+
]
|
|
20
|
+
import logging
|
|
21
|
+
|
|
22
|
+
from .._vendor import haggis
|
|
23
|
+
from .._vendor.haggis.logs import add_logging_level
|
|
24
|
+
from ._loggers import (
|
|
25
|
+
BaseHandler,
|
|
26
|
+
DefaultLogLevels,
|
|
27
|
+
GlobalLogRecordContainer,
|
|
28
|
+
Logger,
|
|
29
|
+
LoggerUtil,
|
|
30
|
+
LogItemList,
|
|
31
|
+
LogMessageTuple,
|
|
32
|
+
ResultCallbackHandler,
|
|
33
|
+
SimpleLogger,
|
|
34
|
+
STDERRBaseHandler,
|
|
35
|
+
)
|
|
36
|
+
from ._utils import (
|
|
37
|
+
GlobalCLIGracefulCallback,
|
|
38
|
+
GlobalCLIResultCallback,
|
|
39
|
+
GlobalCLISuperStartupCallback,
|
|
40
|
+
NoException,
|
|
41
|
+
PatternNotFoundError,
|
|
42
|
+
get_app_version,
|
|
43
|
+
)
|
|
44
|
+
|
|
45
|
+
haggis.logs.logging = logging
|
|
46
|
+
|
|
47
|
+
try:
|
|
48
|
+
# Python 3.13 deprecated _acquireLock, _releaseLock
|
|
49
|
+
# Based on https://github.com/celery/billiard/issues/403, commit 81cc942
|
|
50
|
+
logging._acquireLock, logging._releaseLock = (
|
|
51
|
+
logging._prepareFork,
|
|
52
|
+
logging._afterFork,
|
|
53
|
+
)
|
|
54
|
+
except AttributeError:
|
|
55
|
+
...
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
__all__ = [
|
|
2
|
+
"DefaultLogLevels",
|
|
3
|
+
"LogMessageTuple",
|
|
4
|
+
"SimpleLogger",
|
|
5
|
+
"STDERRBaseHandler",
|
|
6
|
+
"Logger",
|
|
7
|
+
"BaseHandler",
|
|
8
|
+
"LoggerUtil",
|
|
9
|
+
"ResultCallbackHandler",
|
|
10
|
+
"GlobalLogRecordContainer",
|
|
11
|
+
"LogItemList",
|
|
12
|
+
]
|
|
13
|
+
from .base import (
|
|
14
|
+
DefaultLogLevels,
|
|
15
|
+
Logger,
|
|
16
|
+
LoggerUtil,
|
|
17
|
+
LogMessageTuple,
|
|
18
|
+
SimpleLogger,
|
|
19
|
+
)
|
|
20
|
+
from .handlers import (
|
|
21
|
+
BaseHandler,
|
|
22
|
+
LogItemList,
|
|
23
|
+
GlobalLogRecordContainer,
|
|
24
|
+
ResultCallbackHandler,
|
|
25
|
+
STDERRBaseHandler,
|
|
26
|
+
)
|