Skip to main content

Python library to trace path of a particular key inside a nested dict

Project description

trace-dkey

Python library to trace path of a particular key inside a nested dict

Installation

For stable version - pip install trace-dkey

For developement - git clone https://github.com/Agent-Hellboy/trace-dkey - cd trace-dkey - python -m venv .venv - source .venv/bin/activate

Example

>>> from trace_dkey import trace
>>> l={'a':{'b':{'c':{'d':{'e':{'f':1}}}}}}
>>> trace(l,'f')
Found 'f' at  a--> b--> c--> d--> e-->f

Now you can query it as l['a']['b']['c']['d']['e']['f']

>>> l['a']['b']['c']['d']['e']['f']
1

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

trace-dkey-0.0.1.tar.gz (2.8 kB view hashes)

Uploaded Source

Built Distribution

trace_dkey-0.0.1-py3-none-any.whl (3.0 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page