Skip to main content

gmg: Python bindings (#37)

pip install guess-my-genome      # the module you import is `gmg`

Wheels are published for Linux (x86_64, aarch64) and macOS on Apple Silicon (Python >= 3.9). Other platforms: build from the repository with maturin (see below) or use a release binary. (pip install gmg is a different, unrelated project.)

The same Rust code as gmg run and the web app, for notebooks and scripts.

import gmg
ix = gmg.Index("bfd-reps-2026.10.5-s20000.gmgi")     # any index from the releases
rec = ix.classify("genome.fa.gz")                     # a dict: the record `gmg run` writes to results.jsonl
rec["status"], rec["best_rank"]                       # ok | low_confidence | no_match | error
rec["guess"]["calls"]["genus"]["taxon"]               # per-rank calls, ANI, top hits, QC flags in rec["qc"]

records = [ix.classify(p) for p in paths]             # failures are records (status "error"), not exceptions
open("results.tsv", "w").write(gmg.results_tsv_text(records))      # identical to the CLI's results.tsv

h = ix.sketch(open("x.fa", "rb").read())              # sorted unique hashes at the index's k / scaled
ix.guess_hashes(h)                                    # the JSON of `gmg guess`, as a dict
ix.use_thresholds("novel")                            # known (default) | permissive | novel

Index.classify(path, kind="auto", min_abund=0, max_records=0, top=5, id=None) reads plain or gzipped FASTA/FASTQ; classify_bytes(data, name=...) takes sequence text in memory. Not in the bindings: sample sheets, read pairing and --exclude-* (use the CLI for those).

Build and test

pip install maturin pytest
cd crates/gmg-py && maturin develop          # or: maturin build --release (an abi3 wheel for Python >= 3.9)
GMG_BIN=../../target/debug/gmg pytest tests  # the tests build a small index with the gmg binary and compare with `gmg run`

The crate is outside the main Cargo workspace (like fuzz/), so cargo test at the root does not need Python; .github/workflows/python.yml builds and tests it.

Metadata

Release files for guess-my-genome 0.3.1

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

Built distributions (wheels)

Table of built distributions (wheels) for guess-my-genome 0.3.1
File Interpreter ABI Platform Actions
guess_my_genome-0.3.1-cp39-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl CPython 3.9 abi3 Linux glibc 2.17+ x86-64 Details for guess_my_genome-0.3.1-cp39-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
guess_my_genome-0.3.1-cp39-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl CPython 3.9 abi3 Linux glibc 2.17+ ARM64 Details for guess_my_genome-0.3.1-cp39-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl
guess_my_genome-0.3.1-cp39-abi3-macosx_11_0_arm64.whl CPython 3.9 abi3 macOS 11.0+ ARM64 Details for guess_my_genome-0.3.1-cp39-abi3-macosx_11_0_arm64.whl

Total release size: 1.5 MB

Release files / guess_my_genome-0.3.1-cp39-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl

Download URL guess_my_genome-0.3.1-cp39-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Size 536.1 kB
Tags CPython 3.9 Linux glibc 2.17+ x86-64 abi3
SHA-256 checksum
How to use checksums
03104930f2371bbdeaaf886020ee990a3dac92f4faa1aff64ba9cabb2af68f97
BLAKE2b-256 checksum
How to use checksums
968bc21152a58f8240ff58c0d5dfb39689a1af62a47453fc73610e6fed63f095
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 3, 2026.

Transparency log

Release files / guess_my_genome-0.3.1-cp39-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl

Download URL guess_my_genome-0.3.1-cp39-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl
Size 516.0 kB
Tags CPython 3.9 Linux glibc 2.17+ ARM64 abi3
SHA-256 checksum
How to use checksums
ea804a4a03735d1823f1a06bddc019a9aa1b44e67638b018e9ef41ae7ac69ea5
BLAKE2b-256 checksum
How to use checksums
b64249c596fc54da5762d6cbec345cb56f4282ded495d3ce02926e3269ee3730
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 3, 2026.

Transparency log

Release files / guess_my_genome-0.3.1-cp39-abi3-macosx_11_0_arm64.whl

Download URL guess_my_genome-0.3.1-cp39-abi3-macosx_11_0_arm64.whl
Size 472.9 kB
Tags CPython 3.9 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
877ca51ad393e232f323a25fd4d918e97ff425e3692ecba7dbef5141adcc3c9d
BLAKE2b-256 checksum
How to use checksums
33d1dec8925aafc7a9d38446dd86e2cb685805810b1fda082346b6639fab419b
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 3, 2026.

Transparency log

Security for guess-my-genome 0.3.1

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

All 3 files in this release have been uploaded with provenance metadata.

Select from 3 files

Attestation for guess_my_genome-0.3.1-cp39-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl

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 3, 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.

Release history Release notifications | RSS feed

This release

0.3.1 This release

3 release files Full provenance

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