A Python library to parse JSON, YAML files and extract deeply nested keys.
from deepextract import deepextract
# Demo: deepextract.extract_key(obj, key)
deeply_nested_dict = {
"items": {
"item": {
"id": {
"type": {
"donut": {
"name": {
"batters": {
"my_target_key": "my_target_value"
}
}
}
}
}
}
}
}
print(deepextract.extract_key(deeply_nested_dict, "my_target_key") == "my_target_value") # prints True
See examples
folder for more.
pip install deepextract
Support for Python 3.6 and greater.
conda create -n deepextract_env python=3.7 # do it once
conda install -r requirements.txt
Source code is in deepextract. Start editing and Happy contributing! 🌟
Based on descriptions from here, whenever project owner pushes a tagged commit to this Git repository remote on GitHub, GH workflow will publish it to PyPI.
And it'll publish any push to TestPyPI which is useful for providing test builds to repo's alpha users as well as making sure that your release pipeline remains healthy.
Manual deploy to TestPyPI:
python setup.py sdist bdist_wheel
twine upload -r testpypi dist/*
python -m unittest
MIT. See LICENSE.md
Follows syntax vM.M.P First is major and means not backwards compatible changes. Second is minor and means backwards compatible changes. Third is patch and means small backwards compatible changes.
The manual place of source of truth for the version is at deepextract/__init__.py
Source: https://packaging.python.org/guides/single-sourcing-package-version/#single-sourcing-the-version
deepextract
was written by Yigit Alparslan
.