Skip to main content

Pinttrs

Pint meets attrs

PyPI version Conda version

GitHub Workflow Status (branch) Documentation Status

uv Ruff

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.

Release files for pinttrs 26.1.0

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

Source distribution (sdist)

Source distribution for pinttrs 26.1.0
File Size Uploaded
pinttrs-26.1.0.tar.gz 150.7 kB Details

Built distribution (wheel)

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

Total release size: 168.5 kB

Release files / pinttrs-26.1.0.tar.gz

Download URL pinttrs-26.1.0.tar.gz
Size 150.7 kB
Tags Source
SHA-256 checksum
How to use checksums
77d7bfecd7d56efe869789c03b638031bcf40f02752f0f207582fdd8290c4e0a
BLAKE2b-256 checksum
How to use checksums
5f1c87c8edd78ab0d49182ac5508b711b64bddfcecc3345a857258f39928a7db
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.10.8 {"installer":{"name":"uv","version":"0.10.8","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / pinttrs-26.1.0-py3-none-any.whl

Download URL pinttrs-26.1.0-py3-none-any.whl
Size 17.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7e0179c5643b49bc11d3433203c364216ad21a328051021052a8a6a20dd1f44a
BLAKE2b-256 checksum
How to use checksums
c77a118535678c3d459d7628a2ea7515ae8321e5a9bff5dd75b2454a33cd1e47
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.10.8 {"installer":{"name":"uv","version":"0.10.8","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
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