https://github.com/zincware/dot4dict
Access dictionary keys with a dot
https://github.com/zincware/dot4dict
dict2dot dictdot dot4dict python
Last synced: 10 months ago
JSON representation
Access dictionary keys with a dot
- Host: GitHub
- URL: https://github.com/zincware/dot4dict
- Owner: zincware
- License: apache-2.0
- Created: 2022-01-21T16:32:21.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2022-02-23T12:43:33.000Z (over 4 years ago)
- Last Synced: 2025-05-14T19:48:39.938Z (about 1 year ago)
- Topics: dict2dot, dictdot, dot4dict, python
- Language: Python
- Homepage:
- Size: 19.5 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[](https://coveralls.io/github/zincware/dot4dict?branch=main)
[](https://badge.fury.io/py/dot4dict)
# Dot4Dict
Access dictionary keys with a Dot:
```python
from dot4dict import dotdict
my_dict = dotdict({"foo": "bar"})
assert my_dict.foo == "bar"
assert my_dict["foo"] == "bar"
```
This works also recursively
```python
from dot4dict import dotdict
my_dict = dotdict({"a": {"b": {"c": "foo"}}})
assert my_dict.a.b.c == "foo"
```
Copyright
=========
This project is distributed under the [Apache license version 2.0](https://github.com/zincware/dot4dict/blob/main/LICENSE).