Metadata-Version: 2.4
Name: chemformulapy
Version: 1.0.0
Summary: A Python package for parsing and working with chemical formulas
License-Expression: MIT
License-File: LICENSE
Keywords: chemistry,chemical-formula,molar-mass,parser
Author: Evgenii Nekhoroshev
Author-email: evgnekhoroshev@gmail.com
Requires-Python: >=3.9,<3.12
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Science/Research
Classifier: Intended Audience :: Education
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Topic :: Scientific/Engineering :: Chemistry
Requires-Dist: numpy (>=1.23,<3)
Requires-Dist: pyparsing (>=3.1,<4)
Project-URL: Homepage, https://github.com/YOUR_USERNAME/chemformulapy
Project-URL: Issues, https://github.com/YOUR_USERNAME/chemformulapy/issues
Project-URL: Repository, https://github.com/YOUR_USERNAME/chemformulapy
Description-Content-Type: text/markdown

# chemformulapy

A lightweight Python package for **parsing, analyzing, and working with chemical formulas**.

`chemformulapy` provides tools to:
- Parse chemical formulas into structured representations
- Compute molar masses
- Work with chemical elements and their properties
- Generate chemically intuitive formula orderings

---

## 🚀 Features

- 🧪 Parse formulas like `H2O`, `C6H12O6`, `KNO3`, `H2SO4`
- ⚖️ Calculate molar masses using built-in element data
- 🔬 Access element properties (atomic number, molar mass, electronegativity)
- 📐 Chemically intuitive ordering of elements
- 🧩 Extensible design using enums and descriptors

---

## 📦 Installation

```bash
pip install chemformulapy
```

---

## ⚡ Quick Start

```python
from chemformulapy import Element

oxygen = Element.O
print(oxygen.name)
print(oxygen.mass())
```

---

## 🧠 Use Cases

### Molar Mass Calculation

```python
from chemformulapy import parse_formula

formula = "H2O"
mass = parse_formula(formula).mass()
print(mass)
```

---

### Chemical Formula Parsing

```python
compound = parse_formula("C6H12O6")
print(compound.elements)
```

---

### Element Property Analysis

```python
from chemformulapy import Element

carbon = Element.C
print(carbon.value)
```

---

## 📥 Example Scripts

### molar_mass_calculator.py

```python
from chemformulapy import parse_formula

formula = input("Enter chemical formula: ")
compound = parse_formula(formula)

print(f"Molar mass of {formula}: {compound.mass()} g/mol")
```

---

### element_lookup.py

```python
from chemformulapy import Element

symbol = input("Enter element symbol: ")
element = Element[symbol]

print(f"Atomic number: {element.number}")
print(f"Molar mass: {element.mass}")
print(f"Electronegativity: {element.eneg}")
```

---

### formula_parser_demo.py

```python
from chemformulapy import parse_formula

formula = "H2SO4"
compound = parse_formula(formula)

print("Parsed formula:", compound.elements)
```

---

## 🧩 API Overview

### Element Enum

Represents chemical elements with:
- Atomic number
- Molar mass
- Electronegativity

---

## 🛠️ Dependencies

- numpy
- pyparsing

---

## 🤝 Contributing

Contributions are welcome!

---

## 📄 License

MIT License

---

## 👤 Author

Evgenii Nekhoroshev, contact at evgnekhoroshev@gmail.com

