attributes-0.1.1
توضیحات
-
| ویژگی | مقدار |
|---|---|
| سیستم عامل | - |
| نام فایل | attributes-0.1.1 |
| نام | attributes |
| نسخه کتابخانه | 0.1.1 |
| نگهدارنده | [] |
| ایمیل نگهدارنده | [] |
| نویسنده | Cologler |
| ایمیل نویسنده | skyoflw@gmail.com |
| آدرس صفحه اصلی | https://github.com/Cologler/attributes-python |
| آدرس اینترنتی | https://pypi.org/project/attributes/ |
| مجوز | MIT License |
# attributes

[](https://travis-ci.com/Cologler/click-anno-python)
[](https://pypi.org/project/attributes/)
a python version attribute like attribute of csharp.
## Usage
``` py
from attributes import Attribute
class Data(Attribute): # make your own attribute
def __init__(self, *args, **kwargs):
self.args = args
self.kwargs = kwargs
@Data(1, 2) # use your attribute
class SomeClass:
pass
data, = Attribute.get_attrs(SomeClass) # than load on runtime and use it.
```
### Parameter Attribute
``` py
@param_attr('a', Data(1, 2), Data(3, 4))
def func(a):
pass
data, = Attribute.get_attrs(param_of(func, 'a'))
# or
data, = Data.get_from_param(func, 'a')
```
نحوه نصب
نصب پکیج whl attributes-0.1.1:
pip install attributes-0.1.1.whl
نصب پکیج tar.gz attributes-0.1.1:
pip install attributes-0.1.1.tar.gz