dicts_paths_handler
A library that allows access to Python dictionary values in a more readable way by separating keys using dot notation.
Installation
pip install dicts_paths_handler
#or
py -m pip install dicts_paths_handler
Usage :
First, create a new instance of DictsPathsHandler :
import dicts_paths_handler
your_dict = {
"language":{
"availables":("Python", "C", "Java", "C#"),
"selected":"Python",
}
}
dph = dicts_paths_handler.DictsPathsHandler(your_dict)
You can access any value in your_dict simply by calling its 'dict_path'. In the following example, we want to access to the value of your_dict['language']['selected']
selected_language = dph.get_value("language.selected")
print(selected_language)
# Should print 'Python'
An InvalidDictPathError exception will be raised if the dict_path is not found or invalid
You can also edit a value. In this example, we want to change the value of your_dict[language]['selected'] :
dph.edit_value("language.selected", "C#")
print(dph.get_value("language.selected")) # Should print 'C#'
An InvalidDictPathError exception will be raised if the dict path is not found or invalid
How does it work ?
Each key of the dict is a part of the dict path, in the normal order of python dict keys : keyA.keyAA.keyAAA.
Infos
This project is developed by SoloEnder
Metadata
Release files for dicts-paths-handler 1.3.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| dicts_paths_handler-1.3.1.tar.gz | 4.6 kB | Without provenance | Details for dicts_paths_handler-1.3.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| dicts_paths_handler-1.3.1-py3-none-any.whl | Python 3 | none | any | Details for dicts_paths_handler-1.3.1-py3-none-any.whl |
Total release size: 9.8 kB
Release files / dicts_paths_handler-1.3.1.tar.gz
| Download URL | dicts_paths_handler-1.3.1.tar.gz |
|---|---|
| Size | 4.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
f8e8c49eebac81d7c7f64ac1e3a8247157bd3a89991c8ed5370d7b8485466379
|
|
BLAKE2b-256 checksum How to use checksums |
deb12568c142bca94df52cfbe9d6ae6c9414f6f62659a815f7174f19b4fa2cb4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.0
|
Release files / dicts_paths_handler-1.3.1-py3-none-any.whl
| Download URL | dicts_paths_handler-1.3.1-py3-none-any.whl |
|---|---|
| Size | 5.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
047dd665f49b0268a49bcb260d482764b9e4d2497f3ab58efdefe41105b5b16f
|
|
BLAKE2b-256 checksum How to use checksums |
da2c6441659ebb278bba31b7bf18f36e63bada4f5b14ff2828f4fcd3d65c306a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.0
|
Security for dicts-paths-handler 1.3.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.