Ravenports generated: 24 Nov 2022 04:04
[ravenports.git] / bucket_B7 / python-jmespath
1 # Buildsheet autogenerated by ravenadm tool -- Do not edit.
2
3 NAMEBASE=               python-jmespath
4 VERSION=                1.0.1
5 KEYWORDS=               python
6 VARIANTS=               py39 py310
7 SDESC[py310]=           JSON Matching Expressions (3.10)
8 SDESC[py39]=            JSON Matching Expressions (3.9)
9 HOMEPAGE=               https://github.com/jmespath/jmespath.py
10 CONTACT=                Python_Automaton[python@ironwolf.systems]
11
12 DOWNLOAD_GROUPS=        main
13 SITES[main]=            PYPIWHL/31/b4/b9b800c45527aadd64d5b442f9b932b00648617eb5d63d2c7a6587b7cafc
14 DISTFILE[1]=            jmespath-1.0.1-py3-none-any.whl:main
15 DF_INDEX=               1
16 SPKGS[py310]=           single
17 SPKGS[py39]=            single
18
19 OPTIONS_AVAILABLE=      PY39 PY310
20 OPTIONS_STANDARD=       none
21 VOPTS[py310]=           PY39=OFF PY310=ON
22 VOPTS[py39]=            PY39=ON PY310=OFF
23
24 DISTNAME=               jmespath-1.0.1.dist-info
25
26 GENERATED=              yes
27
28 [PY39].USES_ON=                         python:py39,wheel
29
30 [PY310].USES_ON=                        python:py310,wheel
31
32 [FILE:2647:descriptions/desc.single]
33 JMESPath
34 ========
35
36 JMESPath (pronounced "james path") allows you to declaratively specify how
37 to
38 extract elements from a JSON document.
39
40 For example, given this document::
41
42     {"foo": {"bar": "baz"}}
43
44 The jmespath expression ``foo.bar`` will return "baz".
45
46 JMESPath also supports:
47
48 Referencing elements in a list.  Given the data::
49
50     {"foo": {"bar": ["one", "two"]}}
51
52 The expression: ``foo.bar[0]`` will return "one".
53 You can also reference all the items in a list using the ``*``
54 syntax::
55
56    {"foo": {"bar": [{"name": "one"}, {"name": "two"}]}}
57
58 The expression: ``foo.bar[*].name`` will return ["one", "two"].
59 Negative indexing is also supported (-1 refers to the last element
60 in the list).  Given the data above, the expression
61 ``foo.bar[-1].name`` will return "two".
62
63 The ``*`` can also be used for hash types::
64
65    {"foo": {"bar": {"name": "one"}, "baz": {"name": "two"}}}
66
67 The expression: ``foo.*.name`` will return ["one", "two"].
68
69 Installation
70 ============
71
72 You can install JMESPath from pypi with:
73
74 .. code:: bash
75
76     pip install jmespath
77
78 API
79 ===
80
81 The ``jmespath.py`` library has two functions
82 that operate on python data structures.  You can use search
83 and give it the jmespath expression and the data:
84
85 .. code:: python
86
87     >>> import jmespath
88     >>> path = jmespath.search('foo.bar', {'foo': {'bar': 'baz'}})
89     'baz'
90
91 Similar to the re module, you can use the compile function
92 to compile the JMESPath expression and use this parsed expression
93 to perform repeated searches:
94
95 .. code:: python
96
97     >>> import jmespath
98     >>> expression = jmespath.compile('foo.bar')
99     >>> expression.search({'foo': {'bar': 'baz'}})
100     'baz'
101     >>> expression.search({'foo': {'bar': 'other'}})
102     'other'
103
104 This is useful if you're going to use the same jmespath expression to
105 search multiple documents.  This avoids having to reparse the
106 JMESPath expression each time you search a new document.
107
108 Options
109 -------
110
111 You can provide an instance of ``jmespath.Options`` to control how
112 a JMESPath expression is evaluated.  The most common scenario for
113 using an Options instance is if you want to have ordered output
114 of your dict keys.  To do this you can use either of these options:
115
116 .. code:: python
117
118     >>> import jmespath
119     >>> jmespath.search('{a: a, b: b}',
120     ...                 mydata,
121     ...                 jmespath.Options(dict_cls=collections.OrderedDict))
122
123     >>> import jmespath
124     >>> parsed = jmespath.compile('{a: a, b: b}')
125     >>> parsed.search(mydata,
126     ...               jmespath.Options(dict_cls=collections.OrderedDict))
127
128 Custom Functions
129 ~~~~~~~~~~~~~~~~
130
131 The JMESPath language has numerous
132 `built-in functions
133
134
135 [FILE:110:distinfo]
136 02e2e4cc71b5bcab88332eebf907519190dd9e6e82107fa7f83b1003a6252980        20256 jmespath-1.0.1-py3-none-any.whl
137