https://github.com/ya332/deepextract
A Python library to parse JSON, YAML files and extract deeply nested keys.
https://github.com/ya332/deepextract
json pypi-package yaml yml
Last synced: about 2 months ago
JSON representation
A Python library to parse JSON, YAML files and extract deeply nested keys.
- Host: GitHub
- URL: https://github.com/ya332/deepextract
- Owner: ya332
- License: mit
- Created: 2021-03-02T00:24:40.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2021-04-14T01:52:56.000Z (about 5 years ago)
- Last Synced: 2025-02-17T12:17:45.907Z (over 1 year ago)
- Topics: json, pypi-package, yaml, yml
- Language: Python
- Homepage: https://pypi.org/project/deepextract/
- Size: 36.1 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[](https://gitHub.com/ya332/deepextract/graphs/commit-activity)
[](https://www.python.org/)
[](https://gitHub.com/ya332/deepextract/)
[](https://gitHub.com/ya332/deepextract/)
[](https://pypi.python.org/pypi/deepextract/)
[](https://pepy.tech/project/deepextract)
[](https://git-scm.com/book/en/v2/GitHub-Contributing-to-a-Project)
# deepextract 🔥
A Python library to parse JSON, YAML files and extract deeply nested keys.
## Usage 🎯
```python
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.
## Installation ⚠️
```sh
pip install deepextract
```
## Requirements 🌌
Support for Python 3.6 and greater.
## Development 🛎️
```sh
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! 🌟
## Deployment to PyPI 💎
Based on descriptions from [here](https://packaging.python.org/guides/publishing-package-distribution-releases-using-github-actions-ci-cd-workflows/), 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:
```sh
python setup.py sdist bdist_wheel
twine upload -r testpypi dist/*
```
## Running tests 🔥
```sh
python -m unittest
```
## Licence ✅
MIT. See LICENSE.md
## Version
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
## Authors ✏️
`deepextract` was written by `Yigit Alparslan`.