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.10+


🚀 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.3.dev0.tar.gz (146.3 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.3.dev0-py3-none-any.whl (97.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: measurekit-0.0.3.dev0.tar.gz
  • Upload date:
  • Size: 146.3 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.3.dev0.tar.gz
Algorithm Hash digest
SHA256 c04cd7d85c4d62d02f60eda0a1113e01a3ce8a92147676150cd0a7df7dc89d35
MD5 401c23373d116a22df5e98471ad1d0f5
BLAKE2b-256 6e2ead5daa5756883393515a52feae4909216e79605bb5586fd440bef1cebdf3

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for measurekit-0.0.3.dev0-py3-none-any.whl
Algorithm Hash digest
SHA256 88d47958bb30d3d8ecf4b0f7a023a57e637c8289e994ff059e1673f75fbfa651
MD5 b78362b4381f73a36fbf85ce89dcbf32
BLAKE2b-256 11bd2e625b55b77ad9e63e6631565b0539a5c0bc1cfb2f42e2d5ffcf11e48961

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