Skip to main content

Pint meets attrs

Project description

Pinttrs

Pint meets attrs

PyPI version Conda version

GitHub Workflow Status (branch) Codecov Documentation Status

Code style: black Imports: isort

Motivation

The amazing attrs library is a game-changer when it comes to writing classes. Its initialisation 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 initialise 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-21.3.1.tar.gz (11.1 kB view details)

Uploaded Source

Built Distribution

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

pinttrs-21.3.1-py3-none-any.whl (12.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: pinttrs-21.3.1.tar.gz
  • Upload date:
  • Size: 11.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.7 CPython/3.6.13 Darwin/20.5.0

File hashes

Hashes for pinttrs-21.3.1.tar.gz
Algorithm Hash digest
SHA256 7fad4712db2a6a769b7b4455b9dbd38a54f1771fec4757cbe47d7fd6ede5efff
MD5 86abef71042f0ec60cd50970b00f1d51
BLAKE2b-256 f4ec8efeade2293317fc3c0aac87673af51b8b17462a517ef4aec67fac2b3e81

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pinttrs-21.3.1-py3-none-any.whl
  • Upload date:
  • Size: 12.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.7 CPython/3.6.13 Darwin/20.5.0

File hashes

Hashes for pinttrs-21.3.1-py3-none-any.whl
Algorithm Hash digest
SHA256 4580c8bd667939f95c28e96a88665f9f635cd1e32591e801cdb55022aa496943
MD5 5316985335b73258c3d6314b5dd7bd6c
BLAKE2b-256 0c76e270adf73f3c64c42831f4b65f9f11886cb2aab29e1a15583bdc358ce761

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