PyQuantity
A Python package for quantity calculations with unit support and dimensional analysis.
Test Coverage:
Features
- 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
Installation
pip install pyquantity
Requirements:
- Python 3.10 or higher (following Python's version support policy, mostly)
For Developers:
pip install -e ".[dev]"
python test_with_coverage.py
Quick Start
from 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)
Documentation
License
MIT License - See LICENSE for details.
Contributing
Contributions are welcome!
Metadata
Release files for pyquantity 0.1.15
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| pyquantity-0.1.15.tar.gz | 38.8 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| pyquantity-0.1.15-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 61.4 kB
Release files / pyquantity-0.1.15.tar.gz
| Download URL | pyquantity-0.1.15.tar.gz |
|---|---|
| Size | 38.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
9a660b4b4db91a41fa58f0467a021951f46c7b219c02194e1b6f833d77900977
|
|
BLAKE2b-256 checksum How to use checksums |
609a8db92a69a685d396dd60fd78a0b137612a9242ed93f7b8a326b1d8a97459
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Release files / pyquantity-0.1.15-py3-none-any.whl
| Download URL | pyquantity-0.1.15-py3-none-any.whl |
|---|---|
| Size | 22.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
bc833628ecff90e3914f15090a1a2af81412c52a2a7db82a125c43cc9d1c3f43
|
|
BLAKE2b-256 checksum How to use checksums |
56fdab868ef9030b6b055b6f03f54947dd08cbd60a1d1d30798546be27a8a0f7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|