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)6Fe7/8SeLa1.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:
Corresponding output:
You may also specify an explicit filepath:
balancer <filepath>
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file reaction_balancer-2.0.10.tar.gz.
File metadata
- Download URL: reaction_balancer-2.0.10.tar.gz
- Upload date:
- Size: 70.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.8.22
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
262ef5abc307f82594b6a1537af3f3d45b8355318dd02a28e66065956f0a5eaf
|
|
| MD5 |
8e1938ff616b2291cc1797035926d2f9
|
|
| BLAKE2b-256 |
f168a1507d444afb7546d58dcc00e785f42357ef92f89867ec053e5287ba0378
|
File details
Details for the file reaction_balancer-2.0.10-py3-none-any.whl.
File metadata
- Download URL: reaction_balancer-2.0.10-py3-none-any.whl
- Upload date:
- Size: 21.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.8.22
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1cf13a9e98077aa6d11419e974f95f88461b953b55d9cd7ed7aaf8d94a33269a
|
|
| MD5 |
152055bf6cd1c58ac80d9da0e075f548
|
|
| BLAKE2b-256 |
4ec483601571b7668ba712c3d1f24dc113f655fb4ef1d4bbf99254eff092e80f
|