Port variant py39
Summary JSON Matching Expressions (3.9)
Package version 0.10.0
Keywords python
Maintainer Python Automaton
License Not yet specified
Other variants py310
Ravenports Buildsheet | History
Ravensource Port Directory | History
Last modified 20 NOV 2021, 04:14:38 UTC
Port created 28 SEP 2017, 20:31:25 UTC
Subpackage Descriptions
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 ```` will return "baz". JMESPath also supports: Referencing elements in a list. Given the data:: {"foo": {"bar": ["one", "two"]}} The expression: ``[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: ``[*].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 ``[-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 ```` 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 ='', {'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': 'baz'}}) 'baz' >>>{'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 >>>'{a: a, b: b}', ... mydata, ... jmespath.Options(dict_cls=collections.OrderedDict)) >>> import jmespath >>> parsed = jmespath.compile('{a: a, b: b}') >>>, ... jmespath.Options(dict_cls=collections.OrderedDict)) Custom Functions ~~~~~~~~~~~~~~~~ The JMESPath language has numerous `built-in functions
Configuration Switches (platform-specific settings discarded)
PY310 OFF Build using Python 3.10 PY39 ON Build using Python 3.9
Package Dependencies by Type
Build (only) python-pip:single:py39
Build and Runtime python39:single:standard
Download groups
main mirror://PYPIWHL/07/cb/5f001272b6faeb23c1c9e0acc04d48eaaf5c862c17709d20e3469c6e0139
Distribution File Information
cdf6525904cc597730141d61b36f2e4b8ecc257c420fa2f4549bac2c2d0cb72f 24489 jmespath-0.10.0-py2.py3-none-any.whl
Ports that require python-jmespath:py39
python-botocore:py39 Low-level, data-driven core of boto 3 (3.9)