A flexible way to access dict data instead of built-in dict.
Project description
# Flexible Dict
A flexible way to access dict data instead of built-in dict.
## Installation
```shell
pip install flexible-dict
```
## Usage
### Define a dict class and access value
```python
from flexible_dict import json_object, MISSING
@json_object
class A:
i: int = 3
j: str = "init value"
s: float
g: int = MISSING
a = A()
print(a) # actual is a dict
print(a.i) # access value via x.y
print(a.j)
a.j = "update value" # set value
print(a['j']) # access value via native dict way
```
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
flexible_dict-1.1.0.tar.gz
(4.6 kB
view hashes)
Built Distribution
Close
Hashes for flexible_dict-1.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b9ce367ea2a74df8594b994f0401d1847d0a1ac47b554cbcf9f3d14f89087f98 |
|
MD5 | 6a8105f51ebb9947fd9b612cd007a4d4 |
|
BLAKE2b-256 | cabfb28897ad58f1b900d7ec64d028a324630899661b1910f9e021c7012b83cf |