Skip to main content

ubuntu-bio

PyPI version Python versions License: MIT CI

The official Python client and command-line interface (ubio) for UbuntuBio — the African Bioinformatics Data Hub.

ubuntu-bio enables researchers across the African continent and globally to publish, discover, stream, and version bioinformatics datasets (pathogen genomics, AMR surveillance, agriculture, biodiversity, and metagenomics) with chunk-level deduplication and Git versioning.


Key Features

  • Researcher Identity & Namespaces: Seamless ORCID-authenticated login via browser loopback or RFC 8628 device flow with personal namespace resolution (@username/dataset-name).
  • Genomic Deduplication: Powered by OpenXet Content-Addressed Storage (CAS) using 64 KiB Content-Defined Chunking (CDC) and Blake3 Merkle trees—identical sequence chunks are stored only once.
  • Git Versioning: Every dataset is backed by standard Git commit histories, tags, and branches.
  • Metadata Standards & Data Governance: Built-in MIxS checklist validation and African Union ISO-3166 country code verification. Non-human genomics strictly enforced in v1.
  • Dual Interface: Full-featured command-line interface (ubio or ubuntu-bio) and ergonomic Python SDK (import ubuntu_bio as ub).

Installation

Install using pip:

pip install ubuntu-bio

Or using uv:

uv add ubuntu-bio

CLI Quickstart

The package installs two identical CLI entrypoints: ubio and ubuntu-bio.

1. Authenticate with ORCID

Connect your ORCID iD. Opens an interactive browser authorization or falls back to an RFC 8628 device verification code:

ubio login

Verify your authenticated researcher profile:

ubio whoami
✓ Authenticated with UbuntuBio Hub
  Name:       Dr. Ada Lovelace
  Username:   @ada-lovelace
  ORCID:      0000-0002-1825-0097
  Role:       researcher
  Server:     https://hub.ubuntubio.org

2. Create a Dataset Repository

Create a new dataset repository. If you provide a bare slug, ubio automatically prefixes your verified researcher handle:

# Automatically creates @ada-lovelace/lassa-surveillance-2024
ubio create lassa-surveillance-2024 --domain virus --access public

# Or specify an institutional / organization namespace
ubio create pasteur-dakar/lassa-2024 --domain virus --access public

Supported biological domains: bacteria, virus, parasite, fungus, plant, animal, vector, metagenome, environmental.

3. Upload Datasets

Upload an entire directory of sequences, alignments, and metadata:

ubio upload lassa-surveillance-2024 ./my-data --message "Initial release of Lineage II FASTA assemblies"

4. Search Public Datasets

Search the catalog using full-text search across pathogen titles, descriptions, and AU member states:

# Search for cholera surveillance in Kenya
ubio search "cholera" --country KE

# Search for antimicrobial resistance studies
ubio search "antimicrobial resistance" --domain bacteria

5. Download Datasets & Remote Files

Download a snapshot of a dataset repository:

ubio download lassa-surveillance-2024 --output-dir ./local-data

Download external assets listed in a remote_files.tsv manifest with parallel MD5 verification:

ubio download-remote ./remote_files.tsv --output-dir ./downloads --workers 8

Python SDK Quickstart

Use ubuntu_bio directly in your Python analysis pipelines and Jupyter notebooks:

import ubuntu_bio as ub

# 1. Authenticate (using a Personal Access Token or environment variable)
ub.login(token="ubp_your_personal_access_token")

# 2. Check profile
profile = ub.whoami()
print(f"Logged in as: @{profile.get('username')}")

# 3. Create a repository
repo = ub.create_repo(
    repo_id="lassa-surveillance-2024",
    domain="virus",
    access="public",
    description="Lassa virus genomic surveillance in West Africa",
)

# 4. Upload an entire folder of genomic files
ub.upload_folder(
    repo_id="lassa-surveillance-2024",
    folder_path="./data",
    message="Add consensus FASTA and GFF annotations",
)

# 5. Download a single file or complete snapshot
fasta_path = ub.download_file("pasteur-dakar/cholera-2024", "assemblies/sample_01.fasta")
dataset_dir = ub.snapshot_download("pasteur-dakar/cholera-2024", revision="main")

Contributing

Contributions (feature requests, bugs, etc.) are super welcome 💙💚💛💜🧡❤️

Everyone is welcome to contribute, and we value everybody's contribution. Code is not the only way to help the community. Answering questions, helping others, reaching out and improving the documentations are immensely valuable to the community. We wrote a contribution guide to summarize how to get started to contribute to this repository.


Security & Biological Data Ethics

  • Non-Human Data Only: In compliance with UbuntuBio v1 data governance rules, human genomic data (NCBI Taxon ID 9606) is strictly prohibited.
  • African Union Member States: Metadata validation strictly enforces the 54 AU member state ISO-3166-1 alpha-2 country codes.
  • Token Security: Tokens are stored locally with restrictive file permissions (0600) and validated via short-lived cryptographic tokens against the Hub.

License

Distributed under the MIT License.

Metadata

Release files for ubuntu-bio 1.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ubuntu-bio 1.0.0
File Size Uploaded Provenance Actions
ubuntu_bio-1.0.0.tar.gz 107.7 kB With provenance Details for ubuntu_bio-1.0.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for ubuntu-bio 1.0.0
File Interpreter ABI Platform Actions
ubuntu_bio-1.0.0-py3-none-any.whl Python 3 none any Details for ubuntu_bio-1.0.0-py3-none-any.whl

Total release size: 152.7 kB

Release files / ubuntu_bio-1.0.0.tar.gz

Download URL ubuntu_bio-1.0.0.tar.gz
Size 107.7 kB
Tags Source
SHA-256 checksum
How to use checksums
ff3d797b5d2aa76943aef428d3fa460df819a0b65ca5c6bdaa39dc21b3e4ecbc
BLAKE2b-256 checksum
How to use checksums
d110925be4b608c4964ce7796ea3db3d54d008d8928f4ce227630b48e09249f0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 15, 2026.

Transparency log

Release files / ubuntu_bio-1.0.0-py3-none-any.whl

Download URL ubuntu_bio-1.0.0-py3-none-any.whl
Size 45.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
bd591c1a0765d88ee88a0e8d57fdb1ce0b97039c93a2111c21b8006b4c0c8e50
BLAKE2b-256 checksum
How to use checksums
c5c32d596e5771c666c75b1fd52fb41c892b7e2a98fe374f49e3a91c93cf3d96
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 15, 2026.

Transparency log

Security for ubuntu-bio 1.0.0

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.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for ubuntu_bio-1.0.0.tar.gz

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 Nov 15, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page