Skip to main content

A Python package that emits JSON Logic

Project description

jsonlogic.py - JSON Logic expression generator

This package provides functionality to express JSON Logic using standard Python datastructures.

An example:

>>> from jsonlogic import Variable
>>> v1 = Variable('var1')
>>> v2 = Variable('var2')
>>> e = (v1 < v2)
>>> print(e)
{"<": [{"var": "var1"}, {"var": "var2"}]}
>>> print (v1 < 3)
{"<": [{"var": "var1"}, 3]}
>>> print ( (v1 < 3) & (v1 > v2))
{"and": [{"<": [{"var": "var1"}, 3]}, {">": [{"var": "var1"}, {"var": "var2"}]}]}
>>> print ( (v1 < 3) & ~(v1 > v2)))  # ~ is "not"
{"and": [{"<": [{"var": "v1"}, 3]}, {"not": [{">": [{"var": "v1"}, {"var": "v2"}]}]}]}

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

jsonlogic_py-0.2.5.tar.gz (6.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

jsonlogic_py-0.2.5-py3-none-any.whl (5.8 kB view details)

Uploaded Python 3

File details

Details for the file jsonlogic_py-0.2.5.tar.gz.

File metadata

  • Download URL: jsonlogic_py-0.2.5.tar.gz
  • Upload date:
  • Size: 6.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for jsonlogic_py-0.2.5.tar.gz
Algorithm Hash digest
SHA256 3e07e79faa617eb01b847308ab5f6b253c8d9e13281ad2f1240ed37c132c9d9c
MD5 437d05392fec3c166e6e52870dd754cb
BLAKE2b-256 f732779b851ded1dc2ee64bc7eb72ba536e03c96493b015439cc350623eb80d2

See more details on using hashes here.

Provenance

The following attestation bundles were made for jsonlogic_py-0.2.5.tar.gz:

Publisher: publish-py.yaml on llnl/jsonlogic

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file jsonlogic_py-0.2.5-py3-none-any.whl.

File metadata

  • Download URL: jsonlogic_py-0.2.5-py3-none-any.whl
  • Upload date:
  • Size: 5.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for jsonlogic_py-0.2.5-py3-none-any.whl
Algorithm Hash digest
SHA256 832f65f7a2e973ec1be6d69be4d29c6934b42537e303342c809a43da0dcbeaf4
MD5 dffbc7abecc494cb6436d6b85a88e905
BLAKE2b-256 3e3ffa62e89a4766ac71d8bb66a41460fcbf20018623da4fb97e9077292aa632

See more details on using hashes here.

Provenance

The following attestation bundles were made for jsonlogic_py-0.2.5-py3-none-any.whl:

Publisher: publish-py.yaml on llnl/jsonlogic

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page