1- Python JSONPath RW
2- ==================
1+ Python JSONPath Next-Generation
2+ ===============================
33
4- https://github.com/kennknowles/python-jsonpath-rw
5-
6- |Build Status | |Test coverage | |PyPi version | |PyPi downloads |
4+ A final implementation of JSONPath for Python, including arithmetic
5+ and binary comparison operators, as defined in the original `JSONPath proposal `_.
76
87This library provides a robust and significantly extended implementation
9- of JSONPath for Python. It is tested with Python 2.6, 2.7, 3.2, 3.3.
10- *(On travis-ci there is a segfault when running the tests with pypy; I don't think the problem lies with this library) *.
8+ of JSONPath for Python. It is tested with Python 2.6, 2.7, 3.2, 3.3.
119
1210This library differs from other JSONPath implementations in that it is a
1311full *language * implementation, meaning the JSONPath expressions are
1412first class objects, easy to analyze, transform, parse, print, and
15- extend. (You can also execute them :-)
13+ extend.
1614
1715Quick Start
1816-----------
@@ -21,15 +19,15 @@ To install, use pip:
2119
2220::
2321
24- $ pip install git+git://github.com/tomas-fp/python-jsonpath-rw .git#egg=jsonpath-rw
22+ $ pip install git+git://github.com/tomas-fp/python-jsonpath-ng .git#egg=jsonpath-ng
2523
2624Then:
2725
2826.. code :: python
2927
3028 $ python
3129
32- >> > from jsonpath_rw import jsonpath, parse
30+ >> > from jsonpath_ng import jsonpath, parse
3331
3432 # A robust parser, not just a regex. (Makes powerful extensions possible; see below)
3533 >> > jsonpath_expr = parse(' foo[*].baz' )
@@ -51,12 +49,13 @@ Then:
5149 >> > [match.value for match in parse(' a.*.b.`parent`.c' ).find({' a' : {' x' : {' b' : 1 , ' c' : ' number one' }, ' y' : {' b' : 2 , ' c' : ' number two' }}})]
5250 [' number two' , ' number one' ]
5351
54- # You can also build expressions directly quite easily
55- >> > from jsonpath_rw .jsonpath import Fields
56- >> > from jsonpath_rw .jsonpath import Slice
52+ # You can also build expressions directly quite easily
53+ >> > from jsonpath_ng .jsonpath import Fields
54+ >> > from jsonpath_ng .jsonpath import Slice
5755
5856 >> > jsonpath_expr_direct = Fields(' foo' ).child(Slice(' *' )).child(Fields(' baz' )) # This is equivalent
5957
58+
6059 JSONPath Syntax
6160---------------
6261
@@ -151,7 +150,7 @@ Extensions
151150- *Path data *: The result of ``JsonPath.find `` provide detailed context
152151 and path data so it is easy to traverse to parent objects, print full
153152 paths to pieces of data, and generate automatic ids.
154- - *Automatic Ids *: If you set ``jsonpath_rw .auto_id_field `` to a value
153+ - *Automatic Ids *: If you set ``jsonpath_ng .auto_id_field `` to a value
155154 other than None, then for any piece of data missing that field, it
156155 will be replaced by the JSONPath to it, giving automatic unique ids
157156 to any piece of data. These ids will take into account any ids
@@ -164,7 +163,7 @@ Extensions
164163More to explore
165164---------------
166165
167- There are way too many jsonpath implementations out there to discuss.
166+ There are way too many JSONPath implementations out there to discuss.
168167Some are robust, some are toy projects that still work fine, some are
169168exercises. There will undoubtedly be many more. This one is made for use
170169in released, maintained code, and in particular for programmatic access
@@ -205,13 +204,13 @@ This package is authored and maintained by:
205204
206205- `Kenn Knowles <https://github.com/kennknowles >`__
207206 (`@kennknowles <https://twitter.com/KennKnowles >`__)
208-
209- with the help of patches submitted by `these contributors <https://github.com/kennknowles/python-jsonpath-rw /graphs/contributors >`__.
207+
208+ with the help of patches submitted by `these contributors <https://github.com/kennknowles/python-jsonpath-ng /graphs/contributors >`__.
210209
211210Copyright and License
212211---------------------
213212
214- Copyright 2013- Kenneth Knowles
213+ Copyright 2013 - Kenneth Knowles
215214
216215Licensed under the Apache License, Version 2.0 (the "License"); you may
217216not use this file except in compliance with the License. You may obtain
@@ -227,11 +226,12 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
227226See the License for the specific language governing permissions and
228227limitations under the License.
229228
230- .. |Build Status | image :: https://travis-ci.org/kennknowles/python-jsonpath-rw.png?branch=master
231- :target: https://travis-ci.org/kennknowles/python-jsonpath-rw
232- .. |Test coverage | image :: https://coveralls.io/repos/kennknowles/python-jsonpath-rw/badge.png?branch=master
233- :target: https://coveralls.io/r/kennknowles/python-jsonpath-rw
234- .. |PyPi version | image :: https://pypip.in/v/jsonpath-rw/badge.png
235- :target: https://pypi.python.org/pypi/jsonpath-rw
236- .. |PyPi downloads | image :: https://pypip.in/d/jsonpath-rw/badge.png
237- :target: https://pypi.python.org/pypi/jsonpath-rw
229+ .. _`JSONPath proposal` : http://goessner.net/articles/JsonPath/
230+ .. |Build Status | image :: https://travis-ci.org/kennknowles/python-jsonpath-ng.png?branch=master
231+ :target: https://travis-ci.org/kennknowles/python-jsonpath-ng
232+ .. |Test coverage | image :: https://coveralls.io/repos/kennknowles/python-jsonpath-ng/badge.png?branch=master
233+ :target: https://coveralls.io/r/kennknowles/python-jsonpath-ng
234+ .. |PyPi version | image :: https://pypip.in/v/jsonpath-ng/badge.png
235+ :target: https://pypi.python.org/pypi/jsonpath-ng
236+ .. |PyPi downloads | image :: https://pypip.in/d/jsonpath-ng/badge.png
237+ :target: https://pypi.python.org/pypi/jsonpath-ng
0 commit comments