Skip to main content

A library for interacting with the Datamint API, designed for efficient data management, processing and Deep Learning workflows.

Project description

Datamint logo

Datamint Python API

Build Status Python 3.10+

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

📋 Table of Contents

🎬 See it in action

From a project name to a deployed, validated model, patient-wise splitting, training, and deployment included:

Datamint pipeline demo

🚀 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:

  1. Create the environment (one-time setup):

    python3 -m venv datamint-env
    
  2. Activate the environment (run whenever you need it):

    Platform Command
    Linux/macOS source datamint-env/bin/activate
    Windows CMD datamint-env\Scripts\activate.bat
    Windows PowerShell datamint-env\Scripts\Activate.ps1
  3. 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.py06_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

Resource 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

Full Documentation
GitHub Issues

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

datamint-2.18.0.tar.gz (272.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

datamint-2.18.0-py3-none-any.whl (355.2 kB view details)

Uploaded Python 3

File details

Details for the file datamint-2.18.0.tar.gz.

File metadata

  • Download URL: datamint-2.18.0.tar.gz
  • Upload date:
  • Size: 272.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for datamint-2.18.0.tar.gz
Algorithm Hash digest
SHA256 aa1b398bd03c7a4e2ce02c5c0b25508366ff503db339062a6a731bf3ab330c3d
MD5 14ae221431dd4989c84d6256d7e1b795
BLAKE2b-256 e9f2059f3ea6bf7bd2e972e91ac566387bfd75b005c54d79f595e691ee3a8f17

See more details on using hashes here.

Provenance

The following attestation bundles were made for datamint-2.18.0.tar.gz:

Publisher: release_pypi.yaml on SonanceAI/datamint-python-api

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file datamint-2.18.0-py3-none-any.whl.

File metadata

  • Download URL: datamint-2.18.0-py3-none-any.whl
  • Upload date:
  • Size: 355.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for datamint-2.18.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e3c30590a5531e4d9b0cf1e88aad60a6414e1205dfc2fa4c0909897863857ec0
MD5 13ea54ebf3637687d3dfc62648ea99cb
BLAKE2b-256 9b69bdc995427490fecb90c0fc5885e555ad34d7ecf055d53ab3b38e3e30a8fa

See more details on using hashes here.

Provenance

The following attestation bundles were made for datamint-2.18.0-py3-none-any.whl:

Publisher: release_pypi.yaml on SonanceAI/datamint-python-api

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page