Pint meets attrs.
Project description
Pinttrs
Pint meets attrs
Motivation
The amazing attrs library is a game-changer when it comes to writing classes. Its initialization sequence notably allows for automated conversion and verification of attribute values. This package is an attempt at designing a system to apply units automatically and reliably to attributes with Pint.
Features
- Attach automatically units to unitless values passed to initialize an attribute
- Verify unit compatibility when assigning a value to an attribute
- Interpret units in dictionaries with a simple syntax
- Define unit context to vary unitless value interpretation dynamically
Check the documentation for more detail.
License
Pinttrs is distributed under the terms of the MIT license.
About
Pinttrs is written and maintained by Vincent Leroy.
Development is supported by Rayference.
Pinttrs is a component of the Eradiate radiative transfer model.
The Pinttrs logo is based on Agus Nugroho's glass icon and parts of the attrs logo.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file pinttrs-25.1.0.tar.gz
.
File metadata
- Download URL: pinttrs-25.1.0.tar.gz
- Upload date:
- Size: 113.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.7.15
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 |
6bdc2e868e400fed9f734f2b7d1f47dc40ac5f180e574929093c83ebc517d5e3
|
|
MD5 |
21ebbe5efd29f91a71ffb0f7d00eb0b7
|
|
BLAKE2b-256 |
08a04fbf5eeb265b01beca6d54e6755c700e5bfbb82a5070a0d4e5ac0cb75f7c
|
File details
Details for the file pinttrs-25.1.0-py3-none-any.whl
.
File metadata
- Download URL: pinttrs-25.1.0-py3-none-any.whl
- Upload date:
- Size: 15.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.7.15
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 |
ef2a59edec41a681a00fc78bc0eb055f8f1ccebcbbf7711ea7ae4cc1cc07aa89
|
|
MD5 |
cb5a3b10c126530404d585645cb7fe02
|
|
BLAKE2b-256 |
4a0ed2aed001febeb1b4ed01f18ff22f70ae38b499bfec116312f084bc28f551
|