# Buildsheet autogenerated by ravenadm tool -- Do not edit. NAMEBASE= python-jmespath VERSION= 1.0.1 KEYWORDS= python VARIANTS= v11 v12 SDESC[v11]= JSON Matching Expressions (3.11) SDESC[v12]= JSON Matching Expressions (3.12) HOMEPAGE= https://github.com/jmespath/jmespath.py CONTACT= Python_Automaton[python@ironwolf.systems] DOWNLOAD_GROUPS= main SITES[main]= PYPIWHL/31/b4/b9b800c45527aadd64d5b442f9b932b00648617eb5d63d2c7a6587b7cafc DISTFILE[1]= jmespath-1.0.1-py3-none-any.whl:main DF_INDEX= 1 SPKGS[v11]= single SPKGS[v12]= single OPTIONS_AVAILABLE= PY311 PY312 OPTIONS_STANDARD= none VOPTS[v11]= PY311=ON PY312=OFF VOPTS[v12]= PY311=OFF PY312=ON DISTNAME= jmespath-1.0.1.dist-info GENERATED= yes [PY311].USES_ON= python:v11,wheel [PY312].USES_ON= python:v12,wheel [FILE:2647:descriptions/desc.single] JMESPath ======== JMESPath (pronounced "james path") allows you to declaratively specify how to extract elements from a JSON document. For example, given this document:: {"foo": {"bar": "baz"}} The jmespath expression ``foo.bar`` will return "baz". JMESPath also supports: Referencing elements in a list. Given the data:: {"foo": {"bar": ["one", "two"]}} The expression: ``foo.bar[0]`` will return "one". You can also reference all the items in a list using the ``*`` syntax:: {"foo": {"bar": [{"name": "one"}, {"name": "two"}]}} The expression: ``foo.bar[*].name`` will return ["one", "two"]. Negative indexing is also supported (-1 refers to the last element in the list). Given the data above, the expression ``foo.bar[-1].name`` will return "two". The ``*`` can also be used for hash types:: {"foo": {"bar": {"name": "one"}, "baz": {"name": "two"}}} The expression: ``foo.*.name`` will return ["one", "two"]. Installation ============ You can install JMESPath from pypi with: .. code:: bash pip install jmespath API === The ``jmespath.py`` library has two functions that operate on python data structures. You can use search and give it the jmespath expression and the data: .. code:: python >>> import jmespath >>> path = jmespath.search('foo.bar', {'foo': {'bar': 'baz'}}) 'baz' Similar to the re module, you can use the compile function to compile the JMESPath expression and use this parsed expression to perform repeated searches: .. code:: python >>> import jmespath >>> expression = jmespath.compile('foo.bar') >>> expression.search({'foo': {'bar': 'baz'}}) 'baz' >>> expression.search({'foo': {'bar': 'other'}}) 'other' This is useful if you're going to use the same jmespath expression to search multiple documents. This avoids having to reparse the JMESPath expression each time you search a new document. Options ------- You can provide an instance of ``jmespath.Options`` to control how a JMESPath expression is evaluated. The most common scenario for using an Options instance is if you want to have ordered output of your dict keys. To do this you can use either of these options: .. code:: python >>> import jmespath >>> jmespath.search('{a: a, b: b}', ... mydata, ... jmespath.Options(dict_cls=collections.OrderedDict)) >>> import jmespath >>> parsed = jmespath.compile('{a: a, b: b}') >>> parsed.search(mydata, ... jmespath.Options(dict_cls=collections.OrderedDict)) Custom Functions ~~~~~~~~~~~~~~~~ The JMESPath language has numerous `built-in functions [FILE:110:distinfo] 02e2e4cc71b5bcab88332eebf907519190dd9e6e82107fa7f83b1003a6252980 20256 jmespath-1.0.1-py3-none-any.whl