Skip to content

Version 0.8.0

Choose a tag to compare

@jg-rp jg-rp released this 30 Jun 06:34
· 232 commits to main since this release

Breaking changes

  • Changed the JSONPathMatch.parts representation of the non-standard keys selector (default ~) to be ~ followed by the key name. It used to be two "parts", ~ and key index.
  • All FilterExpression subclasses must now implement children() and set_children(). These methods facilitate filter expression inspection and caching.

Fixes

  • Changed findall() and finditer() to accept data arguments of any io.IOBase subclass, not just TextIO.

Features

  • Added the JSONPointer class and methods for converting a JSONPathMatch to a JSONPointer. JSONPointer is compliant with RFC 6901 (docs).
  • Added the JSONPatch class. JSONPatch implements RFC 6902 (docs).
  • Added jsonpath.pointer.resolve(), a convenience function for resolving a JSON Pointer (docs).
  • Added jsonpath.patch.apply(), a convenience function for applying a JSON Patch (docs).
  • Added jsonpath.match(), a convenience function returning a JSONPathMatch instance for the first match of a path, or None if there were no matches (docs).
  • Added filter expression caching. Controlled with the filter_caching argument to JSONPathEnvironment, filter expression caching is enabled by default. See [#14]
  • All selectors now use env.match_class to instantiate new JSONPathMatch objects. This allows for subclassing of JSONPathMatch.
  • Added jsonpath.filter.walk() for the benefit of filter expression static analysis.