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.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 842f8cef2567f53de1e243f87e8bc89c4c91a8a977ed8cc38505332f868e1f3c |
|
MD5 | 74b12508e743db25990ca8ae68767d92 |
|
BLAKE2b-256 | a534f8e6ec8afffc651bee002581bd9b7ff39ffad0be9bec6553e892262f6136 |
Close
Hashes for pedroasad_attrs_patch-0.2.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e8e70f1ee278658f820d4f3fb31bfee53642cad5113371e2d4a78c33db3b1907 |
|
MD5 | 40d2784d046914dc00853e70cdeae8ca |
|
BLAKE2b-256 | 3e9931f7413b331bad5f885e664acbb59b20966e576bde760cf862bd0b221fc0 |