Skip to main content

peptide-reconstitution-calc

DOI tests PyPI npm Documentation Software Heritage

Unit-safe arithmetic for reconstituting lyophilized research peptides, in Python and JavaScript, with 312 reference vectors for validating other implementations, a U-100 syringe diagram, a certificate-of-analysis (COA) schema and a CWL workflow.

Maintained by Nexa Peptides. The same arithmetic runs in the live calculator (in Spanish): https://nexa-peptides.com/calculadora/

Documentation: https://peptide-reconstitution-calc.readthedocs.io/

Research use only. This project is laboratory arithmetic: unit conversion and concentration. It does not provide dosing, administration, or clinical guidance.

U-100 syringe diagram: 5 units = 0.05 mL

What it calculates

Given the peptide content of a vial (mg), the volume of diluent added (mL) and a target amount (mg or mcg):

Output Formula
Concentration (mg/mL) vial_mg / diluent_ml
Volume containing the target amount (mL) amount_mg / concentration
U-100 syringe graduations volume_ml × 100
Aliquots of that amount per vial vial_mg / amount_mg

Why "unit-safe"

Most errors in this calculation are unit errors (mcg entered as mg) or binary floating-point drift (0.1 + 0.2 != 0.3). The Python implementation uses decimal.Decimal end to end, validates every input, and rejects a target amount larger than the vial content.

Components

Component Python JavaScript Docs
Reconstitution arithmetic reconstitute() reconstitute() python, javascript
U-100 syringe diagram (SVG, no dependencies) syringe_svg() syringeSvg() syringe
COA JSON Schema and validator validate_coa() schema file coa-schema
Verifier for CSV results python -m peptide_reconstitution_calc.verify reference-vectors
CWL workflow workflows/verify-reference-vectors.cwl workflow

Python

from peptide_reconstitution_calc import reconstitute, syringe_svg

r = reconstitute(vial_mg=10, diluent_ml=2, amount=250, unit="mcg")
r.concentration_mg_per_ml  # Decimal('5')
r.volume_ml                # Decimal('0.05')
r.u100_units               # Decimal('5.00')
r.aliquots_per_vial        # Decimal('4E+1')  -> 40

svg = syringe_svg(r.u100_units)  # SVG string

Command line (JSON output):

python -m peptide_reconstitution_calc 10 2 250 --unit mcg

JavaScript

import { reconstitute, syringeSvg } from "./js/index.mjs";
const r = reconstitute(10, 2, 250, "mcg");
// { concentrationMgPerMl: 5, volumeMl: 0.05, u100Units: 5, aliquotsPerVial: 40 }
const svg = syringeSvg(r.u100Units);

The Python and JavaScript syringe diagrams are byte-identical; the tests compare them.

Reference vectors

data/reference_vectors.csv contains 312 input/output cases (vials from 2 to 60 mg, 0.5 to 3 mL of diluent, target amounts from 100 mcg to 5 mg), generated by data/generate_vectors.py. Use them to check any other calculator, spreadsheet or app against a known-good result:

python -m peptide_reconstitution_calc.verify my_results.csv --output report.json

Column descriptions: data/README.md.

Certificate-of-analysis schema

src/peptide_reconstitution_calc/schemas/coa.schema.json (JSON Schema 2020-12) describes a machine-readable summary of a third-party COA for a research peptide lot: product, lot, laboratory, report dates, purity, identity method. Example: examples/coa-example.json.

python -m peptide_reconstitution_calc.coa examples/coa-example.json

CWL workflow

cwltool workflows/verify-reference-vectors.cwl workflows/test-params.json

Recomputes the reference vectors in a python:3.12-slim container and writes report.json.

Tests

pip install pytest jsonschema && python -m pytest -q
npm test

Español

Aritmética de reconstitución de péptidos liofilizados para investigación: conversión de unidades, concentración, volumen para una cantidad objetivo y graduaciones de jeringa U-100, con 312 casos de referencia para validar otras calculadoras, un diagrama de jeringa en SVG, un esquema JSON para certificados de análisis y un flujo de trabajo CWL. Solo para uso en investigación; no ofrece indicaciones de dosis ni de administración. Calculadora en línea: https://nexa-peptides.com/calculadora/

License

MIT. See LICENSE. To cite, see CITATION.cff.

Metadata

Release files for peptide-reconstitution-calc 0.2.1

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

Source distribution (sdist)

Source distribution for peptide-reconstitution-calc 0.2.1
File Size Uploaded Provenance Actions
peptide_reconstitution_calc-0.2.1.tar.gz 14.9 kB With provenance Details for peptide_reconstitution_calc-0.2.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for peptide-reconstitution-calc 0.2.1
File Interpreter ABI Platform Actions
peptide_reconstitution_calc-0.2.1-py3-none-any.whl Python 3 none any Details for peptide_reconstitution_calc-0.2.1-py3-none-any.whl

Total release size: 28.5 kB

Release files / peptide_reconstitution_calc-0.2.1.tar.gz

Download URL peptide_reconstitution_calc-0.2.1.tar.gz
Size 14.9 kB
Tags Source
SHA-256 checksum
How to use checksums
8dd93d38d9b9c5bb65187803df68e65fa01ea8fe83449d85637357376febb5fb
BLAKE2b-256 checksum
How to use checksums
48dda0308e0b1e85e2394b425706730019bb17b08118dffee5257b8c76914b22
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 29, 2026.

Transparency log

Release files / peptide_reconstitution_calc-0.2.1-py3-none-any.whl

Download URL peptide_reconstitution_calc-0.2.1-py3-none-any.whl
Size 13.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
4e66f40d961893d3f016f6b680910df333ab9651b0b37d40c4153d55d222fcb6
BLAKE2b-256 checksum
How to use checksums
2e25c40bc8812b5789da1e18bde26cc47342c6f318307ed193311e3df2d6eaef
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 29, 2026.

Transparency log

Security for peptide-reconstitution-calc 0.2.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

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

Select from 2 files

Attestation for peptide_reconstitution_calc-0.2.1.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 29, 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.2.1 This release

2 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