python3-jsonpath-ng: update to 1.8.0
authorAlexandru Ardelean <redacted>
Thu, 9 Apr 2026 05:32:54 +0000 (08:32 +0300)
committerAlexandru Ardelean <redacted>
Fri, 10 Apr 2026 11:00:41 +0000 (14:00 +0300)
Update package to 1.8.0.

Changes since 1.5.3:

1.6.0: Removed Python 2 and six dependency; field names with literals
now enclosed in quotes; removed decorator and testscenarios dependencies;
made path instances hashable.

1.6.1: Fixed lambda-based updates; fixed assignment when root element is
a list; added keys keyword; added slice step support; don't fail on regex
match against non-strings; Python 3.12 support.

1.7.0: Added wherenot operator; added path extension exposing datum's
path from the expression itself; allowed numeric values as keys; added
negative and wildcard indices in Split; fixed boolean value update bug;
removed Python 3.7 support; parse table constructed only once
(performance improvement).

1.8.0: Added support for comma-separated indices (e.g., field[0,1,2]);
added EMOJI and CJK Unicode support; added type hints; fixed wildcard
path resolution in field filters; fixed False/None value handling in
bool filters; vendored ply (no longer maintained upstream); dropped
Python 3.8 and 3.9 support; Python 3.13/3.14 tested.

Signed-off-by: Alexandru Ardelean <redacted>
lang/python/python-jsonpath-ng/Makefile
lang/python/python-jsonpath-ng/test.sh [new file with mode: 0755]

index e3b0669bcf959ca27143a14e92dfd66205d70f7f..062204b407accb8ff3c9e19a654674c0241b899a 100644 (file)
@@ -5,12 +5,13 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=python-jsonpath-ng
-PKG_VERSION:=1.5.3
+PKG_VERSION:=1.8.0
 PKG_RELEASE:=1
 PKG_MAINTAINER:=Josef Schlehofer <pepe.schlehofer@gmail.com> 
 
 PYPI_NAME:=jsonpath-ng
-PKG_HASH:=a273b182a82c1256daab86a313b937059261b5c5f8c4fa3fc38b882b344dd567
+PYPI_SOURCE_NAME:=jsonpath_ng
+PKG_HASH:=54252968134b5e549ea5b872f1df1168bd7defe1a52fed5a358c194e1943ddc3
 
 PKG_LICENSE:=Apache-2.0
 PKG_LICENSE_FILES:=LICENSE
diff --git a/lang/python/python-jsonpath-ng/test.sh b/lang/python/python-jsonpath-ng/test.sh
new file mode 100755 (executable)
index 0000000..eac7624
--- /dev/null
@@ -0,0 +1,32 @@
+#!/bin/sh
+
+[ "$1" = python3-jsonpath-ng ] || exit 0
+
+python3 - << 'EOF'
+from jsonpath_ng import parse
+from jsonpath_ng.ext import parse as ext_parse
+
+data = {
+    "store": {
+        "books": [
+            {"title": "A", "price": 10},
+            {"title": "B", "price": 20},
+            {"title": "C", "price": 15},
+        ]
+    }
+}
+
+# Basic path
+expr = parse("store.books[*].title")
+matches = [m.value for m in expr.find(data)]
+assert matches == ["A", "B", "C"], f"Unexpected: {matches}"
+
+# Indexed access
+expr2 = parse("store.books[1].price")
+assert expr2.find(data)[0].value == 20
+
+# Filter expression (ext parser)
+expr3 = ext_parse("store.books[?price > 12].title")
+titles = [m.value for m in expr3.find(data)]
+assert set(titles) == {"B", "C"}, f"Unexpected: {titles}"
+EOF
git clone https://git.99rst.org/PROJECT