A library for interacting with the Datamint API, designed for efficient data management, processing and Deep Learning workflows.
Project description
Datamint Python API
Datamint turns medical imaging ML work. Dataset management, annotation, training, and deployment into a few lines of Python, with built-in support for DICOM/NIfTI/PNG, PyTorch Lightning trainers, and MLflow tracking.
Common use cases: 🩻 Segmentation · 🏷️ Classification · 📦 Detection
Datamint handles the full journey from raw files to a deployed model:
flowchart LR
Files(["📁 Your Files"])
subgraph s1 [1 · Ingest]
Resource(["📦 Resource"])
end
subgraph s2 [2 · Organize & Annotate]
direction TB
Project(["🗂️ Project"])
Annotations(["🏷️ Annotations"])
Project -.->|annotate| Annotations
end
subgraph s3 [3 · Train]
direction LR
Dataset(["🧮 Dataset"])
Trainer(["🧠 Trainer"])
Model(["📈 Model"])
Dataset -->|train| Trainer -->|register| Model
end
subgraph s4 [4 · Deploy & Predict]
direction LR
DeployJob(["🚀 Deploy Job"])
Inference(["🔮 Inference"])
DeployJob -->|predict| Inference
end
Files -->|upload| Resource
Resource -->|organize| Project
Project -->|load| Dataset
Model -->|deploy| DeployJob
classDef ingestNode fill:#ffffff,stroke:#1f6feb,stroke-width:2px,color:#0b2b4c
classDef organizeNode fill:#ffffff,stroke:#1a7f37,stroke-width:2px,color:#0b3a1c
classDef mlNode fill:#ffffff,stroke:#8250df,stroke-width:2px,color:#2c1a4d
classDef deployNode fill:#ffffff,stroke:#d1720f,stroke-width:2px,color:#4d2b00
classDef fileNode fill:#f6f8fa,stroke:#57606a,stroke-width:2px,color:#24292f
class Files fileNode
class Resource ingestNode
class Project,Annotations organizeNode
class Dataset,Trainer,Model mlNode
class DeployJob,Inference deployNode
style s1 fill:#dceeff,stroke:#1f6feb,stroke-width:2px,color:#0b2b4c
style s2 fill:#dbf5df,stroke:#1a7f37,stroke-width:2px,color:#0b3a1c
style s3 fill:#ecdcff,stroke:#8250df,stroke-width:2px,color:#2c1a4d
style s4 fill:#ffe8c7,stroke:#d1720f,stroke-width:2px,color:#4d2b00
📋 Table of Contents
🎬 See it in action
Create a project, split the data, train, and deploy, all through the API:
🚀 Features
- Dataset Management: Download, upload, and manage medical imaging datasets using intuitive object-based APIs or CLI tools
- Annotation Tools: Create, upload, and manage annotations (segmentations, labels, measurements) with ease
- Experiment Tracking: Seamless support for experiment management via MLflow integration
- One-line Trainers: Train segmentation, classification, and detection models with built-in PyTorch Lightning trainers, skipping the dataset class, training loop, and logging setup
- DICOM Support: Native handling of DICOM files, including powerful anonymization capabilities during upload to protect patient privacy
- Multi-format Support: Robust support for a wide range of medical imaging formats: PNG, JPEG, NIfTI (NIfTI/NRRD), DICOMs and more
⚡ Quick Start
1. Install
pip install -U datamint
Using a virtual environment (recommended)
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
2. Configure your API key
datamint config
Follow the prompts (ask your administrator if you don't have a key yet). Environment variable and programmatic options are in the Setup API Key guide.
3. Scaffold a project — the fastest way to start
datamint init
This is the recommended on-ramp: it asks for a project name and task type (segmentation, classification, or detection), then generates a ready-to-run, numbered set of scripts (01_upload_data.py → 06_deploy.py) — upload data, train, and deploy by running them in order.
4. ...or write it yourself
from datamint import Api
from datamint.lightning import UNetPPTrainer
api = Api()
api.projects.create(name="my-project", exists_ok=True)
trainer = UNetPPTrainer(project="my-project")
results = trainer.fit()
📚 Documentation
Difficulty levels:
no ML knowledge needed
assumes SDK familiarity, introduces ML/dataset concepts
full training pipelines, custom models, 3D data, multi-step workflows.
| Resource | Level | Description |
|---|---|---|
| 🚀 Getting Started | Step-by-step setup and basic usage | |
| 📖 API Reference | Complete API documentation | |
| 🔥 PyTorch Integration | ML workflow integration | |
| 🧠 Trainer Guide | Built-in trainers, trainer lifecycle, and custom model integration | |
| 🛠️ Command Line Tools | Full reference for datamint upload, datamint init, and datamint config |
|
| 🔒 SSL Troubleshooting | — | Fixing SSLCertVerificationError |
| 📓 Notebooks | Numbered, runnable tutorials. Start at 01_getting_started and work through annotations, datasets, experiment tracking, deployment, and a full end-to-end example |
🆘 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.20.0.tar.gz.
File metadata
- Download URL: datamint-2.20.0.tar.gz
- Upload date:
- Size: 300.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d4bb092ceb5520fd5bd17ead39d26e570b27768a91d9717e2998286642fa7179
|
|
| MD5 |
0ecf66ceaa5639c06d3d565dddb794b6
|
|
| BLAKE2b-256 |
a73f219f8b232efb051a519a18487f456eb1a3e8ff7086bc2d85bc3bf9885b86
|
Provenance
The following attestation bundles were made for datamint-2.20.0.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.20.0.tar.gz -
Subject digest:
d4bb092ceb5520fd5bd17ead39d26e570b27768a91d9717e2998286642fa7179 - Sigstore transparency entry: 2218848199
- Sigstore integration time:
-
Permalink:
SonanceAI/datamint-python-api@3285b6a90c8b4282356385a4f494cc7795baa861 -
Branch / Tag:
refs/tags/v2.20.0 - Owner: https://github.com/SonanceAI
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release_pypi.yaml@3285b6a90c8b4282356385a4f494cc7795baa861 -
Trigger Event:
push
-
Statement type:
File details
Details for the file datamint-2.20.0-py3-none-any.whl.
File metadata
- Download URL: datamint-2.20.0-py3-none-any.whl
- Upload date:
- Size: 390.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
448fe70e51af846858cba0e8f62409c92596bd932dc6063784f2bdd39f22bdce
|
|
| MD5 |
31966055b291e31eed5cf3dad2228d33
|
|
| BLAKE2b-256 |
0a1388ca905b4112064c471ce74b4959589f50db1f1d9948362fd6eb1b2c46ca
|
Provenance
The following attestation bundles were made for datamint-2.20.0-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.20.0-py3-none-any.whl -
Subject digest:
448fe70e51af846858cba0e8f62409c92596bd932dc6063784f2bdd39f22bdce - Sigstore transparency entry: 2218848220
- Sigstore integration time:
-
Permalink:
SonanceAI/datamint-python-api@3285b6a90c8b4282356385a4f494cc7795baa861 -
Branch / Tag:
refs/tags/v2.20.0 - Owner: https://github.com/SonanceAI
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release_pypi.yaml@3285b6a90c8b4282356385a4f494cc7795baa861 -
Trigger Event:
push
-
Statement type: