Skip to main content

Tools for readable unit types, geometry, and trigonometric utilities.

Project description

PyUnit

PyUnit is a lightweight Python library for creating, manipulating, and comparing units in a readable and performant way.
It provides trigonometric, geometric, and arithmetic utilities, enabling clean and understandable code for unit-based calculations.


Features

  • Create unit types like Distance, Weight, Angle, Time, Temperature, etc.
  • Perform arithmetic operations and comparisons on units.
  • Access trigonometric and geometric functions for calculations.
  • Lightweight and readable syntax without heavy dependencies.
  • Supports Python 3.10+ on Windows.

Installation

pip install PyUnit

(Note: This package is currently in early development. Some features may be unstable.)


Usage Example

from pyunit import Distance, Angle, Char, new_char

# Create a distance unit
d1 = Distance(10)
d2 = Distance(5)

# Perform arithmetic
total = d1 + d2

# Create a character
a = new_char("A")  # type: Char["A"]

# Angle calculation
from pyunit import UnitMath as um
angle = um.alpha(3, 4).radians  # returns angle in radians

Licence

This project is licensed under the MIT License – see the LICENCE file for details.


Contributing

Contributions, bug reports, and feature requests are welcome! Visit the repository: PyUnit on GitHub

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

pyunit_neo-1.0.2.tar.gz (18.8 kB view details)

Uploaded Source

Built Distribution

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

pyunit_neo-1.0.2-py3-none-any.whl (21.8 kB view details)

Uploaded Python 3

File details

Details for the file pyunit_neo-1.0.2.tar.gz.

File metadata

  • Download URL: pyunit_neo-1.0.2.tar.gz
  • Upload date:
  • Size: 18.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.7

File hashes

Hashes for pyunit_neo-1.0.2.tar.gz
Algorithm Hash digest
SHA256 0c8b668bc085fe1c59845309f79a538d96ef8d2d206ca4dbe78e8d632c44ace2
MD5 55887696d49603038f0ce3bd29c53490
BLAKE2b-256 f0156a0e006bec0b344c9e695484b5a5a1ee7894fdf9ba04d69efbd9fe758e2e

See more details on using hashes here.

File details

Details for the file pyunit_neo-1.0.2-py3-none-any.whl.

File metadata

  • Download URL: pyunit_neo-1.0.2-py3-none-any.whl
  • Upload date:
  • Size: 21.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.7

File hashes

Hashes for pyunit_neo-1.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 5fbe47d25b90483bbfbdc1189d67cd8c402d8128a5882e04ba05a90ff26c69eb
MD5 56cbc1fd8b1aa86e2002c049e9f350f7
BLAKE2b-256 1fab36bceed16506bf1363a2d5935b69b1a7501310ce4b028e979784b1798734

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