A library for interacting with the Datamint API, designed for efficient data management, processing and Deep Learning workflows.
Project description
Datamint Python API
A comprehensive Python SDK for interacting with the Datamint platform, providing seamless integration for medical imaging workflows, dataset management, and machine learning experiments.
📋 Table of Contents
🚀 Features
- Dataset Management: Download, upload, and manage medical imaging datasets
- Annotation Tools: Create, upload, and manage annotations (segmentations, labels, measurements)
- Experiment Tracking: Integrated MLflow support for experiment management
- PyTorch Lightning Integration: Streamlined ML workflows with Lightning DataModules and callbacks
- DICOM Support: Native handling of DICOM files with anonymization capabilities
- Multi-format Support: PNG, JPEG, NIfTI, and other medical imaging formats
See the full documentation at https://sonanceai.github.io/datamint-python-api/
📦 Installation
[!NOTE] We recommend using a virtual environment to avoid package conflicts.
From PyPI
pip install -U datamint
Virtual Environment Setup
Click to expand virtual environment setup instructions
We recommend that you install Datamint in a dedicated virtual environment, to avoid conflicting with your system packages.
For instance, create the enviroment once with python3 -m venv datamint-env and then activate it whenever you need it with:
-
Create the environment (one-time setup):
python3 -m venv datamint-env
-
Activate the environment (run whenever you need it):
Platform Command Linux/macOS source datamint-env/bin/activateWindows CMD datamint-env\Scripts\activate.batWindows PowerShell datamint-env\Scripts\Activate.ps1 -
Install the package:
pip install datamint
⚙ Setup API key
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:
Method 1: Command-line tool (recommended)
Run datamint-config in the terminal and follow the instructions. See command_line_tools for more details.
Method 2: Environment variable
Specify the API key as an environment variable.
Bash:
export DATAMINT_API_KEY="my_api_key"
# run your commands (e.g., `datamint-upload`, `python script.py`)
Python:
import os
os.environ["DATAMINT_API_KEY"] = "my_api_key"
📚 Documentation
| Resource | Description |
|---|---|
| 🚀 Getting Started | Step-by-step setup and basic usage |
| 📖 API Reference | Complete API documentation |
| 🔥 PyTorch Integration | ML workflow integration |
| 💡 Examples | Practical usage examples |
🛠️ Command Line Tools
Full documentation at command_line_tools.
Upload Resources
Upload DICOM files with anonymization:
datamint-upload /path/to/dicoms --recursive --channel "training-data" --publish --tag "my_data_tag"
It anonymizes by default.
Configuration Management
# Interactive setup
datamint-config
# Set API key
datamint-config --api-key "your-key"
🔒 SSL Certificate Troubleshooting
If you encounter SSL certificate verification errors like:
SSLCertVerificationError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate
Quick Fix
1. Upgrade certifi:
pip install --upgrade certifi
2. Set environment variables:
export SSL_CERT_FILE=$(python -m certifi)
export REQUESTS_CA_BUNDLE=$(python -m certifi)
3. Run your script:
python your_script.py
Alternative Solutions
Option 1: Use Custom CA Bundle
from datamint import Api
api = Api(verify_ssl="/path/to/your/ca-bundle.crt")
Option 2: Disable SSL Verification (Development Only)
from datamint import Api
# ⚠️ WARNING: Only use in development with self-signed certificates
api = Api(verify_ssl=False)
🆘 Support
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file datamint-2.9.1.tar.gz.
File metadata
- Download URL: datamint-2.9.1.tar.gz
- Upload date:
- Size: 140.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
75a39774aa18e62e44607681aeaeea5343a28a9e650fc4f7bdc88d01c2e1ad05
|
|
| MD5 |
691674b992df8783480178a3e3e3f15b
|
|
| BLAKE2b-256 |
c0fd877ad6d9fe03af5e8b77fa818dfc55c9c1de3ccba002223f808c9bda4cc8
|
Provenance
The following attestation bundles were made for datamint-2.9.1.tar.gz:
Publisher:
release_pypi.yaml on SonanceAI/datamint-python-api
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
datamint-2.9.1.tar.gz -
Subject digest:
75a39774aa18e62e44607681aeaeea5343a28a9e650fc4f7bdc88d01c2e1ad05 - Sigstore transparency entry: 844816886
- Sigstore integration time:
-
Permalink:
SonanceAI/datamint-python-api@8b00bf7f8b9155df433eb818bafcbcb360930910 -
Branch / Tag:
refs/tags/v2.9.1 - Owner: https://github.com/SonanceAI
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release_pypi.yaml@8b00bf7f8b9155df433eb818bafcbcb360930910 -
Trigger Event:
push
-
Statement type:
File details
Details for the file datamint-2.9.1-py3-none-any.whl.
File metadata
- Download URL: datamint-2.9.1-py3-none-any.whl
- Upload date:
- Size: 169.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9f4ee69fed9d28216f79e7906e05df3b33df1d4d92f29737a884f34b4ff17e3f
|
|
| MD5 |
f98c1aa6fa9fcdcc504b4fed2fd1a0e0
|
|
| BLAKE2b-256 |
6c54198d52d2bdbbe2f1f0af99caab5b192509a4027eaf4e886499f597ec5b31
|
Provenance
The following attestation bundles were made for datamint-2.9.1-py3-none-any.whl:
Publisher:
release_pypi.yaml on SonanceAI/datamint-python-api
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
datamint-2.9.1-py3-none-any.whl -
Subject digest:
9f4ee69fed9d28216f79e7906e05df3b33df1d4d92f29737a884f34b4ff17e3f - Sigstore transparency entry: 844816889
- Sigstore integration time:
-
Permalink:
SonanceAI/datamint-python-api@8b00bf7f8b9155df433eb818bafcbcb360930910 -
Branch / Tag:
refs/tags/v2.9.1 - Owner: https://github.com/SonanceAI
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release_pypi.yaml@8b00bf7f8b9155df433eb818bafcbcb360930910 -
Trigger Event:
push
-
Statement type: