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.1.dev0.tar.gz (43.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.1.dev0-py3-none-any.whl (50.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: measurekit-0.0.1.dev0.tar.gz
  • Upload date:
  • Size: 43.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.1.dev0.tar.gz
Algorithm Hash digest
SHA256 521674493bdbd036e4ca562a72cd65bea1a21073b1df2f4de038d289758cb95f
MD5 42f26f6ec2e68b4b1dd719544d245c8a
BLAKE2b-256 2371708b04f21786caa156a554b2256a1e1dd5b08e15666bf12704fe307d6829

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for measurekit-0.0.1.dev0-py3-none-any.whl
Algorithm Hash digest
SHA256 f9e5ce8521b99a5ec612fecc1eac4c25f81f4d03a748074b15abfe1315a13c5a
MD5 c4a4c0dbcc998264ca647df6893117d7
BLAKE2b-256 3f212890d2e1c7672dd105728cee5672246229ac8234f711b16f87d2b77b251b

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