Python wrapper for PINTS (Pipelines for Non-Target Screening). This package provides Python APIs and a command-line interface (CLI) to manage and query PINTS databases based on the pints-core-sql schema.
- Initialize and seed a DuckDB with the PINTS Core schema
- Add samples, runs, and features programmatically
- Export tables to CSV for downstream analysis
- Query using either the Python API or the CLI (pints ...)
- Reuses the universal SQL definitions from pints-core-sql
Clone and install in editable mode:
git clone https://github.com/odea-project/pints-py.git
cd pints-py
python -m venv .venv # For virtual environment
.venv/Scripts/Activate.ps1 # For virtual environment on Windows PowerShell
pip install -e .This will also fetch the pints-core-sql submodule.
To update the pints-core-sql submodule to the latest commit on its main branch:
cd extern/pints-plugins
git fetch origin
git checkout main # oder dein Branchname
git pull origin main
cd ../..Then commit the updated submodule reference in the main repo.
Initialize a new PINTS feature list:
pints init --db myFeatures.duckdbSeed the feature list with the core schema:
pints seed --db myFeatures.duckdbAdd a sample:
pints add-sample --db myFeatures.duckdb --id S001 --type Sample --desc "River water"Add a run linked to the sample:
pints add-run --db myFeatures.duckdb --id R001 --sample S001 --time "2025-09-12 09:00:00" --instrument QTOF-XYZ --method POS_5min --batch B01Add a feature linked to the run:
pints add-feature --db myFeatures.duckdb --id R001_F0001 --run R001 --sample S001 --mz 301.123456 --rt 312.4 --area 154321.2Export the features table to CSV:
pints export features --db myFeatures.duckdb --out features.csvCheck schema and vocabulary versions:
pints show-version --db myFeatures.duckdbList all tables in the database:
pints list-tables --db myFeatures.duckdbThe CLI supports plugins for extended functionality from pints-plugins (e.g., intra_run_components). To use plugins, install them in the same environment:
pints plugin install --db myFeatures.duckdb --name intra_run_componentsAdd data using plugin commands:
pints plugin insert --db myFeatures.duckdb --name intra_run_components --rows "R001,R001_F0001,C001" "R001,R001_F0002,C001" --materializeExport plugin tables:
pints plugin export --db my.duckdb --name intra_run_components --out intra.csvThis repo depends on pints-core-sql as a Git submodule. After cloning, make sure to initialize submodules:
git submodule update --init --recursiveThe SQL files from pints-core-sql/sql are synced into pints/sql before packaging.
This project is licensed under the MIT License. See the LICENSE file for details.