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.2.dev0.tar.gz (43.4 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.2.dev0-py3-none-any.whl (50.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: measurekit-0.0.2.dev0.tar.gz
  • Upload date:
  • Size: 43.4 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.2.dev0.tar.gz
Algorithm Hash digest
SHA256 609df257c459da999d0af86c256fb43deeff92ae3f53573389f6d40cf64b7228
MD5 8bca37e092b549b24a1ebe1740daa0a6
BLAKE2b-256 e1841f3cb95ba24ffc1b726395b4e2d7deba3cb30a589fc4eb1aed80dbff4b6a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for measurekit-0.0.2.dev0-py3-none-any.whl
Algorithm Hash digest
SHA256 275b7b35b3d6020e4705f205c83474175c8c2ceaa533ee5345a597ba494b015e
MD5 708ed48747af3abfd7c70b3dd561c550
BLAKE2b-256 c3ff68297bf01e1a0152bb60b444d504ee1556e47478122870505bda34b66060

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