datamint 1.2.4__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.

Potentially problematic release.


This version of datamint might be problematic. Click here for more details.

Files changed (29) hide show
  1. datamint-1.2.4/PKG-INFO +118 -0
  2. datamint-1.2.4/README.md +73 -0
  3. datamint-1.2.4/datamint/__init__.py +11 -0
  4. datamint-1.2.4/datamintapi/__init__.py +25 -0
  5. datamint-1.2.4/datamintapi/apihandler/annotation_api_handler.py +748 -0
  6. datamint-1.2.4/datamintapi/apihandler/api_handler.py +15 -0
  7. datamint-1.2.4/datamintapi/apihandler/base_api_handler.py +300 -0
  8. datamint-1.2.4/datamintapi/apihandler/dto/annotation_dto.py +149 -0
  9. datamint-1.2.4/datamintapi/apihandler/exp_api_handler.py +204 -0
  10. datamint-1.2.4/datamintapi/apihandler/root_api_handler.py +1013 -0
  11. datamint-1.2.4/datamintapi/client_cmd_tools/__init__.py +0 -0
  12. datamint-1.2.4/datamintapi/client_cmd_tools/datamint_config.py +168 -0
  13. datamint-1.2.4/datamintapi/client_cmd_tools/datamint_upload.py +483 -0
  14. datamint-1.2.4/datamintapi/configs.py +58 -0
  15. datamint-1.2.4/datamintapi/dataset/__init__.py +1 -0
  16. datamint-1.2.4/datamintapi/dataset/base_dataset.py +881 -0
  17. datamint-1.2.4/datamintapi/dataset/dataset.py +492 -0
  18. datamint-1.2.4/datamintapi/examples/__init__.py +1 -0
  19. datamint-1.2.4/datamintapi/examples/example_projects.py +75 -0
  20. datamint-1.2.4/datamintapi/experiment/__init__.py +1 -0
  21. datamint-1.2.4/datamintapi/experiment/_patcher.py +570 -0
  22. datamint-1.2.4/datamintapi/experiment/experiment.py +1049 -0
  23. datamint-1.2.4/datamintapi/logging.yaml +27 -0
  24. datamint-1.2.4/datamintapi/utils/dicom_utils.py +640 -0
  25. datamint-1.2.4/datamintapi/utils/io_utils.py +149 -0
  26. datamint-1.2.4/datamintapi/utils/logging_utils.py +55 -0
  27. datamint-1.2.4/datamintapi/utils/torchmetrics.py +70 -0
  28. datamint-1.2.4/datamintapi/utils/visualization.py +129 -0
  29. datamint-1.2.4/pyproject.toml +69 -0
@@ -0,0 +1,118 @@
1
+ Metadata-Version: 2.3
2
+ Name: datamint
3
+ Version: 1.2.4
4
+ Summary: A library for interacting with the Datamint API, designed for efficient data management, processing and Deep Learning workflows.
5
+ Requires-Python: >=3.10
6
+ Classifier: Programming Language :: Python :: 3
7
+ Classifier: Programming Language :: Python :: 3.10
8
+ Classifier: Programming Language :: Python :: 3.11
9
+ Classifier: Programming Language :: Python :: 3.12
10
+ Classifier: Programming Language :: Python :: 3.13
11
+ Provides-Extra: dev
12
+ Provides-Extra: docs
13
+ Requires-Dist: Deprecated (>=1.2.0)
14
+ Requires-Dist: aiohttp (>=3.0.0,<4.0.0)
15
+ Requires-Dist: aioresponses (>=0.7.8,<0.8.0) ; extra == "dev"
16
+ Requires-Dist: albumentations (>=2.0.0)
17
+ Requires-Dist: humanize (>=4.0.0,<5.0.0)
18
+ Requires-Dist: lazy-loader (>=0.3.0)
19
+ Requires-Dist: lightning
20
+ Requires-Dist: matplotlib
21
+ Requires-Dist: nest-asyncio (>=1.0.0,<2.0.0)
22
+ Requires-Dist: nibabel (>=4.0.0)
23
+ Requires-Dist: numpy
24
+ Requires-Dist: opencv-python (>=4.0.0)
25
+ Requires-Dist: pandas (>=2.0.0)
26
+ Requires-Dist: platformdirs (>=4.0.0,<5.0.0)
27
+ Requires-Dist: pydicom (>=3.0.0,<4.0.0)
28
+ Requires-Dist: pylibjpeg (>=2.0.0,<3.0.0)
29
+ Requires-Dist: pylibjpeg-libjpeg (>=2.0.0,<3.0.0)
30
+ Requires-Dist: pytest (>=7.0.0,<8.0.0) ; extra == "dev"
31
+ Requires-Dist: pytest-cov (>=4.0.0,<5.0.0) ; extra == "dev"
32
+ Requires-Dist: pyyaml (>=5.0.0)
33
+ Requires-Dist: requests (>=2.0.0,<3.0.0)
34
+ Requires-Dist: responses (>=0.20.0,<0.21.0) ; extra == "dev"
35
+ Requires-Dist: rich (>=10.0.0)
36
+ Requires-Dist: setuptools (>=57.0) ; extra == "docs"
37
+ Requires-Dist: sphinx (>=5.0) ; extra == "docs"
38
+ Requires-Dist: sphinx-tabs (>=3.0.0) ; extra == "docs"
39
+ Requires-Dist: sphinx_rtd_theme (>=2.0.0) ; extra == "docs"
40
+ Requires-Dist: torch (>=1.2.0,!=2.3.0)
41
+ Requires-Dist: torchvision (>=0.18.0)
42
+ Requires-Dist: tqdm (>=4.0.0,<5.0.0)
43
+ Description-Content-Type: text/markdown
44
+
45
+
46
+ # Datamint python API
47
+
48
+ ![Build Status](https://github.com/SonanceAI/datamint-python-api/actions/workflows/run_test.yaml/badge.svg)
49
+
50
+ See the full documentation at https://sonanceai.github.io/datamint-python-api/
51
+
52
+ ## Installation
53
+
54
+ Datamint requires Python 3.10+.
55
+ You can install Datamint and its dependencies using pip
56
+
57
+ ```bash
58
+ pip install git+https://github.com/SonanceAI/datamint-python-api
59
+ ```
60
+
61
+ Soon we will be releasing the package on PyPi.
62
+ We recommend that you install Datamint in a dedicated virtual environment, to avoid conflicting with your system packages.
63
+ Create the enviroment once with `python3 -m venv datamint-env` and then activate it whenever you need it with:
64
+ - `source datamint-env/bin/activate` (Linux/MAC)
65
+ - `datamint-env\Scripts\activate.bat` (Windows CMD)
66
+ - `datamint-env\Scripts\Activate.ps1` (Windows PowerShell)
67
+
68
+
69
+ ## Setup API key
70
+
71
+ To use the Datamint API, you need to setup your API key (ask your administrator if you don't have one). Use one of the following methods to setup your API key:
72
+
73
+ ### Method 1: Command-line tool (recommended)
74
+
75
+ Run ``datamint-config`` in the terminal and follow the instructions. See [command_line_tools](https://sonanceai.github.io/datamint-python-api/command_line_tools.html) for more details.
76
+
77
+ ### Method 2: Environment variable
78
+
79
+ Specify the API key as an environment variable.
80
+
81
+ **Bash:**
82
+ ```bash
83
+ export DATAMINT_API_KEY="my_api_key"
84
+ # run your commands (e.g., `datamint-upload`, `python script.py`)
85
+ ```
86
+
87
+ **Python:**
88
+ ```python
89
+ import os
90
+ os.environ["DATAMINT_API_KEY"] = "my_api_key"
91
+ ```
92
+
93
+ ### Method 3: APIHandler constructor
94
+
95
+ Specify API key in the |APIHandlerClass| constructor:
96
+
97
+ ```python
98
+ from datamintapi import APIHandler
99
+ api = APIHandler(api_key='my_api_key')
100
+ ```
101
+
102
+ ## Tutorials
103
+
104
+
105
+ You can find example notebooks in the `notebooks` folder:
106
+
107
+ - [Uploading your resources](notebooks/upload_data.ipynb)
108
+ - [Uploading model segmentations](notebooks/upload_model_segmentations.ipynb)
109
+
110
+ and example scripts in [examples](examples) folder:
111
+
112
+ - [Running an experiment for classification](examples/experiment_traintest_classifier.py)
113
+ - [Running an experiment for segmentation](examples/experiment_traintest_segmentation.py)
114
+
115
+ ## Full documentation
116
+
117
+ See all functionalities in the full documentation at https://sonanceai.github.io/datamint-python-api/
118
+
@@ -0,0 +1,73 @@
1
+
2
+ # Datamint python API
3
+
4
+ ![Build Status](https://github.com/SonanceAI/datamint-python-api/actions/workflows/run_test.yaml/badge.svg)
5
+
6
+ See the full documentation at https://sonanceai.github.io/datamint-python-api/
7
+
8
+ ## Installation
9
+
10
+ Datamint requires Python 3.10+.
11
+ You can install Datamint and its dependencies using pip
12
+
13
+ ```bash
14
+ pip install git+https://github.com/SonanceAI/datamint-python-api
15
+ ```
16
+
17
+ Soon we will be releasing the package on PyPi.
18
+ We recommend that you install Datamint in a dedicated virtual environment, to avoid conflicting with your system packages.
19
+ Create the enviroment once with `python3 -m venv datamint-env` and then activate it whenever you need it with:
20
+ - `source datamint-env/bin/activate` (Linux/MAC)
21
+ - `datamint-env\Scripts\activate.bat` (Windows CMD)
22
+ - `datamint-env\Scripts\Activate.ps1` (Windows PowerShell)
23
+
24
+
25
+ ## Setup API key
26
+
27
+ To use the Datamint API, you need to setup your API key (ask your administrator if you don't have one). Use one of the following methods to setup your API key:
28
+
29
+ ### Method 1: Command-line tool (recommended)
30
+
31
+ Run ``datamint-config`` in the terminal and follow the instructions. See [command_line_tools](https://sonanceai.github.io/datamint-python-api/command_line_tools.html) for more details.
32
+
33
+ ### Method 2: Environment variable
34
+
35
+ Specify the API key as an environment variable.
36
+
37
+ **Bash:**
38
+ ```bash
39
+ export DATAMINT_API_KEY="my_api_key"
40
+ # run your commands (e.g., `datamint-upload`, `python script.py`)
41
+ ```
42
+
43
+ **Python:**
44
+ ```python
45
+ import os
46
+ os.environ["DATAMINT_API_KEY"] = "my_api_key"
47
+ ```
48
+
49
+ ### Method 3: APIHandler constructor
50
+
51
+ Specify API key in the |APIHandlerClass| constructor:
52
+
53
+ ```python
54
+ from datamintapi import APIHandler
55
+ api = APIHandler(api_key='my_api_key')
56
+ ```
57
+
58
+ ## Tutorials
59
+
60
+
61
+ You can find example notebooks in the `notebooks` folder:
62
+
63
+ - [Uploading your resources](notebooks/upload_data.ipynb)
64
+ - [Uploading model segmentations](notebooks/upload_model_segmentations.ipynb)
65
+
66
+ and example scripts in [examples](examples) folder:
67
+
68
+ - [Running an experiment for classification](examples/experiment_traintest_classifier.py)
69
+ - [Running an experiment for segmentation](examples/experiment_traintest_segmentation.py)
70
+
71
+ ## Full documentation
72
+
73
+ See all functionalities in the full documentation at https://sonanceai.github.io/datamint-python-api/
@@ -0,0 +1,11 @@
1
+ """
2
+ Datamint API package alias.
3
+
4
+ This module serves as an alias for the datamintapi package.
5
+ """
6
+
7
+ from datamintapi import *
8
+ import importlib.metadata
9
+
10
+ __name__ = "datamint"
11
+ __version__ = importlib.metadata.version(__name__)
@@ -0,0 +1,25 @@
1
+ """
2
+ Datamint API is a Python package that provides a simple interface to the Datamint API.
3
+ """
4
+ import importlib.metadata
5
+ from typing import TYPE_CHECKING
6
+ if TYPE_CHECKING:
7
+ from .dataset.dataset import DatamintDataset as Dataset
8
+ from .apihandler.api_handler import APIHandler
9
+ from .experiment import Experiment
10
+ else:
11
+ import lazy_loader as lazy
12
+
13
+ __getattr__, __dir__, __all__ = lazy.attach(
14
+ __name__,
15
+ submodules=['dataset', "dataset.dataset", "apihandler.api_handler", "experiment"],
16
+ submod_attrs={
17
+ "dataset.dataset": ["DatamintDataset"],
18
+ "dataset": ['Dataset'],
19
+ "apihandler.api_handler": ["APIHandler"],
20
+ "experiment": ["Experiment"],
21
+ },
22
+ )
23
+
24
+ __name__ = "datamintapi"
25
+ __version__ = importlib.metadata.version('datamint')