Registry / ai-ml / primer3-py

primer3-py

JSON →
library2.3.0pypypi✓ verified 87d ago

Python bindings for the Primer3 primer design and analysis library. Current version 2.3.0 supports Python 3.8–3.14. Actively maintained, with occasional releases.

pip install primer3-py
INSTALL
IMPORT
SIG · PRIMER3-PY
P
primer3-py
ai-mlpythonv2.3.0
Install
1.7s avg
Import
40ms
Disk
28MB
Pass rate
5/ 10
Env Coverage5 / 10
glibc
3.9–3.13
musl
3.9–3.13
Install & Compatibility
Where this runs
tested against v2.3.0 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.10–3.95 runs
build_error
glibc
py 3.10–3.95 runs
installs and imports cleanly · install 1.7s · import 0.040s · 30MB
28MB installed
● package 28MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

bindings
✓ import primer3
✗ from primer3 import *
Wildcard imports discouraged; use explicit import.

Calculate Tm of a DNA sequence.

import primer3 seq = 'AGCAGCGCGTATACGCGTATATACGCGATATCGCGTAGCT' result = primer3.calc_tm(seq) print(result)
Debug
Known issues
breakingIn v2.0.0, the output dictionary keys changed: list versions of PRIMER_PAIR, PRIMER_LEFT, PRIMER_RIGHT, PRIMER_INTERNAL were added. Code relying on old key shapes may break if not adapted.
fix
Use both old and new keys or update code to use list versions.
affects: >=2.0.0
breakingIn v1.0.0, setGlobals was removed; use primer3.set_global_flags or direct parameter passing instead.
fix
Replace primer3.setGlobals(...) with primer3.set_global_flags(...) or pass parameters as dict.
affects: >=1.0.0
gotchacalc_tm accepts sequences with ambiguous bases (e.g., 'N') but may raise exceptions for invalid characters. Ensure input is valid DNA.
fix
Validate or sanitize sequences before passing to calc_tm.
affects: all
Errors
Common errors & fixes
AttributeError: module 'primer3' has no attribute 'setGlobals'
setGlobals was removed in v1.0.0.
fix
Use primer3.set_global_flags(parameters) instead.
TypeError: calc_tm() got an unexpected keyword argument 'mv_conc'
calc_tm uses keyword arguments for salt and divalent concentrations; incorrect param name.
fix
Use valid keyword arguments: mv_conc, dv_conc, dntp_conc, dna_conc.
ValueError: Sequence 'XYZ' contains invalid characters
Sequence contains non-DNA letters or whitespace.
fix
Clean sequence with primer3.clean_sequence(seq) or validate manually.
Upgrade
Version history
2.3.0latest on PyPI · released Jan 6, 2026
Audit
Dependencies

No dependency data recorded yet.

Agent activity
2 hits · last 30 days
node
2
Resources
primer3-py — pip install primer3-py · libregistry