Skip to main content

A Python package for handling measurement units and conversions

Project description

MeasureKit Logo

MeasureKit

A powerful Python library for physical computing, unit conversions, and symbolic analysis.

PyPI version License: MIT Python 3.8+


🚀 Description

MeasureKit is designed to make working with physical quantities in Python intuitive, robust, and error-free. Whether you are a scientist, engineer, or student, MeasureKit handles the complexity of unit conversions and dimensional analysis so you can focus on the physics.

📦 Installation

Install the package via pip:

pip install measurekit

To use it within a Jupyter Notebook/Lab environment:

pip install ipykernel
python -m ipykernel install --user --name measurekit

🛠 Usage

from measurekit import Q_

# 1. Easy Unit Conversions
# Use the Q_ factory to create quantities
feet = Q_(3.28, 'ft')
meters = feet.to('m')
print(f"3.28 feet = {meters:.4f}")

# 2. Quantity Arithmetic
distance = Q_(5, 'km')
time = Q_(2, 'h')

# Automatic unit handling in calculations
speed = distance / time
print(f"Speed: {speed}")  # Output: 2.5 km/h

# 3. Fluid Conversions
speed_in_mph = speed.to('mph')
print(f"Speed in mph: {speed_in_mph}")

✨ Features

  • Robust Unit System: Support for SI, Imperial, and custom unit definitions.
  • Dimensional Analysis: Prevents invalid operations (e.g., adding length to mass) at runtime.
  • Symbolic Math: Built-in support for symbolic manipulation of physical equations.
  • Extensible: Easily define your own units and constants via configuration files.
  • Developer Friendly: Type hints, clean API, and comprehensive error messages.

⚙️ Configuration

MeasureKit allows you to customize its behavior, define new units, and add constants through a measurekit.conf file.

  1. Create a measurekit.conf file in your project's root directory.
  2. Define your custom settings following the INI format.

Example measurekit.conf:

[Settings]
default_system = SI

[Units]
# Format: name = factor_to_base, dimension, [symbol, alias...]
hand = 0.1016, L, [hand, hands]
bitcoin = 95000.0, $, [BTC, bitcoin]

[Constants]
# Format: name = value unit
my_gravity = 9.81 m/s^2

📋 Requirements

  • Python 3.8 or higher
  • sympy
  • numpy (optional, for advanced features)
  • scipy (optional, for simulations)

📄 License

This project is licensed under the MIT License - see the LICENSE file for details.

✍️ Author

Irvin Torres - irvinrx1996@hotmail.com

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

measurekit-0.0.0.dev0.tar.gz (41.1 kB view details)

Uploaded Source

Built Distribution

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

measurekit-0.0.0.dev0-py3-none-any.whl (47.6 kB view details)

Uploaded Python 3

File details

Details for the file measurekit-0.0.0.dev0.tar.gz.

File metadata

  • Download URL: measurekit-0.0.0.dev0.tar.gz
  • Upload date:
  • Size: 41.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.8

File hashes

Hashes for measurekit-0.0.0.dev0.tar.gz
Algorithm Hash digest
SHA256 bef413d2d69442f9dbe0a77a8e3c1403aa33b204138280aad569d02d35658117
MD5 f20032e80fd68f59f8a4b6be31af0856
BLAKE2b-256 811cd965a17cbb89e0b3a75e8a0611b326a53c6025489b9f11cab3b58fe3f68c

See more details on using hashes here.

File details

Details for the file measurekit-0.0.0.dev0-py3-none-any.whl.

File metadata

File hashes

Hashes for measurekit-0.0.0.dev0-py3-none-any.whl
Algorithm Hash digest
SHA256 ad449f56641fe1fa0c54ec7bbae786c619245df44039824ee7708f6343c26183
MD5 c01ac2052ff4df8740776e9ae6ac1e75
BLAKE2b-256 3e3aae19954107ba2284d3b72ef97e025f8739c18facc7220020f7da9ca2cf95

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