Skip to content

masaccio/fractured-json-python

Repository files navigation

fractured-json

build: build: codecov

fractured-json is primarily a python wrapper of of FracturedJson by j-brooke.

There is a pure Python implementation of a JSON compactor called compact-json however this is unlikely to get maintenance beyond critical bugfixes.

Plans

THE PACKAGE IS CURRENTLY UNDER DEVELOPMENT

Feel free to join the discussion about the python wrapper. The goal of the python wrapper is to track the .NET core of the JSON formatter and provide all the features of the .NET version in python. The command-line capabilities of compact-json and the FracturedJson CLI are expected to merge.

The API naming style of the python implementation is deliberately different to the .NET core to be as pythonic as possible. Specifically:

  • All classes are Pascal case, e.g. FracturedJsonOptions
  • All properties are snake case, e.g. json_eol_style
  • All enumerations are upper-case snake case within a Python Object, e.g. EolStyle.CRLF. They are not derived from Enum but have the same behaviors.

Installation

You will need to install a .NET runtime that is compatible with Python.NET (pythonnet). The package honors the environment variable PYTHONNET_RUNTIME for selecting the runtime variant but defaults to coreclr. As of current testing, Python 3.14 and .NET 10.0 are not supported by pythonnet. You can download the Core .NET runtime from the Microsoft .NET website and version 8.0 is recommended as the stable and long-term supported version.

Once .NET is available, installation is simply:

python3 -m pip install fractured-json

License

All code in this repository is licensed under the MIT License

Contribute

Contributions are greatly appreciated and welcomed. Please follow the project guidance on how to contribute.

About

Python support for the FracturedJson JSON formatter

Resources

License

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages