Skip to main content

Tests PyPI version

Primaschema

A toolkit for fetching, validating and interrogating tiled amplicon PCR primer scheme definitions. Provides convenient programmatic access to the PHA4GE primer-schemes repository, a community repository of tiled amplicon primer schemes.

Production install (Python 3.12+)

Recommended:

uv tool install primaschema

Alternatives:

pipx install primaschema
# or
python -m pip install primaschema

Quick start

Download a scheme from the default index and validate it:

primaschema get example-scheme/400/v1.0.0 --output ./schemes
primaschema validate ./schemes/example-scheme/400/v1.0.0/info.json

Show CLI help or version:

primaschema --help
primaschema --show-version

Common commands

  • create: Create a new scheme from a primer.bed and reference.fasta.
  • validate: Validate a single scheme or all schemes under a directory.
  • rebuild: Recompute checksums, regenerate scheme README, and optionally reformat primer.bed.
  • index: Build or update an index.json for a local schemes directory.
  • get: Download schemes from an index (default is the PHA4GE primer-schemes index).
  • modify: Update contributors, vendors, status, license, target organisms, and algorithm fields.

Scheme creation

mkdir -p ./schemes && rm -rf ./schemes/example-scheme
primaschema create \
  --name example-scheme \
  --amplicon-size 400 \
  --version v1.0.0 \
  --contributors "name=Alice Smith,email=alice@example.org" \
  --target-organisms "common_name=Example organism,ncbi_tax_id=000001" \
  --status VALIDATED \
  --bed-path ./example-scheme.primer.bed \
  --reference-path ./example-scheme.reference.fasta \
  --primer-schemes-path ./schemes

The scheme is written to ./schemes/example-scheme/400/v1.0.0/.

Environment

Many commands accept --primer-schemes-path. You can also set it once:

export PRIMER_SCHEMES_PATH=./schemes

Development

git clone https://github.com/pha4ge/primaschema.git
cd primaschema
uv sync --all-extras
uv run primaschema --help
uv run pytest
uv run pre-commit install
uv run pre-commit run --all-files

uv sync --all-extras installs optional dependencies, including the dev extra (e.g. pytest, pre-commit, ruff) defined in pyproject.toml.

The Pydantic model (src/primaschema/schema/info.py) is generated from the LinkML schema (src/primaschema/schema/info.yml). After modifying the schema, regenerate with:

uv run gen-pydantic src/primaschema/schema/info.yml --meta None > src/primaschema/schema/info.py

Metadata

Release files for primaschema 0.4.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 primaschema 0.4.0
File Size Uploaded
primaschema-0.4.0.tar.gz 37.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for primaschema 0.4.0
File Interpreter ABI Platform
primaschema-0.4.0-py3-none-any.whl Python 3 none any Details

Total release size: 81.1 kB

Release files / primaschema-0.4.0.tar.gz

Download URL primaschema-0.4.0.tar.gz
Size 37.8 kB
Tags Source
SHA-256 checksum
How to use checksums
e2a3585eef9f2079a48a91164ae03051650c3f821fd085a0d775facc0cfeeec8
BLAKE2b-256 checksum
How to use checksums
fc998a024e8cec3acc8c0336991ab11dade1f34e9c6b5113aa1bf0355b90d323
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Sep 1, 2026.

Transparency log

Release files / primaschema-0.4.0-py3-none-any.whl

Download URL primaschema-0.4.0-py3-none-any.whl
Size 43.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
93fe3d31ce57391080749d45f2d0244b931dcf5637fb2cd9bcc17607fd70bbbb
BLAKE2b-256 checksum
How to use checksums
3b0f83b842f88c9727fcf6856526581cb4bd567a5ddd59ef842e924b9828de4e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Sep 1, 2026.

Transparency log

Release history Release notifications | RSS feed

0.5.0

2 release files

This release

0.4.0 This release

2 release files

0.3.0

2 release files

0.2.0

2 release files

0.1.0

2 release files

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