python-jsonpath 1.2.0__tar.gz → 1.2.2__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (35) hide show
  1. {python_jsonpath-1.2.0 → python_jsonpath-1.2.2}/PKG-INFO +7 -8
  2. {python_jsonpath-1.2.0 → python_jsonpath-1.2.2}/README.md +2 -2
  3. {python_jsonpath-1.2.0 → python_jsonpath-1.2.2}/jsonpath/__about__.py +1 -1
  4. {python_jsonpath-1.2.0 → python_jsonpath-1.2.2}/jsonpath/filter.py +1 -2
  5. {python_jsonpath-1.2.0 → python_jsonpath-1.2.2}/jsonpath/lex.py +12 -12
  6. {python_jsonpath-1.2.0 → python_jsonpath-1.2.2}/pyproject.toml +4 -4
  7. {python_jsonpath-1.2.0 → python_jsonpath-1.2.2}/.gitignore +0 -0
  8. {python_jsonpath-1.2.0 → python_jsonpath-1.2.2}/LICENSE.txt +0 -0
  9. {python_jsonpath-1.2.0 → python_jsonpath-1.2.2}/jsonpath/__init__.py +0 -0
  10. {python_jsonpath-1.2.0 → python_jsonpath-1.2.2}/jsonpath/__main__.py +0 -0
  11. {python_jsonpath-1.2.0 → python_jsonpath-1.2.2}/jsonpath/_data.py +0 -0
  12. {python_jsonpath-1.2.0 → python_jsonpath-1.2.2}/jsonpath/cli.py +0 -0
  13. {python_jsonpath-1.2.0 → python_jsonpath-1.2.2}/jsonpath/env.py +0 -0
  14. {python_jsonpath-1.2.0 → python_jsonpath-1.2.2}/jsonpath/exceptions.py +0 -0
  15. {python_jsonpath-1.2.0 → python_jsonpath-1.2.2}/jsonpath/fluent_api.py +0 -0
  16. {python_jsonpath-1.2.0 → python_jsonpath-1.2.2}/jsonpath/function_extensions/__init__.py +0 -0
  17. {python_jsonpath-1.2.0 → python_jsonpath-1.2.2}/jsonpath/function_extensions/arguments.py +0 -0
  18. {python_jsonpath-1.2.0 → python_jsonpath-1.2.2}/jsonpath/function_extensions/count.py +0 -0
  19. {python_jsonpath-1.2.0 → python_jsonpath-1.2.2}/jsonpath/function_extensions/filter_function.py +0 -0
  20. {python_jsonpath-1.2.0 → python_jsonpath-1.2.2}/jsonpath/function_extensions/is_instance.py +0 -0
  21. {python_jsonpath-1.2.0 → python_jsonpath-1.2.2}/jsonpath/function_extensions/keys.py +0 -0
  22. {python_jsonpath-1.2.0 → python_jsonpath-1.2.2}/jsonpath/function_extensions/length.py +0 -0
  23. {python_jsonpath-1.2.0 → python_jsonpath-1.2.2}/jsonpath/function_extensions/match.py +0 -0
  24. {python_jsonpath-1.2.0 → python_jsonpath-1.2.2}/jsonpath/function_extensions/search.py +0 -0
  25. {python_jsonpath-1.2.0 → python_jsonpath-1.2.2}/jsonpath/function_extensions/typeof.py +0 -0
  26. {python_jsonpath-1.2.0 → python_jsonpath-1.2.2}/jsonpath/function_extensions/value.py +0 -0
  27. {python_jsonpath-1.2.0 → python_jsonpath-1.2.2}/jsonpath/match.py +0 -0
  28. {python_jsonpath-1.2.0 → python_jsonpath-1.2.2}/jsonpath/parse.py +0 -0
  29. {python_jsonpath-1.2.0 → python_jsonpath-1.2.2}/jsonpath/patch.py +0 -0
  30. {python_jsonpath-1.2.0 → python_jsonpath-1.2.2}/jsonpath/path.py +0 -0
  31. {python_jsonpath-1.2.0 → python_jsonpath-1.2.2}/jsonpath/pointer.py +0 -0
  32. {python_jsonpath-1.2.0 → python_jsonpath-1.2.2}/jsonpath/py.typed +0 -0
  33. {python_jsonpath-1.2.0 → python_jsonpath-1.2.2}/jsonpath/selectors.py +0 -0
  34. {python_jsonpath-1.2.0 → python_jsonpath-1.2.2}/jsonpath/stream.py +0 -0
  35. {python_jsonpath-1.2.0 → python_jsonpath-1.2.2}/jsonpath/token.py +0 -0
@@ -1,26 +1,25 @@
1
- Metadata-Version: 2.1
1
+ Metadata-Version: 2.3
2
2
  Name: python-jsonpath
3
- Version: 1.2.0
3
+ Version: 1.2.2
4
4
  Summary: JSONPath, JSON Pointer and JSON Patch for Python.
5
5
  Project-URL: Documentation, https://jg-rp.github.io/python-jsonpath/
6
6
  Project-URL: Issues, https://github.com/jg-rp/python-jsonpath/issues
7
7
  Project-URL: Source, https://github.com/jg-rp/python-jsonpath
8
8
  Author-email: James Prior <jamesgr.prior@gmail.com>
9
- License-Expression: MIT
10
- License-File: LICENSE.txt
9
+ License: MIT
11
10
  Classifier: Development Status :: 5 - Production/Stable
12
11
  Classifier: Intended Audience :: Developers
13
12
  Classifier: License :: OSI Approved :: MIT License
14
13
  Classifier: Programming Language :: Python
15
- Classifier: Programming Language :: Python :: 3.7
16
14
  Classifier: Programming Language :: Python :: 3.8
17
15
  Classifier: Programming Language :: Python :: 3.9
18
16
  Classifier: Programming Language :: Python :: 3.10
19
17
  Classifier: Programming Language :: Python :: 3.11
20
18
  Classifier: Programming Language :: Python :: 3.12
19
+ Classifier: Programming Language :: Python :: 3.13
21
20
  Classifier: Programming Language :: Python :: Implementation :: CPython
22
21
  Classifier: Programming Language :: Python :: Implementation :: PyPy
23
- Requires-Python: >=3.7
22
+ Requires-Python: >=3.8
24
23
  Description-Content-Type: text/markdown
25
24
 
26
25
  <h1 align="center">Python JSONPath</h1>
@@ -91,9 +90,9 @@ conda install -c conda-forge python-jsonpath
91
90
 
92
91
  ## Related projects
93
92
 
94
- - [Python JSONPath RFC 9535](https://github.com/jg-rp/python-jsonpath-rfc9535) - An implementation of JSONPath that follows RFC 9535 much more strictly. If you require maximum interoperability with JSONPath implemented in other languages - at the expense of extra features - choose python-jsonpath-rfc9535 over python-jsonpath.
93
+ - [JSONPath RFC 9535](https://github.com/jg-rp/python-jsonpath-rfc9535) - A Python implementation of JSONPath that follows RFC 9535 much more strictly. If you require maximum interoperability with JSONPath implemented in other languages - at the expense of extra features - choose [jsonpath-rfc9535](https://pypi.org/project/jsonpath-rfc9535/) over [python-jsonpath](https://pypi.org/project/python-jsonpath/).
95
94
 
96
- python-jsonpath-rfc9535 matches RFC 9535's JSONPath model internally and is careful to match the spec's terminology. It also includes utilities for verifying and testing the [JSONPath Compliance Test Suite](https://github.com/jsonpath-standard/jsonpath-compliance-test-suite). Most notably the nondeterministic behavior of some JSONPath selectors.
95
+ jsonpath-rfc9535 matches RFC 9535's JSONPath model internally and is careful to use the spec's terminology. It also includes utilities for verifying and testing the [JSONPath Compliance Test Suite](https://github.com/jsonpath-standard/jsonpath-compliance-test-suite). Most notably the nondeterministic behavior of some JSONPath selectors.
97
96
 
98
97
  - [JSON P3](https://github.com/jg-rp/json-p3) - RFC 9535 implemented in TypeScript. JSON P3 does not include all the non-standard features of Python JSONPath, but does define some optional [extra syntax](https://jg-rp.github.io/json-p3/guides/jsonpath-extra).
99
98
 
@@ -66,9 +66,9 @@ conda install -c conda-forge python-jsonpath
66
66
 
67
67
  ## Related projects
68
68
 
69
- - [Python JSONPath RFC 9535](https://github.com/jg-rp/python-jsonpath-rfc9535) - An implementation of JSONPath that follows RFC 9535 much more strictly. If you require maximum interoperability with JSONPath implemented in other languages - at the expense of extra features - choose python-jsonpath-rfc9535 over python-jsonpath.
69
+ - [JSONPath RFC 9535](https://github.com/jg-rp/python-jsonpath-rfc9535) - A Python implementation of JSONPath that follows RFC 9535 much more strictly. If you require maximum interoperability with JSONPath implemented in other languages - at the expense of extra features - choose [jsonpath-rfc9535](https://pypi.org/project/jsonpath-rfc9535/) over [python-jsonpath](https://pypi.org/project/python-jsonpath/).
70
70
 
71
- python-jsonpath-rfc9535 matches RFC 9535's JSONPath model internally and is careful to match the spec's terminology. It also includes utilities for verifying and testing the [JSONPath Compliance Test Suite](https://github.com/jsonpath-standard/jsonpath-compliance-test-suite). Most notably the nondeterministic behavior of some JSONPath selectors.
71
+ jsonpath-rfc9535 matches RFC 9535's JSONPath model internally and is careful to use the spec's terminology. It also includes utilities for verifying and testing the [JSONPath Compliance Test Suite](https://github.com/jsonpath-standard/jsonpath-compliance-test-suite). Most notably the nondeterministic behavior of some JSONPath selectors.
72
72
 
73
73
  - [JSON P3](https://github.com/jg-rp/json-p3) - RFC 9535 implemented in TypeScript. JSON P3 does not include all the non-standard features of Python JSONPath, but does define some optional [extra syntax](https://jg-rp.github.io/json-p3/guides/jsonpath-extra).
74
74
 
@@ -1,4 +1,4 @@
1
1
  # SPDX-FileCopyrightText: 2023-present James Prior <jamesgr.prior@gmail.com>
2
2
  #
3
3
  # SPDX-License-Identifier: MIT
4
- __version__ = "1.2.0"
4
+ __version__ = "1.2.2"
@@ -243,8 +243,7 @@ class RegexLiteral(Literal[Pattern[str]]):
243
243
  if self.value.flags & flag:
244
244
  flags.append(ch)
245
245
 
246
- pattern = re.sub(r"\\(.)", r"\1", self.value.pattern)
247
- return f"/{pattern}/{''.join(flags)}"
246
+ return f"/{self.value.pattern}/{''.join(flags)}"
248
247
 
249
248
 
250
249
  class ListLiteral(FilterExpression):
@@ -88,13 +88,13 @@ class Lexer:
88
88
  key_pattern = r"[\u0080-\uFFFFa-zA-Z_][\u0080-\uFFFFa-zA-Z0-9_-]*"
89
89
 
90
90
  # `not` or !
91
- logical_not_pattern = r"(?:not|!)"
91
+ logical_not_pattern = r"(?:not\b)|!"
92
92
 
93
93
  # && or `and`
94
- logical_and_pattern = r"(?:&&|and)"
94
+ logical_and_pattern = r"&&|(?:and\b)"
95
95
 
96
96
  # || or `or`
97
- logical_or_pattern = r"(?:\|\||or)"
97
+ logical_or_pattern = r"\|\||(?:or\b)"
98
98
 
99
99
  def __init__(self, *, env: JSONPathEnvironment) -> None:
100
100
  self.env = env
@@ -153,15 +153,15 @@ class Lexer:
153
153
  ],
154
154
  (TOKEN_WILD, r"\*"),
155
155
  (TOKEN_FILTER, r"\?"),
156
- (TOKEN_IN, r"in"),
157
- (TOKEN_TRUE, r"[Tt]rue"),
158
- (TOKEN_FALSE, r"[Ff]alse"),
159
- (TOKEN_NIL, r"[Nn]il"),
160
- (TOKEN_NULL, r"[Nn]ull"),
161
- (TOKEN_NONE, r"[Nn]one"),
162
- (TOKEN_CONTAINS, r"contains"),
163
- (TOKEN_UNDEFINED, r"undefined"),
164
- (TOKEN_MISSING, r"missing"),
156
+ (TOKEN_IN, r"in\b"),
157
+ (TOKEN_TRUE, r"[Tt]rue\b"),
158
+ (TOKEN_FALSE, r"[Ff]alse\b"),
159
+ (TOKEN_NIL, r"[Nn]il\b"),
160
+ (TOKEN_NULL, r"[Nn]ull\b"),
161
+ (TOKEN_NONE, r"[Nn]one\b"),
162
+ (TOKEN_CONTAINS, r"contains\b"),
163
+ (TOKEN_UNDEFINED, r"undefined\b"),
164
+ (TOKEN_MISSING, r"missing\b"),
165
165
  (TOKEN_LIST_START, r"\["),
166
166
  (TOKEN_RBRACKET, r"]"),
167
167
  (TOKEN_COMMA, r","),
@@ -6,7 +6,7 @@ build-backend = "hatchling.build"
6
6
  name = "python-jsonpath"
7
7
  description = 'JSONPath, JSON Pointer and JSON Patch for Python.'
8
8
  readme = "README.md"
9
- requires-python = ">=3.7"
9
+ requires-python = ">=3.8"
10
10
  license = "MIT"
11
11
  keywords = []
12
12
  authors = [{ name = "James Prior", email = "jamesgr.prior@gmail.com" }]
@@ -15,12 +15,12 @@ classifiers = [
15
15
  "Intended Audience :: Developers",
16
16
  "License :: OSI Approved :: MIT License",
17
17
  "Programming Language :: Python",
18
- "Programming Language :: Python :: 3.7",
19
18
  "Programming Language :: Python :: 3.8",
20
19
  "Programming Language :: Python :: 3.9",
21
20
  "Programming Language :: Python :: 3.10",
22
21
  "Programming Language :: Python :: 3.11",
23
22
  "Programming Language :: Python :: 3.12",
23
+ "Programming Language :: Python :: 3.13",
24
24
  "Programming Language :: Python :: Implementation :: CPython",
25
25
  "Programming Language :: Python :: Implementation :: PyPy",
26
26
  ]
@@ -66,7 +66,7 @@ lint = "ruff check ."
66
66
  typing = "mypy"
67
67
 
68
68
  [[tool.hatch.envs.test.matrix]]
69
- python = ["37", "38", "39", "310", "311", "312", "pypy38", "pypy39"]
69
+ python = ["38", "39", "310", "311", "312", "pypy38", "pypy39"]
70
70
 
71
71
  [tool.hatch.envs.test.scripts]
72
72
  test = "pytest {args}"
@@ -167,7 +167,7 @@ select = [
167
167
  "YTT",
168
168
  ]
169
169
 
170
- ignore = ["S105", "S101", "D107", "D105", "PLR0913", "SIM108"]
170
+ ignore = ["S105", "S101", "D107", "D105", "PLR0913", "SIM108", "PT001"]
171
171
 
172
172
  fixable = ["I"]
173
173
  unfixable = []