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 recipe 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 round-off 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 the following command in any directory:

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

This program needs an input file (default: ./input.md).

If input.md is not found, a template will be automatically created in the current working directory.

Example input: INPUT_EXAMPLE

Corresponding output: OUTPUT_EXAMPLE

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.9.tar.gz (70.2 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.9-py3-none-any.whl (21.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: reaction_balancer-2.0.9.tar.gz
  • Upload date:
  • Size: 70.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.8.22

File hashes

Hashes for reaction_balancer-2.0.9.tar.gz
Algorithm Hash digest
SHA256 23096273acf8128ff4ef3d2b366bc0055ffc77f2dcc0ccdbb0864f27d0596025
MD5 aca15fd1acb90308b002a50ea90335be
BLAKE2b-256 3c32d587eda7d626cc836d8d5732f9e58f8e896885f3ef849154e571e385ac95

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for reaction_balancer-2.0.9-py3-none-any.whl
Algorithm Hash digest
SHA256 6c45efce2cdeccfeb6c4bea4231a3af9e5abd755636ccc57e4ed08380d68a2cb
MD5 6e39ee09a568de8ea0ddee25af395a4e
BLAKE2b-256 fbf79ea4df474c898b7ad132431c1b912797f9ce135827373194d4f3700f57dc

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