A collection of nice utility functions for python
Project description
Understreck
A collection of nice utility functions for python
Free software: GNU General Public License v3
Documentation: https://understreck.readthedocs.io.
Features
Perform a safe get on a nested dictionary with the nested_get function
Nested Get example:
import understreck as _ test_dictionary = { "the_top_level": { "second_level": {"third_level": "it works", "third_level_sibling": False} } } # Using dot delimited strings result = _.nested_get(test_dictionary, "the_top_level.second_level.third_level") # result = "it works" result = _.nested_get(test_dictionary, "the_top_level.second_level.DOES_NOT_EXIST") # result = None # Using a list or tuple result = _.nested_get(test_dictionary, ["the_top_level", "second_level", "third_level"]) # result = "it works" result = _.nested_get(test_dictionary, ["the_top_level", "second_level", "DOES_NOT_EXIST"]) # result = None
Credits
This package was created with Cookiecutter and the audreyr/cookiecutter-pypackage project template.
History
0.1.1 (2018-11-02)
Update the readme
0.1.0 (2018-11-02)
First release on PyPI.
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
understreck-0.1.1.tar.gz
(9.1 kB
view hashes)
Built Distribution
Close
Hashes for understreck-0.1.1-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e4144cf2ee19a2b3bf4d9ef0579eec23d045f23481163b175b368c48ac172ccd |
|
MD5 | 2653d2d27ccb6c18be09f200b5a405ea |
|
BLAKE2b-256 | 53e674a1c97234bb2db89a6e0a0f5b7aaaf1c1a5be0179a8f03d4a4238d6ade4 |