Observed since 20 Oct, 17:35 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
Lightweight Python SDK for ABRomics API
A lightweight Python SDK for interacting with the ABRomics API, including resumable file uploads via TUS protocol.
pip install abromics-library
To use the upload / TUS-based file transfer features (CLI complete-upload-workflow and Python upload helpers), you will need tuspy and you can install it via:
pip install "abromics-library[upload]"
or by installing tuspy directly:
pip install tuspy>=0.2.4
To upgrade an existing installation to the latest released version on PyPI:
pip install --upgrade abromics-library
Or, explicitly using Python:
python -m pip install --upgrade abromics-library
You can check your currently installed version with:
python -m pip show abromics-library
git clone https://gitlab.com/ifb-elixirfr/abromics/abromics-library.git
cd abromics-library
pip install -e .
complete_workflow_upload scopecomplete_workflow_uploadabk_)export ABROMICS_API_KEY="abk_your_api_key_here"
export ABROMICS_BASE_URL="http://localhost:8000" # Your ABRomics backend URL
The ABRomics CLI provides essential commands for managing projects and uploading data:
| Command | Description |
|---|---|
project create | Create a new project |
check-data | List strain/sample combinations for a strain in a project (table: metadata & assembly status) |
complete-upload-workflow | Complete workflow: TSV processing + file uploads |
# Create a new FASTQ project
abromics --api-key "abk_your_api_key_here" --base-url "https://analysis.abromics.fr" project create \
--name "My FASTQ Project" \
--template 1 \
--description "Optional project description"
# Create a new FASTA project
abromics --api-key "abk_your_api_key_here" --base-url "https://analysis.abromics.fr" project create \
--name "My FASTA Project" \
--template 2 \
--description "Optional project description"
Parameters:
--name - Project name (required)--template - Template ID (required): 1 for FASTQ, 2 for FASTA--description - Project description (optional)Check whether metadata (sample record) or assembly (FASTA file) exists for a strain in a project. Prints a table of all strain/sample combinations matching the given strain name; the same strain name can appear with different sample names (Sample Name).
abromics --api-key "abk_your_api_key_here" --base-url "https://analysis.abromics.fr" \
check-data --strain-name "ST-FA-1128" --project-id 133
Example output when matches exist:
Strain ID Sample name Metadata Assembly
---------- ------------ --------- --------
ST-FA-1128 SRR1501128 present present
ST-FA-1128 SRR1501129 present absent
If no sample matches the strain name in the project, the command prints absent.
Parameters:
--strain-name - Strain name (Strain Name / Strain ID) to look up; can match multiple samples in the project (required)--project-id - Project ID to scope the check (required)# One command does everything: validates TSV, creates samples, uploads files
abromics complete-upload-workflow \
--metadata-tsv "/path/to/samples_fastq_projects.tsv" \
--data-dir "/path/to/sequence/files"
You can optionally export a machine-readable summary of sample creation and file uploads:
# JSON summary to stdout
abromics complete-upload-workflow \
--metadata-tsv "/path/to/samples_fastq_projects.tsv" \
--data-dir "/path/to/sequence/files" \
--summary-format json \
--summary-output -
# TSV summary to a file
abromics complete-upload-workflow \
--metadata-tsv "/path/to/samples_fastq_projects.tsv" \
--data-dir "/path/to/sequence/files" \
--summary-format tsv \
--summary-output "workflow_summary.tsv"
Options:
--summary-format: table (default, human-readable), json, or tsv.--summary-output: path to write the summary file. If omitted it defaults to -, meaning the summary is printed to the terminal (standard output) where you launched the command.What this command does:
from abromics import AbromicsClient
# Initialize client
client = AbromicsClient(
api_key="abk_your_api_key_here",
base_url="http://localhost:8000"
)
# Step 1: Create project (template 1 for FASTQ, 2 for FASTA)
project = client.projects.create(
name="My FASTQ Project",
template=1,
description="Project for FASTQ sequencing data"
)
# Step 2: Complete workflow (auto-detects file types)
result = client.batch.process_tsv_and_upload(
project_id=project.id,
tsv_file="samples_metadata.tsv",
files_directory="/path/to/sequence/files"
)
if result['success']:
print("✅ Workflow completed successfully!")
# Individual operations
sample = client.samples.create(
project_id=project.id,
metadata={
"Sample Name": "SAMPLE_001",
"Strain Name": "ST-001",
"Host species": "Homo sapiens",
"Microorganism scientific name": "Escherichia coli",
"Country": "France"
}
)
# File upload with progress tracking
def progress_callback(message, current, total):
print(f"{message}: {current}/{total}")
uploader = client.upload.create_uploader()
result = uploader.upload_file(
file_path="/path/to/sequence.fastq.gz",
metadata={
"sample_id": str(sample.id),
"file_type": "FASTQ_GZ",
"type": "PAIRED_FORWARD"
},
progress_callback=progress_callback
)
The TSV file should contain sample metadata with these columns:
Sample Name * - Unique sample identifier (column Sample ID * is also accepted)Strain Name * - Unique strain identifier (column Strain ID * is also accepted)Host species * - Host species nameMicroorganism scientific name * - Scientific name of microorganismCountry * - Country where sample was collectedSample type * - Type of sampleSample source * - Source of the sampleInstrument model * - Sequencing instrument modelCollected date * - Date when sample was collectedProject Name * - Name of the projectR1 fastq filename * + R2 fastq filename * - For FASTQ filesFasta filename * - For FASTA filesRegion - Region where sample was collectedPlace - Specific place where sample was collectedTravel countries - Countries visited before collectionAccession number - Public database accession numberSample comment - Additional comments about the sampleSample Name * Strain Name * R1 fastq filename * R2 fastq filename * Host species * Microorganism scientific name * Country * Project Name *
SAMPLE_001 ST-001 sample_R1.fastq.gz sample_R2.fastq.gz Homo sapiens Escherichia coli France My Project
If you are already using the ABRomics web interface and its TSV template, you can reuse the same TSV for the library and CLI.
The only additional column you need to add for the Python/CLI workflow is:
Project Name * – the project name as it exists in ABRomics (must match the name of the project you create or select.# Create a FASTQ project first
abromics --api-key "abk_your_api_key_here" --base-url "https://analysis.abromics.fr" project create \
--name "My FASTQ Project" \
--template 1 \
--description "Project for FASTQ sequencing data"
# Or create a FASTA project
abromics --api-key "abk_your_api_key_here" --base-url "https://analysis.abromics.fr" project create \
--name "My FASTA Project" \
--template 2 \
--description "Project for FASTA assembly data"
# Complete workflow (TSV + file uploads)
abromics complete-upload-workflow \
--metadata-tsv "examples/samples_fastq_projects.tsv" \
--data-dir "examples/sequence_files/"
# Run the example script
python examples/python_library_example.py
export ABROMICS_API_KEY="abk_your_api_key_here" # Required
export ABROMICS_BASE_URL="http://localhost:8000" # Optional
--api-key, --base-url)ABROMICS_API_KEY, ABROMICS_BASE_URL)client = AbromicsClient(api_key, base_url, timeout)
# Create FASTQ project
project = client.projects.create(
name="My FASTQ Project",
template=1, # Template 1 for FASTQ, 2 for FASTA
description="Optional description"
)
# Create FASTA project
project = client.projects.create(
name="My FASTA Project",
template=2, # Template 1 for FASTQ, 2 for FASTA
description="Optional description"
)
# List projects
projects = client.projects.list()
# Get project
project = client.projects.get(project_id)
# Create sample
sample = client.samples.create(project_id, metadata)
# List samples
samples = client.samples.list(project_id=1)
# Get sample
sample = client.samples.get(sample_id)
# Complete workflow
result = client.batch.process_tsv_and_upload(
project_id, tsv_file, files_directory
)
complete_workflow_upload scope# Install in development mode
pip install -e .
# Run tests
pytest
# Run CLI
python -m abromics.cli --help
For instructions on how to publish a new version to PyPI, see HowToPublish.md.
MIT License
Download counts and popularity will appear here as the collector receives them.
| Version | Published | Direct dependencies | Open version |
|---|---|---|---|
| 1.1.4 | 30 Apr 2026 | 11 |
This describes our collected data; it is not a security assessment.
Shared repository data · GitLab
| Contributor | Contributions |
|---|---|
| BobLamarley | 756 |
| Nemoxy | 693 |
| Amanda Dieuaide | 389 |
| fmareuil | 69 |
| Julie Lao | 68 |
| Phloemus | 16 |
| Amanda D. | 6 |
| root | 2 |
| Bérénice Batut | 1 |
Default-branch author identities; GitLab commit counts exclude merge commits.
Public sponsor counts have not been collected. These signals belong to the repository owner.
gitlab · 3 observations shown. Missing days are unknown.
| Date / source period | Value | Observed at |
|---|---|---|
| 2026-10-22 | 9 | 2026-10-22T19:07:36.3645186Z |
| 2026-10-21 | 9 | 2026-10-21T18:06:45.2867103Z |
| 2026-10-20 | 9 | 2026-10-20T18:06:13.5791589Z |
Observed since 20 Oct, 17:35 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
package:5a59fa14944847af1b14d830cd4610ee50ff8af5d3e4b918ba4fbbd73301e972