unstale

pypi / python-jsonpath

python-jsonpath

What changed in python-jsonpath 1 to 2, from its official release notes, upgrade guides and advisories. Sources checked 2026-11-15.

12 breaking13 new APIs and options2 behavior and defaults5 fixes and other

See which of these apply to your code, ranked, in your agent:

npx @unstale/cli init

@unstale/cli 0.3.1 on npm

python-jsonpath 228 changes

Breaking changes 11

  • Copy targets now use add semantics, allowing the special - index to append and raising JSONPatchError when the target index exceeds the array length.

    2.2.2release notes

  • Move targets now use add semantics, allowing the special - index to append and raising JSONPatchError when the target index exceeds the array length.

    2.2.2release notes

  • Move operations with immutable Mapping or Sequence source objects now raise JSONPatchError instead of silently behaving as copies.

    2.2.2release notes

  • Unquoted property names in brackets are now singular query selectors rather than quoted names.

    2.0.0release notes

  • Whitespace is no longer allowed between . or .. and the following name.

    2.0.0release notes

  • Float literals must follow RFC syntax; .1 and 1. are invalid.

    2.0.0release notes

  • Tokens produced by the lexer changed, affecting projects that customize the JSONPath lexer or parser.

    2.0.0release notes

  • The simple Python function implementation was replaced by the Keys class.

    2.0.0release notes

  • The class variable was renamed to JSONPathEnvironment.pseudo_root_token.

    2.0.0release notes

  • Renames the fake_root_token class variable to pseudo_root_token.

    2.0.0release notes

  • Indexes and steps reject leading zeros and negative zero with JSONPathSyntaxError.

    2.0.0release notes

New APIs and options 11

  • Added a non-mutating form of JSONPatch application that deep-copies the input data and returns the patched copy.

    2.2.0release notes

  • Adds an atomic patch operation that preserves input data if a patch operation fails.

    2.1.0release notes

  • The non-standard keys() function extension is now implemented as a well-typed class instead of a simple Python function.

    2.0.0release notes

  • The constructor now accepts cache_capacity.

    2.0.0release notes

  • The constructor now accepts debug.

    2.0.0release notes

  • The constructor now accepts thread_safe.

    2.0.0release notes

  • Adds a class variable to control the maximum recursion depth of descendant segments.

    2.0.0release notes

  • Adds the Keys filter selector.

    2.0.0release notes

  • Adds the Singular query selector.

    2.0.0release notes

  • Adds a function extension that returns True when both arguments are strings and prefix is a prefix of value.

    2.0.0release notes

  • Adds a strict argument to convenience functions and the JSONPathEnvironment constructor, and to the CLI; when true, non-standard extensions and relaxed parsing rules are disabled.

    2.0.0release notes

Behavior and default changes 2

  • Exception messages are improved to be prettier and more informative.

    2.0.0release notes

  • Match and search function extensions use the regex package instead of re when it is installed.

    2.0.0release notes

Fixes and other changes 4

  • Parser recursion limit failures raise JSONPathRecursionError, preserving the original RecursionError as the cause; the error subclasses RecursionError so existing handlers continue working.

    2.2.1release notes

  • Fixed atomic JSONPatch application when a patch operation replaces the document root.

    2.2.0release notes

  • Fixed tokenization of quoted name selectors ending in an escaped backslash, allowing selectors and normalized paths for keys containing backslashes to be parsed correctly.

    2.2.0release notes

  • Parsing now handles non-standard JSONPath regular expression literals containing an escaped solidus when using the =~ operator.

    2.0.2release notes

python-jsonpath 14 changes

Breaking changes 1

  • The undocumented keys function extension is no longer enabled by default; a new, well-typed keys function is planned for the future.

    1.0.0release notes

New APIs and options 2

  • Non-standard environment-controlled tokens can be disabled by setting them to the empty string.

    1.0.0release notes

  • Adds a non-standard identifier, defaulting to ^ and customizable with fake_root_token on a JSONPathEnvironment subclass; it wraps the target JSON value in an array so the root value can be conditionally selected using a filter.

    1.0.0release notes

Fixes and other changes 1

  • Environment-controlled tokens are sorted by length in descending order, allowing one custom token to be a prefix of another.

    1.0.0release notes