Skip to main content

Pint meets attrs.

Project description

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.

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

pinttrs-26.1.0.tar.gz (150.7 kB view details)

Uploaded Source

Built Distribution

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

pinttrs-26.1.0-py3-none-any.whl (17.7 kB view details)

Uploaded Python 3

File details

Details for the file pinttrs-26.1.0.tar.gz.

File metadata

  • Download URL: pinttrs-26.1.0.tar.gz
  • Upload date:
  • Size: 150.7 kB
  • Tags: Source
  • Uploaded using 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}

File hashes

Hashes for pinttrs-26.1.0.tar.gz
Algorithm Hash digest
SHA256 77d7bfecd7d56efe869789c03b638031bcf40f02752f0f207582fdd8290c4e0a
MD5 35c1964e4c5e69f989bfc827c295c11b
BLAKE2b-256 5f1c87c8edd78ab0d49182ac5508b711b64bddfcecc3345a857258f39928a7db

See more details on using hashes here.

File details

Details for the file pinttrs-26.1.0-py3-none-any.whl.

File metadata

  • Download URL: pinttrs-26.1.0-py3-none-any.whl
  • Upload date:
  • Size: 17.7 kB
  • Tags: Python 3
  • Uploaded using 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}

File hashes

Hashes for pinttrs-26.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 7e0179c5643b49bc11d3433203c364216ad21a328051021052a8a6a20dd1f44a
MD5 3c9fceff152a624b7f1519cf54c07788
BLAKE2b-256 c77a118535678c3d459d7628a2ea7515ae8321e5a9bff5dd75b2454a33cd1e47

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