Skip to main content

Pepkio pH Buffer Recipe Calculator

Python client for the Pepkio pH Buffer Recipe Calculator API: weighed buffer recipes with temperature-corrected pH, ionic strength, and stock dilution from scripts or notebooks.

What It Does

Preparing Tris, phosphate, HEPES, and other biological buffers at a target pH requires the correct acid/base ratio, masses for the final volume, and—when prep and use temperatures differ—a realistic estimate of pH at the bench.

Manual Henderson-Hasselbalch calculations and spreadsheets often use pKa at 25 °C only, omit ionic strength, and do not warn when a buffer made at room temperature will read a different pH on ice. Diluting a concentrated stock without re-checking pH is another common source of error.

This package calls the same Pepkio Tools calculation engine as the hosted web application. Use PepkioClient.run() from Python, Jupyter, or automation pipelines to obtain grams of acid and base forms, temperature-corrected pKa, predicted working pH, ionic strength, gravimetric and titration routes, stock dilution volumes, protocol steps, and shareable run links.

Programmatic runs require a network connection and a Pepkio API key. Calculations are not bundled for offline use.

Features

  • Buffer systems: Tris, sodium phosphate, HEPES, and other common laboratory buffers (buffer_id)
  • Modes: calculator (weigh from dry reagents) and stock (dilute concentrated stock)
  • Separate preparation and working temperatures with van't Hoff pKa correction and predicted pH at use temperature
  • Weighed recipes: acid and base masses (g) plus gravimetric and titration preparation routes
  • Ionic strength estimate (mM) with optional target_ionic_strength_mM or added_salt_mM for NaCl adjustment
  • Stock dilution: stock_volume_mL, diluent_volume_mL, and pH re-check guidance
  • Compatibility warnings for common assay conflicts
  • Manifest and named examples: get_manifest, list_examples, get_example_input
  • CLI: pepkio-ph-buffer-recipe-calculator manifest and run
  • Configuration via PEPKIO_API_KEY and PEPKIO_API_BASE_URL

Installation

pip install pepkio-ph-buffer-recipe-calculator

Set an API key with tools:run scope before calling run():

export PEPKIO_API_KEY="your-key"

Create a key in your Pepkio account API keys settings.

Quick Example

from pepkio_ph_buffer_recipe_calculator import PepkioClient

with PepkioClient() as client:
    inp = client.get_example_input("tris_50mM_1L")
    result = client.run(inp)
    inner = result.result["result"]
    print(inner["acid_mass_g"], inner["acid_form_label"])
    print(inner["base_mass_g"], inner["base_form_label"])
    print(result.result["metadata"]["predicted_working_ph"])

CLI:

pepkio-ph-buffer-recipe-calculator run --example tris_50mM_1L

Manifest inspection does not require an API key.

Typical Use Cases

  • 50 mM Tris-HCl pH 7.5 in 1 L with preparation at 25 °C and use at 4 °C
  • 100 mM sodium phosphate pH 7.4 for biochemistry or enzyme assays
  • Diluting 1 M Tris stock to 50 mM working concentration
  • Matching ionic strength across buffers with optional NaCl
  • Gravimetric vs titration buffer preparation planning
  • Copy-ready protocol steps for lab notebooks or Methods sections

Scientific Background

For a weak acid buffer, pH = pKa + log([base]/[acid]). Given a target pH and temperature-corrected pKa, the calculator determines the acid/base ratio and masses for the requested concentration and volume.

Tris and some other buffers have a large pH shift with temperature. A solution adjusted to pH 7.5 at 25 °C can read substantially higher when cooled to 4 °C. Verify pH with a calibrated meter at the temperature of use when precision matters.

Ionic strength affects effective pKa and enzyme behavior. Stock dilution reduces concentration by C_working = C_stock × (V_stock / V_final); pH should be re-measured after dilution rather than assumed unchanged.

Web Application

For researchers who prefer a graphical interface, an interactive pH Buffer Recipe Calculator is available in the browser.

The web interface provides live-updating results, optional ionic strength adjustment, stock dilution mode, compatibility notes, copy-ready protocol text, a Methods-style sentence, and shareable links that restore the same recipe as API permalink values.

Documentation and Resources

Full documentation, examples, and issue tracking: github.com/pepkio/pepkio-ph-buffer-recipe-calculator

Web tool: pepkio.com/tools/ph-buffer-recipe-calculator

About Pepkio

Pepkio develops software tools and provides bioinformatics analysis services for life science research. See https://www.pepkio.com for additional tools and services.

Keywords

pH buffer calculator, buffer recipe calculator, Tris buffer calculator, Tris-HCl preparation, phosphate buffer pH 7.4, HEPES buffer recipe, Henderson-Hasselbalch calculator, buffer pKa temperature correction, ionic strength buffer, NaCl buffer adjustment, gravimetric buffer preparation, buffer titration, stock buffer dilution, dilute Tris stock, Good's buffer, biological buffer preparation, molecular biology buffer, biochemistry buffer, protein buffer pH, enzyme assay buffer, cold room buffer pH, sodium phosphate buffer, buffer protocol generator, pepkio-ph-buffer-recipe-calculator, Python buffer API, shareable buffer recipe, laboratory buffer calculator, Pepkio, how to calculate Tris buffer grams for pH 7.5, prepare 50 mM Tris buffer recipe, phosphate buffer 100 mM pH 7.4 preparation, dilute 1 M Tris to 50 mM volume, Tris pH change with temperature explained, match ionic strength between buffers, gravimetric vs titration buffer prep, re-check pH after diluting buffer stock, Python script buffer recipe API, temperature corrected pKa Tris, weigh Tris hydrochloride and Tris base amounts, buffer recipe for protein purification, HEPES buffer cell culture preparation, stock buffer dilution calculator laboratory

Metadata

Release files for pepkio-ph-buffer-recipe-calculator 0.1.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 pepkio-ph-buffer-recipe-calculator 0.1.0
File Size Uploaded Provenance
pepkio_ph_buffer_recipe_calculator-0.1.0.tar.gz 35.7 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for pepkio-ph-buffer-recipe-calculator 0.1.0
File Interpreter ABI Platform
pepkio_ph_buffer_recipe_calculator-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 45.4 kB

Release files / pepkio_ph_buffer_recipe_calculator-0.1.0.tar.gz

Download URL pepkio_ph_buffer_recipe_calculator-0.1.0.tar.gz
Size 35.7 kB
Tags Source
SHA-256 checksum
How to use checksums
1594c2a4dcecad6e028cf8b793533b27dbf467a6e2225e065139204acc0a4938
BLAKE2b-256 checksum
How to use checksums
b71396ad0a2f717dbd06a9ec37eabd14e02215ccab9e1ee06e500e6d88d097d1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.11.14 {"installer":{"name":"uv","version":"0.11.14","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / pepkio_ph_buffer_recipe_calculator-0.1.0-py3-none-any.whl

Download URL pepkio_ph_buffer_recipe_calculator-0.1.0-py3-none-any.whl
Size 9.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
97de77b34cef9256f753d41bf2154df49a97dc3cbf509de63616e491f698984d
BLAKE2b-256 checksum
How to use checksums
231e35ddf9ad1760c721cbd6085769a22fceb2a8700b0f8b28918b0a8f724b37
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.11.14 {"installer":{"name":"uv","version":"0.11.14","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Security for pepkio-ph-buffer-recipe-calculator 0.1.0

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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

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.1.0 This release

2 release files No 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