A modern Python package for quantity calculations
Project description
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!
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
pyquantity-0.1.15.tar.gz
(38.8 kB
view details)
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 pyquantity-0.1.15.tar.gz.
File metadata
- Download URL: pyquantity-0.1.15.tar.gz
- Upload date:
- Size: 38.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9a660b4b4db91a41fa58f0467a021951f46c7b219c02194e1b6f833d77900977
|
|
| MD5 |
76d794bcdead9f27125d2699d19142dc
|
|
| BLAKE2b-256 |
609a8db92a69a685d396dd60fd78a0b137612a9242ed93f7b8a326b1d8a97459
|
File details
Details for the file pyquantity-0.1.15-py3-none-any.whl.
File metadata
- Download URL: pyquantity-0.1.15-py3-none-any.whl
- Upload date:
- Size: 22.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bc833628ecff90e3914f15090a1a2af81412c52a2a7db82a125c43cc9d1c3f43
|
|
| MD5 |
c5a745545395cb1a5d4dab2256a1de6a
|
|
| BLAKE2b-256 |
56fdab868ef9030b6b055b6f03f54947dd08cbd60a1d1d30798546be27a8a0f7
|