attributedict-0.3.0
توضیحات
A dictionary object with attributes support.
| ویژگی | مقدار |
|---|---|
| سیستم عامل | POSIX |
| نام فایل | attributedict-0.3.0 |
| نام | attributedict |
| نسخه کتابخانه | 0.3.0 |
| نگهدارنده | [] |
| ایمیل نگهدارنده | [] |
| نویسنده | Jonas Grimfelt |
| ایمیل نویسنده | grimen@gmail.com |
| آدرس صفحه اصلی | https://github.com/grimen/python-attributedict |
| آدرس اینترنتی | https://pypi.org/project/attributedict/ |
| مجوز | MIT |
# `attributedict` [](https://badge.fury.io/py/attributedict) [](https://travis-ci.com/grimen/python-attributedict) [](https://codecov.io/gh/grimen/python-attributedict)
*A dictionary object with attributes support.*
## Install
Install using **pip**:
```sh
$ pip install attributedict
```
## Use
Example:
```python
from attributedict.collections import AttributeDict
data = AttributeDict({'foo': {'bar': [1, 2, 3]}})
data.foo # => `{'bar': [1, 2, 3]}}`
data.foo.bar # => `[1, 2, 3]`
data.foo = {'baz': True}
data.foo = # => `{'baz': True}`
del data.foo.baz
# and/or...
data = AttributeDict({'foo': {'bar': [1, 2, 3]}})
data['foo'] # => `{'bar': [1, 2, 3]}}`
data['foo']['bar'] # => `[1, 2, 3]`
data['foo'] = {'baz': True}
data['foo'] = # => `{'baz': True}`
del data['foo']['baz']
# instance of `dict`...
isinstance(data, dict) # => True
isinstance(data, attributedict.collections.AttributeDict) # => True
isinstance(data.__dict__, dict) # => True
isinstance(data.__dict__, attributedict.collections.AttributeDict) # => False
# no need for custom encoders...
data = AttributeDict({'foo': {'bar': [1, 2, 3]}})
json.dumps(data) # => `{"foo": {"bar": [1, 2, 3]}}`
json.dumps(data.__dict__) # => `{"foo": {"bar": [1, 2, 3]}}`
# etc.
```
## Test
Clone down source code and run:
```sh
$ make install
$ make test
```
## License
Released under the MIT license.
نیازمندی
| مقدار | نام |
|---|---|
| >=0.1.0 | rootpath |
| >=0.1.0 | inspecta |
| >=0.0.5 | colour-runner |
| >=3.3.0 | deepdiff |
| >=3.0.0 | tox |
| >=4.5.2 | coverage |
| >=2.0.15 | codecov |
نحوه نصب
نصب پکیج whl attributedict-0.3.0:
pip install attributedict-0.3.0.whl
نصب پکیج tar.gz attributedict-0.3.0:
pip install attributedict-0.3.0.tar.gz