A Python package for quantity calculations with unit support and dimensional analysis.
- Comprehensive unit systems with 60+ base dimensions
- 1000+ derived units including mechanical, electrical, and thermal units
- Full SI prefix support from yocto to yotta
- Contextual measurements with built-in database
- Natural language parsing for quantity extraction
- Advanced physics calculations
- Type hints and comprehensive documentation
pip install pyquantityRequirements:
- Python 3.10 or higher (following Python's version support policy, mostly)
For Developers:
pip install -e ".[dev]"
python test_with_coverage.pyfrom pyquantity import Quantity, get_measurement, parse_quantity
# Basic quantity operations
length = Quantity(5.0, "meter")
width = Quantity(3.0, "meter")
area = length * width
# Unit conversion
distance = Quantity(1.5, "kilometer")
distance_m = distance.convert("meter")
# Contextual measurements
bath = get_measurement("normal bath")
cup = get_measurement("cup")
cups_in_bath = bath / cup
# Natural language parsing
text = "A car traveling at 120 km/h for 2.5 hours"
quantities = parse_quantity(text)MIT License - See LICENSE for details.
Contributions are welcome!