Attributee
Attributee is a Python 3 library for declarative object initialization. Input arguments are defined as class attributes and are automatically processed when creating an object. It is in a way similar to Django ORM or some other ORMs, but the main purpose of this library is to simplify parsing input arguments to object constructors.
The library is a work-in-progress, I am adding stuff that I consider useful for my other projects.
Simple use case
from attributee import Attributee, String, Float
class Model(Attributee):
# Simply list the attributes of the object ...
name = String(default="noname")
value1 = Float()
value2 = Float(default=0, val_min=-10, val_max=10)
# ... no constructor needed
# default arguments assigned
model1 = Model(value1=10)
# automatic type conversion where possible
model2 = Model(value1=10, value2="5")
Documentation
I am working on it.
Authors
Luka Čehovin Zajc
License
The library is available under the simplified BSD license.
Metadata
Release files for attributee 0.1.10
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| attributee-0.1.10-py3-none-any.whl | Python 3 | none | any | Details |
Release files / attributee-0.1.10-py3-none-any.whl
| Download URL | attributee-0.1.10-py3-none-any.whl |
|---|---|
| Size | 13.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
548654ab9e522021769655ae5714d1d56beab468d61fd7051015016b3a7ff6f9
|
|
BLAKE2b-256 checksum How to use checksums |
a500a1cf1c726a0c2a2a6f193912ad64756767910fcbfc497887a7e6d9a7eb0f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.10.12
|