A set of patches for the excellent attrs library
Project description
Python application template
A set of patches for the excellent attrs library
For | See |
---|---|
Documentation | https://psa-exe.gitlab.io/python-attrs-patch |
Issue tracker | https://gitlab.com/psa-exe/python-attrs-patch/issues |
Repository contents | MANIFEST |
History of changes | CHANGELOG |
Contribution/development guide | CONTRIBUTING |
Copy of MIT License | LICENSE |
Installation
pip install pedroasad-attrs-patch
This library contains optional support for Numpy arrays in attrs frozen classes.
It may be installed by passing the [numpy]
option when installing.
Usage
It acts as a drop-in replacement to attrs. The example below shows how to use it, including all currently existing improvements.
from attrs_patch import attr
@attr.autodoc
@attr.s(frozen=True)
class SomeClass:
a = attr.ib(metadata={"help": "An immutable numpy array."},
converter=attr.frozen_numpy_array,
hash=False)
b = attr.ib(metadata={"help": "A positive integer."},
converter=int,
validator=attr.validators.positive)
c = attr.ib(metadata={"help": "A non-zero integer."},
converter=int,
validator=attr.validators.nonzero)
— Powered by GitLab CI
— Created by Pedro Asad <pasad@lcg.ufrj.br> using cookiecutter and @pedroasad.com/templates/python/python-app-1.0
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Close
Hashes for pedroasad-attrs-patch-0.2.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4c802cd37aa1848d4f995df8c24d12a98a0a574eab9401598549dbc347a0b0c6 |
|
MD5 | 68c722bea440c77395c5c2bb207d0f57 |
|
BLAKE2b-256 | 59f0871f38a5ac50d3df47fe2b206afffce971315aa81e0ff773ddb3b68140e0 |
Close
Hashes for pedroasad_attrs_patch-0.2.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ef4806db5893c7ecd761a07879401b7922c2ba840d1ae81c736336e5556ef0ce |
|
MD5 | 807e0fa98b69bccbfa988f54fdab20f8 |
|
BLAKE2b-256 | cb2d513957425ed174d764e50094efe8eb3721637bf31f16fda4224f9503cbe6 |