Skip to main content

Pint meets attrs.

Project description

Pinttrs

Pint meets attrs

PyPI version Conda version

GitHub Workflow Status (branch) 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-22.1.0.tar.gz (13.9 kB view hashes)

Uploaded source

Built Distribution

Pinttrs-22.1.0-py3-none-any.whl (13.2 kB view hashes)

Uploaded py3

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page