Skip to main content

u

Statically typed units.

Quickstart

# Type safe assignments
duration: u.Duration = u.seconds(5)  # Ok
distance: u.Distance = u.amperes(5)  # Type checking error

# Type safe math
print(u.seconds(120) + u.minutes(3))  # Ok
print(u.seconds(120) + u.amperes(3))  # Type checking error

# Type safe compound units (with some caveats)
speed: u.Div[u.Distance, u.Duration] = u.km(5) / u.hours(1)  # Ok

# Reusable prefixes
print(u.bytes(1000) == u.mega(u.bytes)(1))

# Define your own Quantities and Units
class Tastiness(u.Quantity):
    pass

mmm = u.Unit[Tastiness](symbol='mmm', multiplier=1)
yum = u.Unit[Tastiness]('yum', 10)

Metadata

Release files for u 0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for u 0.1
File Size Uploaded
u-0.1.tar.gz 7.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for u 0.1
File Interpreter ABI Platform
u-0.1-py3-none-any.whl Python 3 none any Details

Total release size: 18.4 kB

Release files / u-0.1.tar.gz

Download URL u-0.1.tar.gz
Size 7.1 kB
Tags Source
SHA-256 checksum
How to use checksums
dbdbceb210a71ccc722d2689f2b270376fdd278e6f38a664a930178f4e21eaba
BLAKE2b-256 checksum
How to use checksums
39dadf83b3a43f946bfde20dedf1095f8fc9584340ebb02082c87bd457369e01
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.12.2

Release files / u-0.1-py3-none-any.whl

Download URL u-0.1-py3-none-any.whl
Size 11.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
028526128cb7b84c2f5f0dce7ccacca34dea99950b9ec09f24faa62fc252ecb8
BLAKE2b-256 checksum
How to use checksums
7e610f2f440284b690f88effa82ad9dfe5ad00919385bcb2ceb1c373da9bae62
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.12.2

Release history Release notifications | RSS feed

4.0

2 release files

3.1

2 release files

3.0

2 release files

2.1

2 release files

2.0

2 release files

1.1.1

2 release files

1.1.0

2 release files

1.0.4

2 release files

1.0.3

2 release files

1.0.2

2 release files

1.0.1

2 release files

1.0

2 release files

This release

0.1 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page