{"id":15921596,"url":"https://github.com/devforfu/needle","last_synced_at":"2025-04-03T12:21:33.647Z","repository":{"id":186535994,"uuid":"606236064","full_name":"devforfu/needle","owner":"devforfu","description":"A package helping to navigate nested structures easily","archived":false,"fork":false,"pushed_at":"2023-03-13T22:02:09.000Z","size":817,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-09T04:18:20.394Z","etag":null,"topics":["cli","debugging","python","rich","utils"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/devforfu.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2023-02-24T23:01:03.000Z","updated_at":"2025-02-06T08:24:45.000Z","dependencies_parsed_at":null,"dependency_job_id":"efdb74cb-b6e6-42b4-827b-6810aac4ee07","html_url":"https://github.com/devforfu/needle","commit_stats":null,"previous_names":["devforfu/needle"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devforfu%2Fneedle","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devforfu%2Fneedle/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devforfu%2Fneedle/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devforfu%2Fneedle/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/devforfu","download_url":"https://codeload.github.com/devforfu/needle/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246998367,"owners_count":20866724,"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":["cli","debugging","python","rich","utils"],"created_at":"2024-10-06T20:01:24.958Z","updated_at":"2025-04-03T12:21:33.629Z","avatar_url":"https://github.com/devforfu.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Needle\n\nNavigating nested structures easily.\n\n## Description\n\nThe idea behind this package is to provide a simple interface allowing to \"flatten\" nested structures into \na plain table where each key is represented as a fully qualified name that leads to a certain field in the\nstructure. It is especially useful when dealing with complex configuration objects that are merged into one\nfrom several files or container, and include very long keys that aren't easily visualized via pretty printing.\n\n## Functionality\n\nThe package's goal is to provide a simple interface for navigating configurations right in the terminal while\ndebugging an executed script. It provides two basic high-level functions:\n\n```python\nfrom needle import search, view\n\nobj = { ... }  # some nested object\n\n# parsing keys (with optional depth limitation)\ns = search(obj, max_depth=3)  \n\nprint(s.top.flat_keys)   # all keys available on the topmost level\ns.subsearch(\"dataset\")   # navigating to the \"dataset\" subsection\nprint(s.top.flat_keys)   # now, the \"dataset\" subsection is on the top of the stack\n\nview(obj)                # starts an interactive mode as showed below \n```\n\n## Showcase\n\n![](https://raw.githubusercontent.com/devforfu/needle/main/docs/quick_example.gif)\n\n## Why?\n\nThe author of this package encountered a problem of navigating a deeply nested objects often enough to bother\nwriting a dedicated package that (in his opinion) should simplify that endeavor.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdevforfu%2Fneedle","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdevforfu%2Fneedle","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdevforfu%2Fneedle/lists"}