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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pedroasad-attrs-patch-0.2.1.tar.gz.
File metadata
- Download URL: pedroasad-attrs-patch-0.2.1.tar.gz
- Upload date:
- Size: 7.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/40.6.2 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.7.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4c802cd37aa1848d4f995df8c24d12a98a0a574eab9401598549dbc347a0b0c6
|
|
| MD5 |
68c722bea440c77395c5c2bb207d0f57
|
|
| BLAKE2b-256 |
59f0871f38a5ac50d3df47fe2b206afffce971315aa81e0ff773ddb3b68140e0
|
File details
Details for the file pedroasad_attrs_patch-0.2.1-py3-none-any.whl.
File metadata
- Download URL: pedroasad_attrs_patch-0.2.1-py3-none-any.whl
- Upload date:
- Size: 7.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/40.6.2 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.7.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ef4806db5893c7ecd761a07879401b7922c2ba840d1ae81c736336e5556ef0ce
|
|
| MD5 |
807e0fa98b69bccbfa988f54fdab20f8
|
|
| BLAKE2b-256 |
cb2d513957425ed174d764e50094efe8eb3721637bf31f16fda4224f9503cbe6
|