Skip to content

piotrklibert/dquery

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 

Repository files navigation

dQuery: XPath for querying nested data for Python

Uses funcy and pyparsing as dependencies.

There are some examples in dpath/tests.py

API is very fluid right now, but the general idea is like this:

data = [
    {"a": [3, 4, 5, {"z": 10}], "z": "zz"},
    {"b": "uj", "a": {"z": "az"}, "z": "zz"},
    ["argh", "asssert", "so", "on"],
]

assert query(data, "**/z") == ['zz', 10, 'zz', 'az']

About

XPath like notation for querying JSON (nested dicts and lists) data

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages