Skip to main content

Pint meets attrs.

Project description

Pinttrs

Pint meets attrs

PyPI version Conda version

GitHub Workflow Status (branch) Documentation Status

Rye Ruff Code style: black

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-24.1.0.tar.gz (58.3 kB view details)

Uploaded Source

Built Distribution

pinttrs-24.1.0-py3-none-any.whl (15.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: pinttrs-24.1.0.tar.gz
  • Upload date:
  • Size: 58.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.12.1

File hashes

Hashes for pinttrs-24.1.0.tar.gz
Algorithm Hash digest
SHA256 3ce9716e33b21594aa6950ea292596ce69035531c0a0aedb4d955aafb0a72091
MD5 31260fc694dcc6b82a91f24da149fe8b
BLAKE2b-256 913a01a52dc9e41bf29a6624d10a5458b77d681b195c94a4f2b7ec2fb3323c82

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pinttrs-24.1.0-py3-none-any.whl
  • Upload date:
  • Size: 15.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.12.1

File hashes

Hashes for pinttrs-24.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 16a185ca4a25f6b2a3c3462aad1a2304bbd889f6b640326171e4c2783b9e5e0b
MD5 56793e5936f488fd9095764be84eff30
BLAKE2b-256 e0f1f034ad0ee7fc49b60acbdb761a880dbbb69843d7755dbab90a2cea551b93

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page