Skip to main content

Balance chemical equations and generate printable forms

Project description

English | 中文文档

reaction-balancer

A precise chemical-equation balancer that uses exact rational arithmetic and CIAAW atomic weights to generate printable reaction preparation sheets (Excel format) from Markdown input.

Features

1. Exact scientific computation

  • Uses CIAAW (2024) standard atomic weights.
  • All internal math uses sympy.Rational (exact fractions), eliminating floating-point errors.
  • Linear algebra–based solver ensures correct balancing or gives an informative error if impossible.

2. Flexible input syntax

  • Supports parentheses and fractional subscripts:
    • Ni(NO3)2(H2O)6
    • Fe7/8Se
    • La1.8Sr0.2CuO4.12
  • Optional basis specification (e.g., ) allows partial balancing, which is useful for sol–gel and oxide-precursor routes.

3. Automatic Excel output

  • Produces a ready-to-print xlsx recipe sheet with formatted layout.
  • Column widths, styles, and alignment handled automatically—no manual editing required.

4. Reproducible and traceable

  • Input is a Markdown document, allowing you to record:
    • sample IDs
    • furnace schedule
    • experimental notes
  • Perfect for lab notebooks and long-term traceability.

5. Designed for materials synthesis

Suitable for:

  • solid-state reactions
  • flux growth
  • hydrothermal / sol-gel precursor balancing
  • cuprates, pnictides, nickelates, chalcogenides, and general inorganic synthesis

Installation

pip install balancer

or if using uv:

uv tool install balancer

Usage

Run this command in a directory:

python -m balancer
# or use uv:
# uv run balancer

If input.md is missing, the program automatically creates a template in your working directory.

You may also specify an explicit filepath:

balancer <filepath>

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

reaction_balancer-2.0.3.tar.gz (20.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

reaction_balancer-2.0.3-py3-none-any.whl (20.6 kB view details)

Uploaded Python 3

File details

Details for the file reaction_balancer-2.0.3.tar.gz.

File metadata

  • Download URL: reaction_balancer-2.0.3.tar.gz
  • Upload date:
  • Size: 20.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.7

File hashes

Hashes for reaction_balancer-2.0.3.tar.gz
Algorithm Hash digest
SHA256 4f692d0c532ad66327857ee187539b4d87edb67e2fded40d44a5d6f08ef14e2b
MD5 70fd1500b16fb819bab7651fd9609a57
BLAKE2b-256 447275cd5c80d5743dc453979763c16e19e0c74758eb2f76ff2f30cdc178206e

See more details on using hashes here.

File details

Details for the file reaction_balancer-2.0.3-py3-none-any.whl.

File metadata

File hashes

Hashes for reaction_balancer-2.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 d301de376ead354ee0e612a7734de33997a9f1b1ab1ba408b6be82d17dbb914d
MD5 ef7421b3d7d608f59852184fe90568b4
BLAKE2b-256 0ae8bfeeeade05ac4184397b6e6de0d99e5b09fb66799bcb231506b85c3d788e

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page