Skip to content

Amsterdam/pydantic-jsonlogic

Pydantic JSONLogic

This package provides pydantic models that allow validation of JSONLogic.
It does not provide a means to execute/evaluate any JSONLogic.

An example of how this could be useful would be an API that accepts JSONLogic, the models provided by this package could then be used to generate API docs and/or to generate an API client.

Current state

In its current state it supports all the test cases that were available at the time of writing on https://jsonlogic.com/tests.json however those cases are limited and only cover a small portion of what is possible.

Over time the models will improve and will maybe someday be completely compliant. The best way to achieve this is of course to add any failing, but valid JSONLogic, to the test cases.

Feel free to contribute in any way you can.

Developing

Getting the project up and running can be achieved without much effort using Docker Compose. Doing so ensures that there should be very little difference in environment between all of us devs.

Starting the project

docker compose build
docker compose run --rm pydantic-jsonlogic sh

The last command gives you a shell within the container.

Dependency management

We shouldn't have any other dependencies other than python and pydantic.

However, we do have some dev dependencies like:

  • black
  • mypy
  • isort
  • pytest

We will do our best to keep those up to date. Should you want to upgrade them yourself, please do it from the shell inside the container using:

poetry update

Similarly, installing new dependencies is possible using the command:

poetry add

See https://python-poetry.org/ for more information on how poetry works.

Dev tools

We do have some conditions that we would our code to adhere to:

  • Formatted using black
  • Imports sorted using isort
  • Static analysis using mypy on strict mode
  • Test cases using pytest

These tools can all be executed inside the container.

About

No description, website, or topics provided.

Resources

License

Code of conduct

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •