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 --checks core

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, dates and the generator.

Scheme creation

mkdir -p ./schemes && rm -rf ./schemes/example-scheme
primaschema create \
  --name example-scheme \
  --amplicon-size 400 \
  --version v1.0.0 \
  --contributor "name=Alice Smith,email=alice@example.org" \
  --target-organism "name=Example organism,ncbi_taxon_id=000001" \
  --development-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 --all-groups
uv run primaschema --help
uv run pytest
uv run pre-commit install
uv run pre-commit run --all-files

uv sync --all-extras --all-groups installs optional dependencies, including the dev group (e.g. pytest, pre-commit, ruff) and the docs group (mkdocs and its plugins) defined in pyproject.toml. --all-extras alone does not install dependency groups, so omitting --all-groups leaves the docs unbuildable.

Documentation

Documentation is built with MkDocs:

uv run mkdocs serve   # live preview on http://127.0.0.1:8000
uv run mkdocs build   # render to ./site

The CLI and schema pages are generated from the code, so they track the model automatically.

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.5.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.5.0
File Size Uploaded
primaschema-0.5.0.tar.gz 39.6 kB Details

Built distribution (wheel)

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

Total release size: 84.6 kB

Release files / primaschema-0.5.0.tar.gz

Download URL primaschema-0.5.0.tar.gz
Size 39.6 kB
Tags Source
SHA-256 checksum
How to use checksums
a7c274b27cb07eccb0c6285acd23099223ecbbb62af5a4e8b183339e6ab0c682
BLAKE2b-256 checksum
How to use checksums
5e9c16366e36d65f3202e4b80b068a9e0f757472982877f92ee80a45b72d985a
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 2, 2026.

Transparency log

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

Download URL primaschema-0.5.0-py3-none-any.whl
Size 45.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e005206ed3aaf13ad30b5a55c62a403f82727cd8419955824ca0d55565502f60
BLAKE2b-256 checksum
How to use checksums
159d8b92f4e475cf0e0926ffc9b303aa50484b694712de88c08d33eedc3cd550
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 2, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.5.0 This release

2 release files

0.4.0

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