{"id":22674742,"url":"https://github.com/bitnom/traversy","last_synced_at":"2025-03-29T12:22:09.747Z","repository":{"id":62585188,"uuid":"310829304","full_name":"bitnom/traversy","owner":"bitnom","description":"Fast data traversal \u0026 manipulation tools for Python.","archived":false,"fork":false,"pushed_at":"2020-11-22T04:58:50.000Z","size":424,"stargazers_count":1,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-24T07:43:20.158Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bitnom.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-11-07T11:28:26.000Z","updated_at":"2020-11-17T23:39:30.000Z","dependencies_parsed_at":"2022-11-03T22:00:58.198Z","dependency_job_id":null,"html_url":"https://github.com/bitnom/traversy","commit_stats":null,"previous_names":["tensortom/traversy"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bitnom%2Ftraversy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bitnom%2Ftraversy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bitnom%2Ftraversy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bitnom%2Ftraversy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bitnom","download_url":"https://codeload.github.com/bitnom/traversy/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246181810,"owners_count":20736620,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-12-09T17:17:59.386Z","updated_at":"2025-03-29T12:22:09.724Z","avatar_url":"https://github.com/bitnom.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# traversy\n\nFast data traversal \u0026 manipulation tools for Python. Check out the\n[documentation](https://tensortom.github.io/traversy/).\n\n[![Actively Maintained](https://img.shields.io/badge/Maintained%3F-yes-green.svg)](https://gitHub.com/TensorTom/traversy/graphs/commit-activity)\n[![MIT License](https://img.shields.io/pypi/l/ansicolortags.svg)](https://pypi.python.org/pypi/traversy/)\n[![PyPI pyversions](https://img.shields.io/pypi/pyversions/ansicolortags.svg)](https://pypi.python.org/pypi/traversy/)\n\n## Quick-Start\n\n```python\nfrom traversy import traverse\nimport json\n\n\njo = json.loads(\"\"\"{\n  \"2019\": {\n    \"uat\": {\n      \"pkey\": true,\n      \"user\": \"testval\",\n      \"testkey\": true,\n      \"mylist\": [\n      {\n        \"foo\": \"bar\",\n        \"foo2\": \"bar2\"\n      },\n      {\n        \"baz\": \"milk\",\n        \"bar\": \"foo\"\n      }\n      ]\n    },\n    \"dev\": {\n      \"pkey\": true,\n      \"testval\": \"testval\",\n      \"testval2\": true\n    },\n    \"test1\": [1, 2, \"testval\"],\n    \"test2\": [{\"one\": \"foo\", \"two\": \"bar\", \"three\": \"testval\"}]\n  }\n}\"\"\")\n\ndef is_eq(key, val, opath, query):  # Use of a filter func is optional.\n    return val == query\n\n\nfor node in traverse(jo, is_eq, query=\"milk\"):\n    print(\"Found\", node.key, ':', node.value)  # baz : milk\n    print(\"Full path access:\", jo[node.path_str])  # \"2019.uat.mylist.1.baz\"\n```\n\nFor each iteration, traverse() returns a dict or data object of...\n\n```\n{'key', 'value', 'node_path', 'path_str', 'filter_func',\n'filter_args': (data, kwargs), 'parent_node', 'output_formatter'}\n```\n\nFor more information on these non-built-in data structure (Which are optional\nto use), check out [mo-dots](https://pypi.org/project/mo-dots/) and\n[dotty_dict](https://pypi.org/project/dotty-dict/).\n\n\n### Changelog\n\n- **11/15/2020 - 0.1.32** : Fix for pypi.\n\n- **11/15/2020 - 0.1.3** : Refactored \u0026 added more utility methods. Added docs.\n\n- **11/13/2020 - 0.1.2** : Doc correction.\n\n- **11/13/2020 - 0.1.1** : Deprecated `set_output_format()` and made package compatible with both Python 2 and Python 3.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbitnom%2Ftraversy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbitnom%2Ftraversy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbitnom%2Ftraversy/lists"}