Skip to main content

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


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)

Uploaded Source

Built Distribution

flexible_dict-1.1.0-py3-none-any.whl (5.2 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page