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
- Model Benchmarking: Compare several trainers against the same dataset and split, and get a ranked leaderboard of their performance
- 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 | |
| 🔍 Bringing an External Model into Datamint | Integrate, log, and deploy a model trained outside Datamint for inference through the UI | |
| 🛠️ 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
Release files for datamint 2.39.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| datamint-2.39.0.tar.gz | 342.1 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| datamint-2.39.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 792.8 kB
Release files / datamint-2.39.0.tar.gz
| Download URL | datamint-2.39.0.tar.gz |
|---|---|
| Size | 342.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
63e6f9bf14ac101aa6289a2871fbaaa2f53f9ea9de207ec8d90f2e6f30aab00e
|
|
BLAKE2b-256 checksum How to use checksums |
9c721f1c4be4cd255d05a4a16479c84522754e2b83bf0142b9c33b005350c9c0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 25, 2026.
Transparency logRelease files / datamint-2.39.0-py3-none-any.whl
| Download URL | datamint-2.39.0-py3-none-any.whl |
|---|---|
| Size | 450.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
343d0bd792e22c8fef44ae0f1f626fbd3cb47c9184f48345a7bdd2bef49e3209
|
|
BLAKE2b-256 checksum How to use checksums |
53fe76655b414211c4417e4c1340cec885dd7bec3b1805f8ac48363454246668
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 25, 2026.
Transparency log