DictToObject
DictToObject is a Python utility class that converts dictionaries into objects, allowing you to access keys as attributes.
Installation
Install using pip:
pip install dicttoobject
Dependencies
- termcolor: python
Example
- Import the
DictToObjectclass:
from dicttoobject import DictToObject
- Create a dictionary:
data = {
'name': 'John Doe',
'age': 30,
'address': {
'street': '123 Main St',
'city': 'New York'
}
}
- Convert the dictionary into an object:
obj = DictToObject(data)
# Accessing attributes
print(obj.name) # Output: John Doe
print(obj.age) # Output: 30
Metadata
Release files for dtob 1.1.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| dtob-1.1.2.tar.gz | 1.8 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| dtob-1.1.2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 3.6 kB
Release files / dtob-1.1.2.tar.gz
| Download URL | dtob-1.1.2.tar.gz |
|---|---|
| Size | 1.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
108b40f92813a6a5963dfefa03df3221f3c6c363c23e4cd072d2f13df1a796c2
|
|
BLAKE2b-256 checksum How to use checksums |
19e8f4015f0de7c3d4a859c4486e3ac1914a9a8180afaa6595bff81ee7c00837
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.0.1 CPython/3.12.8
|
Release files / dtob-1.1.2-py3-none-any.whl
| Download URL | dtob-1.1.2-py3-none-any.whl |
|---|---|
| Size | 1.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
52b459507f025da1c8dbbc82374cdee9d9a96ec97ce5f764b361e74cd14d2dc4
|
|
BLAKE2b-256 checksum How to use checksums |
43f7567986f1670a15f88f500d3fe991282929759c393721b4690df345bacb83
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.0.1 CPython/3.12.8
|