Dot.notation access for dictionaries
Project description
Simple Dotdict
The dotdict
class is a dictionary that allows access to its elements using dot notation. It inherits from the built-in dict
class in Python.
Installation
To install simple-dotdict
, you can use pip:
pip install simple-dotdict
Usage
Here is an example of how to use the dotdict
class:
from simple_dotdict import dotdict
d = dotdict({'key': 'value'})
print(d.key) # Outputs: value
You can also set and delete keys using dot notation:
d.new_key = 'new_value' # Sets a new key-value pair
print(d.new_key) # Outputs: new_value
del d.new_key # Deletes the key-value pair
License
This project is licensed under the MIT License - see the LICENSE file for details.# simple-dotdict
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
simple_dotdict-1.0.0.tar.gz
(2.0 kB
view hashes)
Built Distribution
Close
Hashes for simple_dotdict-1.0.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4fca8fbe94152f27dbdf42454a4f1da797090e1e10a0e588dfc9451c76272d08 |
|
MD5 | bf130616937ce01fa7cfe4efb8e82d11 |
|
BLAKE2b-256 | f9f763ed8fe5210673642de137f28ead90cbe9489a547a8e2030ef9afcdf7734 |