Metadata-Version: 2.4
Name: jpath
Version: 1.6
Summary: Access nested dicts and lists using JSON-like path notation.
Download-URL: https://bitbucket.org/thesheep/jpath/get/tip.tar.gz
Author: Radomir Dopieralski
Author-email: jpath@sheep.art.pl
Classifier: Development Status :: 6 - Mature
Classifier: Programming Language :: Python :: 2
Classifier: Programming Language :: Python :: 3
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: Python Software Foundation License
Classifier: Operating System :: OS Independent
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Topic :: Text Processing
Classifier: License :: OSI Approved :: MIT License
Dynamic: author
Dynamic: author-email
Dynamic: classifier
Dynamic: description
Dynamic: download-url
Dynamic: summary


Access nested dicts and lists using JSON-like path notation.

Note that this code is written for python 3.

The notation is as follows:

    You can just write the names of components in your path like you
    would in javascript:

    foo.bar.baz

    To access arrays or names with spaces in them, use the '[]' notation.
    You can use negative indices with arrays to count from the end.

    ["foo"]["bar"]["baz"]
    array[-1].attr
    [3]

    You can use the wildcard character '*' to iterate over all elements:

    foo.*.baz
    ["foo"][*]["baz"]

    This may return more or less than a single element. Use get to get the
    first one, and get_all to get a list of all possibilities.
    If you want to skip any number of elements in path, use two dots '..':

    foo..baz

    You can slice the arrays just like in python:

    array[1:-1:2]

    Finally, you can filter the elements:

    foo(bar.baz=true)
    foo.bar(baz>0).baz
    foo(bar="yawn").bar

    At the moment only =, >, <, >=, <= and != operators are available,
    and you can only use them with strings, integers and boolean values.

This code was written in STX Next.
