Metadata-Version: 2.1
Name: json_handler
Version: 1.0.1
Summary: Manipulate JSON data or dict values as attributes of an object.
Home-page: https://github.com/WexxanBest/json_handler
Author: Wexxan
Author-email: WexxanBest@yandex.ru
License: UNKNOWN
Download-URL: http://pypi.python.org/pypi/json_handler/
Platform: UNKNOWN
Classifier: Topic :: Utilities
Classifier: Natural Language :: English
Classifier: Operating System :: OS Independent
Classifier: Intended Audience :: Developers
Classifier: Development Status :: 3 - Alpha
Classifier: Programming Language :: Python :: 3.8
Description-Content-Type: text/markdown

# JSON Handler

It's easy-to-use library which helps you to work with data in JSON files and Python dictionaries like if they were Python objects.

## Examples

### Example 1. 

You can easily read existing JSON file and modify it. Here is JSON file (example.json): 

```json
{
    "field_1": "Hi",
    "field_2": "Hello world!",
    "field_3": {
        "sub_field": 123
    }
}
```

We can modify the content of that by using following code:

```python
from json_handler import JsonHandler

handler = JsonHandler('example.json')

handler.field_1 = 123
handler['field_2'] = "What's up?"
handler.sub_field = [1, 2, 3]

handler.save()
```

The result of modifications will be (example.json):
```json
{
    "field_1": 123,
    "field_2": "What's up?",
    "field_3": {
        "sub_field": [1, 2, 3]
    }
}
```


