Skip to content

angela-tarantula/jsonpatchx

JsonPatchX

Tests Codecov OpenSSF Scorecard Contributor Covenant

About The Project

JsonPatchX is a typed JSON Patch toolkit for building governed PATCH APIs in Python.

It scales from simple patching to highly controlled API contracts:

  • Plain JSON patching
  • FastAPI PATCH endpoints
  • Expressive, governed PATCH APIs with typed pointers, custom operations, route allow-lists, JSONPath pointers, and more.

Getting Started

Install from PyPI:

Installation

pip install jsonpatchx[fastapi]

Usage

Basic patch application:

from jsonpatchx import JsonPatch

doc = {"name": "Ada", "roles": ["engineer"]}

patch = JsonPatch.from_string(
    """
    [
      {"op": "replace", "path": "/name", "value": "Ada Lovelace"},
      {"op": "add", "path": "/roles/-", "value": "maintainer"}
    ]
    """
)

updated = patch.apply(doc)

For practical end-to-end examples:

Roadmap

See the open issues for a list of proposed features (and known issues).

Contributing

Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated. For detailed contributing guidelines, please see CONTRIBUTING.md

License

Distributed under the MIT License. See LICENSE for more information.

Contact

Anglea Liss - chamsester@gmail.com

Project Link: https://github.com/angela-tarantula/jsonpatchx

Acknowledgements

Thanks to these foundational projects:

And to these excellent alternatives:

About

A PATCH framework for Python.

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages