Skip to main content

A modern Python package for quantity calculations

Project description

PyQuantity

CI Python 3.10 Python 3.11 Python 3.12 Python 3.13 Python 3.14 License Code style: black

A Python package for quantity calculations with unit support and dimensional analysis.

Test Coverage: 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:

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


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)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pyquantity-0.1.15-py3-none-any.whl (22.6 kB view details)

Uploaded Python 3

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

Hashes for pyquantity-0.1.15.tar.gz
Algorithm Hash digest
SHA256 9a660b4b4db91a41fa58f0467a021951f46c7b219c02194e1b6f833d77900977
MD5 76d794bcdead9f27125d2699d19142dc
BLAKE2b-256 609a8db92a69a685d396dd60fd78a0b137612a9242ed93f7b8a326b1d8a97459

See more details on using hashes here.

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

Hashes for pyquantity-0.1.15-py3-none-any.whl
Algorithm Hash digest
SHA256 bc833628ecff90e3914f15090a1a2af81412c52a2a7db82a125c43cc9d1c3f43
MD5 c5a745545395cb1a5d4dab2256a1de6a
BLAKE2b-256 56fdab868ef9030b6b055b6f03f54947dd08cbd60a1d1d30798546be27a8a0f7

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page