python-jsonlogic 0.1.0__tar.gz → 0.2.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (81) hide show
  1. python_jsonlogic-0.2.0/.github/workflows/ci.yml +130 -0
  2. python_jsonlogic-0.2.0/.github/workflows/lint.yml +83 -0
  3. python_jsonlogic-0.2.0/.gitignore +165 -0
  4. python_jsonlogic-0.2.0/.yamlfmt.yaml +5 -0
  5. {python_jsonlogic-0.1.0/src/python_jsonlogic.egg-info → python_jsonlogic-0.2.0}/PKG-INFO +11 -32
  6. python_jsonlogic-0.2.0/changelog/entry.rst.jinja +8 -0
  7. python_jsonlogic-0.2.0/docs/Makefile +20 -0
  8. python_jsonlogic-0.2.0/docs/make.bat +35 -0
  9. python_jsonlogic-0.2.0/docs/source/api/core.rst +5 -0
  10. python_jsonlogic-0.2.0/docs/source/api/evaluation.rst +5 -0
  11. python_jsonlogic-0.2.0/docs/source/api/index.rst +15 -0
  12. python_jsonlogic-0.2.0/docs/source/api/json_schema.rst +8 -0
  13. python_jsonlogic-0.2.0/docs/source/api/registry.rst +5 -0
  14. python_jsonlogic-0.2.0/docs/source/api/resolving.rst +5 -0
  15. python_jsonlogic-0.2.0/docs/source/api/typechecking.rst +5 -0
  16. python_jsonlogic-0.2.0/docs/source/api/typing_helpers.rst +5 -0
  17. python_jsonlogic-0.2.0/docs/source/changelog.rst +40 -0
  18. python_jsonlogic-0.2.0/docs/source/conf.py +90 -0
  19. python_jsonlogic-0.2.0/docs/source/index.rst +19 -0
  20. python_jsonlogic-0.2.0/docs/source/usage/creating_operators.rst +147 -0
  21. python_jsonlogic-0.2.0/docs/source/usage/evaluation.rst +84 -0
  22. python_jsonlogic-0.2.0/docs/source/usage/index.rst +94 -0
  23. python_jsonlogic-0.2.0/docs/source/usage/resolving_variables.rst +117 -0
  24. python_jsonlogic-0.2.0/docs/source/usage/typechecking.rst +240 -0
  25. python_jsonlogic-0.2.0/prek.toml +20 -0
  26. python_jsonlogic-0.2.0/pyproject.toml +142 -0
  27. python_jsonlogic-0.2.0/readthedocs.yml +31 -0
  28. python_jsonlogic-0.2.0/requirements/requirements-dev.in +3 -0
  29. python_jsonlogic-0.2.0/requirements/requirements-dev.txt +12 -0
  30. python_jsonlogic-0.2.0/requirements/requirements-docs.in +5 -0
  31. python_jsonlogic-0.2.0/requirements/requirements-docs.txt +68 -0
  32. python_jsonlogic-0.2.0/requirements/requirements-test.in +6 -0
  33. python_jsonlogic-0.2.0/requirements/requirements-test.txt +51 -0
  34. python_jsonlogic-0.2.0/requirements/requirements.in +1 -0
  35. python_jsonlogic-0.2.0/requirements/requirements.txt +4 -0
  36. python_jsonlogic-0.2.0/src/jsonlogic/_compat.py +11 -0
  37. {python_jsonlogic-0.1.0 → python_jsonlogic-0.2.0}/src/jsonlogic/core.py +0 -3
  38. {python_jsonlogic-0.1.0 → python_jsonlogic-0.2.0}/src/jsonlogic/evaluation/evaluation_settings.py +4 -3
  39. {python_jsonlogic-0.1.0 → python_jsonlogic-0.2.0}/src/jsonlogic/evaluation/utils.py +2 -1
  40. {python_jsonlogic-0.1.0 → python_jsonlogic-0.2.0}/src/jsonlogic/json_schema/__init__.py +8 -3
  41. {python_jsonlogic-0.1.0 → python_jsonlogic-0.2.0}/src/jsonlogic/json_schema/types.py +3 -2
  42. {python_jsonlogic-0.1.0 → python_jsonlogic-0.2.0}/src/jsonlogic/operators/__init__.py +3 -0
  43. {python_jsonlogic-0.1.0 → python_jsonlogic-0.2.0}/src/jsonlogic/operators/operators.py +42 -2
  44. python_jsonlogic-0.2.0/src/jsonlogic/py.typed +0 -0
  45. {python_jsonlogic-0.1.0 → python_jsonlogic-0.2.0}/src/jsonlogic/registry.py +8 -7
  46. {python_jsonlogic-0.1.0 → python_jsonlogic-0.2.0}/src/jsonlogic/typechecking/typecheck_settings.py +4 -3
  47. {python_jsonlogic-0.1.0 → python_jsonlogic-0.2.0}/src/jsonlogic/typing.py +3 -5
  48. {python_jsonlogic-0.1.0 → python_jsonlogic-0.2.0}/src/jsonlogic/utils.py +4 -3
  49. python_jsonlogic-0.2.0/tests/__init__.py +0 -0
  50. python_jsonlogic-0.2.0/tests/json_schema/test_inference.py +151 -0
  51. python_jsonlogic-0.2.0/tests/json_schema/test_types.py +292 -0
  52. python_jsonlogic-0.2.0/tests/operators/__init__.py +0 -0
  53. python_jsonlogic-0.2.0/tests/operators/test_evaluate.py +242 -0
  54. python_jsonlogic-0.2.0/tests/operators/test_from_expression.py +107 -0
  55. python_jsonlogic-0.2.0/tests/operators/test_typecheck.py +291 -0
  56. {python_jsonlogic-0.1.0 → python_jsonlogic-0.2.0}/tests/test_registry.py +2 -2
  57. python_jsonlogic-0.2.0/tests/typechecking/__init__.py +0 -0
  58. python_jsonlogic-0.2.0/tests/typechecking/test_typecheck_context.py +41 -0
  59. python_jsonlogic-0.2.0/tests/typechecking/test_typecheck_settings.py +24 -0
  60. python_jsonlogic-0.2.0/uv.lock +1547 -0
  61. python_jsonlogic-0.1.0/PKG-INFO +0 -141
  62. python_jsonlogic-0.1.0/pyproject.toml +0 -80
  63. python_jsonlogic-0.1.0/setup.cfg +0 -4
  64. python_jsonlogic-0.1.0/src/jsonlogic/_compat.py +0 -12
  65. python_jsonlogic-0.1.0/src/python_jsonlogic.egg-info/SOURCES.txt +0 -32
  66. python_jsonlogic-0.1.0/src/python_jsonlogic.egg-info/dependency_links.txt +0 -1
  67. python_jsonlogic-0.1.0/src/python_jsonlogic.egg-info/requires.txt +0 -3
  68. python_jsonlogic-0.1.0/src/python_jsonlogic.egg-info/top_level.txt +0 -1
  69. {python_jsonlogic-0.1.0 → python_jsonlogic-0.2.0}/LICENSE +0 -0
  70. {python_jsonlogic-0.1.0 → python_jsonlogic-0.2.0}/README.rst +0 -0
  71. /python_jsonlogic-0.1.0/src/jsonlogic/py.typed → /python_jsonlogic-0.2.0/docs/source/_static/.gitkeep +0 -0
  72. {python_jsonlogic-0.1.0 → python_jsonlogic-0.2.0}/src/jsonlogic/__init__.py +0 -0
  73. {python_jsonlogic-0.1.0 → python_jsonlogic-0.2.0}/src/jsonlogic/evaluation/__init__.py +0 -0
  74. {python_jsonlogic-0.1.0 → python_jsonlogic-0.2.0}/src/jsonlogic/evaluation/evaluation_context.py +0 -0
  75. {python_jsonlogic-0.1.0 → python_jsonlogic-0.2.0}/src/jsonlogic/resolving.py +0 -0
  76. {python_jsonlogic-0.1.0 → python_jsonlogic-0.2.0}/src/jsonlogic/typechecking/__init__.py +0 -0
  77. {python_jsonlogic-0.1.0 → python_jsonlogic-0.2.0}/src/jsonlogic/typechecking/diagnostics.py +0 -0
  78. {python_jsonlogic-0.1.0 → python_jsonlogic-0.2.0}/src/jsonlogic/typechecking/typecheck_context.py +0 -0
  79. {python_jsonlogic-0.1.0 → python_jsonlogic-0.2.0}/src/jsonlogic/typechecking/utils.py +0 -0
  80. {python_jsonlogic-0.1.0 → python_jsonlogic-0.2.0}/tests/test_json_logic_expression.py +0 -0
  81. {python_jsonlogic-0.1.0 → python_jsonlogic-0.2.0}/tests/test_resolving.py +0 -0
@@ -0,0 +1,130 @@
1
+ name: ci
2
+
3
+ on:
4
+ push:
5
+ branches:
6
+ - main
7
+ tags:
8
+ - '**'
9
+ pull_request: {}
10
+
11
+ permissions:
12
+ contents: read
13
+
14
+ jobs:
15
+ tests:
16
+ name: Run tests with pytest
17
+ runs-on: ubuntu-latest
18
+ strategy:
19
+ matrix:
20
+ python-version: ['3.10', '3.11', '3.12', '3.13', '3.14', '3.15']
21
+ steps:
22
+ - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
23
+ with:
24
+ persist-credentials: false
25
+
26
+ - name: Set up Python ${{ matrix.python-version }}
27
+ uses: astral-sh/setup-uv@20cfd1bf945f4377ade1205e4dbc17946fc9a30d # v10.0.1
28
+ with:
29
+ python-version: ${{ matrix.python-version }}
30
+ enable-cache: true # zizmor: ignore[cache-poisoning] (Job does not produce release artifacts and does not have sensitive permissions)
31
+
32
+ - name: Install tox
33
+ run: uv tool install --managed-python --python 3.13 tox --with tox-uv --with tox-gh
34
+
35
+ - name: Install Python ${{ matrix.python-version }}
36
+ run: uv python install --managed-python ${{ matrix.python-version }}
37
+
38
+ - name: Test with tox
39
+ run: tox run
40
+ env:
41
+ TOX_GH_MAJOR_MINOR: ${{ matrix.python-version }}
42
+ UV_PYTHON_DOWNLOADS: never
43
+
44
+ docs:
45
+ name: Build and check documentation
46
+ runs-on: ubuntu-latest
47
+ steps:
48
+ - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
49
+ with:
50
+ persist-credentials: false
51
+
52
+ - name: Set up Python 3.14
53
+ uses: astral-sh/setup-uv@20cfd1bf945f4377ade1205e4dbc17946fc9a30d # v10.0.1
54
+ with:
55
+ python-version: '3.14'
56
+ enable-cache: true # zizmor: ignore[cache-poisoning] (Job does not produce release artifacts and does not have sensitive permissions)
57
+
58
+ - name: Install dependencies
59
+ run: uv sync --group docs
60
+
61
+ - name: Lint docs with sphinx-lint
62
+ run: |
63
+ uv run sphinx-lint docs
64
+
65
+ - name: Build docs and check the integrity of external links
66
+ run: |
67
+ uv run sphinx-build --builder linkcheck --fail-on-warning "source" "build"
68
+ uv run sphinx-build --builder html --fail-on-warning "source" "build"
69
+ working-directory: ./docs
70
+
71
+ build:
72
+ name: Build project
73
+ runs-on: ubuntu-latest
74
+ steps:
75
+ - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
76
+ with:
77
+ persist-credentials: false
78
+
79
+ - uses: astral-sh/setup-uv@20cfd1bf945f4377ade1205e4dbc17946fc9a30d # v10.0.1
80
+ with:
81
+ enable-cache: false
82
+
83
+ - run: uv sync --no-install-project --only-group build
84
+
85
+ - name: Build library
86
+ run: uv run --no-sync python -m build --installer uv
87
+
88
+ - run: ls -lh dist/
89
+
90
+ - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
91
+ with:
92
+ name: pypi_files
93
+ path: dist
94
+
95
+ release:
96
+ needs: [tests, docs, build]
97
+ runs-on: ubuntu-latest
98
+ if: startsWith(github.ref, 'refs/tags/')
99
+ environment: release
100
+
101
+ permissions:
102
+ id-token: write
103
+ contents: write
104
+
105
+ steps:
106
+ - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
107
+ with:
108
+ persist-credentials: false
109
+
110
+ - uses: astral-sh/setup-uv@20cfd1bf945f4377ade1205e4dbc17946fc9a30d # v10.0.1
111
+ with:
112
+ enable-cache: false
113
+
114
+ - run: uv sync --no-install-project --only-group build
115
+
116
+ - name: Get dist artifacts
117
+ uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
118
+ with:
119
+ name: pypi_files
120
+ path: dist
121
+
122
+ - name: Test artifacts integrity
123
+ run: |
124
+ for whl in dist/*.whl; do unzip -qt "$whl"; done
125
+ uv run --no-sync twine check --strict dist/*
126
+
127
+ - name: Upload package to PyPI
128
+ uses: pypa/gh-action-pypi-publish@dc37677b2e1c63e2034f94d8a5b11f265b73ba33 # v1.14.2
129
+ with:
130
+ packages-dir: dist/
@@ -0,0 +1,83 @@
1
+ name: lint
2
+
3
+ on:
4
+ push:
5
+ branches:
6
+ - main
7
+ tags:
8
+ - '**'
9
+ pull_request: {}
10
+
11
+ permissions:
12
+ contents: read
13
+
14
+ jobs:
15
+ prek:
16
+ name: Run prek pre-commit hooks
17
+ runs-on: ubuntu-latest
18
+ steps:
19
+ - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
20
+ with:
21
+ persist-credentials: false
22
+
23
+ - uses: j178/prek-action@4e14d07f9231acabce116ccfca13b13dd9755ece # v3.0.0
24
+
25
+ ruff-format:
26
+ name: Check code formatting with Ruff
27
+ runs-on: ubuntu-latest
28
+ steps:
29
+ - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
30
+ with:
31
+ persist-credentials: false
32
+
33
+ - name: Set up Python 3.14
34
+ uses: astral-sh/setup-uv@20cfd1bf945f4377ade1205e4dbc17946fc9a30d # v10.0.1
35
+ with:
36
+ python-version: '3.14'
37
+ enable-cache: true # zizmor: ignore[cache-poisoning] (Job does not produce release artifacts and does not have sensitive permissions)
38
+
39
+ - name: Install dependencies
40
+ run: uv sync --group dev
41
+
42
+ - name: Run Ruff formatter
43
+ run: uv run ruff format --diff
44
+
45
+ ruff-check:
46
+ name: Check code linting with Ruff
47
+ runs-on: ubuntu-latest
48
+ steps:
49
+ - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
50
+ with:
51
+ persist-credentials: false
52
+
53
+ - name: Set up Python 3.14
54
+ uses: astral-sh/setup-uv@20cfd1bf945f4377ade1205e4dbc17946fc9a30d # v10.0.1
55
+ with:
56
+ python-version: '3.14'
57
+ enable-cache: true # zizmor: ignore[cache-poisoning] (Job does not produce release artifacts and does not have sensitive permissions)
58
+
59
+ - name: Install dependencies
60
+ run: uv sync --group dev
61
+
62
+ - name: Run Ruff formatter
63
+ run: uv run ruff check --output-format=github
64
+
65
+ typecheck:
66
+ name: Run typechecking with pyright
67
+ runs-on: ubuntu-latest
68
+ steps:
69
+ - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
70
+ with:
71
+ persist-credentials: false
72
+
73
+ - name: Set up Python 3.14
74
+ uses: astral-sh/setup-uv@20cfd1bf945f4377ade1205e4dbc17946fc9a30d # v10.0.1
75
+ with:
76
+ python-version: '3.14'
77
+ enable-cache: true # zizmor: ignore[cache-poisoning] (Job does not produce release artifacts and does not have sensitive permissions)
78
+
79
+ - name: Install dependencies
80
+ run: uv sync --group dev
81
+
82
+ - name: Run pyright
83
+ run: uv run pyright
@@ -0,0 +1,165 @@
1
+ # Byte-compiled / optimized / DLL files
2
+ __pycache__/
3
+ *.py[cod]
4
+ *$py.class
5
+
6
+ # C extensions
7
+ *.so
8
+
9
+ # Distribution / packaging
10
+ .Python
11
+ build/
12
+ develop-eggs/
13
+ dist/
14
+ downloads/
15
+ eggs/
16
+ .eggs/
17
+ lib/
18
+ lib64/
19
+ parts/
20
+ sdist/
21
+ var/
22
+ wheels/
23
+ share/python-wheels/
24
+ *.egg-info/
25
+ .installed.cfg
26
+ *.egg
27
+ MANIFEST
28
+
29
+ # PyInstaller
30
+ # Usually these files are written by a python script from a template
31
+ # before PyInstaller builds the exe, so as to inject date/other infos into it.
32
+ *.manifest
33
+ *.spec
34
+
35
+ # Installer logs
36
+ pip-log.txt
37
+ pip-delete-this-directory.txt
38
+
39
+ # Unit test / coverage reports
40
+ htmlcov/
41
+ .tox/
42
+ .nox/
43
+ .coverage
44
+ .coverage.*
45
+ .cache
46
+ nosetests.xml
47
+ coverage.xml
48
+ *.cover
49
+ *.py,cover
50
+ .hypothesis/
51
+ .pytest_cache/
52
+ cover/
53
+
54
+ # Translations
55
+ *.mo
56
+ *.pot
57
+
58
+ # Django stuff:
59
+ *.log
60
+ local_settings.py
61
+ db.sqlite3
62
+ db.sqlite3-journal
63
+
64
+ # Flask stuff:
65
+ instance/
66
+ .webassets-cache
67
+
68
+ # Scrapy stuff:
69
+ .scrapy
70
+
71
+ # Sphinx documentation
72
+ docs/_build/
73
+
74
+ # PyBuilder
75
+ .pybuilder/
76
+ target/
77
+
78
+ # Jupyter Notebook
79
+ .ipynb_checkpoints
80
+
81
+ # IPython
82
+ profile_default/
83
+ ipython_config.py
84
+
85
+ # pyenv
86
+ # For a library or package, you might want to ignore these files since the code is
87
+ # intended to run in multiple environments; otherwise, check them in:
88
+ # .python-version
89
+
90
+ # pipenv
91
+ # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
92
+ # However, in case of collaboration, if having platform-specific dependencies or dependencies
93
+ # having no cross-platform support, pipenv may install dependencies that don't work, or not
94
+ # install all needed dependencies.
95
+ #Pipfile.lock
96
+
97
+ # poetry
98
+ # Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
99
+ # This is especially recommended for binary packages to ensure reproducibility, and is more
100
+ # commonly ignored for libraries.
101
+ # https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
102
+ #poetry.lock
103
+
104
+ # pdm
105
+ # Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
106
+ #pdm.lock
107
+ # pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
108
+ # in version control.
109
+ # https://pdm.fming.dev/#use-with-ide
110
+ .pdm.toml
111
+
112
+ # PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
113
+ __pypackages__/
114
+
115
+ # Celery stuff
116
+ celerybeat-schedule
117
+ celerybeat.pid
118
+
119
+ # SageMath parsed files
120
+ *.sage.py
121
+
122
+ # Environments
123
+ .env
124
+ .venv
125
+ env/
126
+ venv/
127
+ ENV/
128
+ env.bak/
129
+ venv.bak/
130
+
131
+ # Spyder project settings
132
+ .spyderproject
133
+ .spyproject
134
+
135
+ # Rope project settings
136
+ .ropeproject
137
+
138
+ # mkdocs documentation
139
+ /site
140
+
141
+ # mypy
142
+ .mypy_cache/
143
+ .dmypy.json
144
+ dmypy.json
145
+
146
+ # Pyre type checker
147
+ .pyre/
148
+
149
+ # pytype static type analyzer
150
+ .pytype/
151
+
152
+ # Ruff linter
153
+ .ruff_cache/
154
+
155
+ # Cython debug symbols
156
+ cython_debug/
157
+
158
+ .vscode/
159
+
160
+ # PyCharm
161
+ # JetBrains specific template is maintained in a separate JetBrains.gitignore that can
162
+ # be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
163
+ # and can be added to the global gitignore or merged into this file. For a more nuclear
164
+ # option (not recommended) you can uncomment the following to ignore the entire idea folder.
165
+ #.idea/
@@ -0,0 +1,5 @@
1
+ formatter:
2
+ type: basic
3
+ retain_line_breaks_single: true
4
+ scan_folded_as_literal: true
5
+ force_quote_style: single
@@ -1,47 +1,26 @@
1
- Metadata-Version: 2.1
1
+ Metadata-Version: 2.5
2
2
  Name: python-jsonlogic
3
- Version: 0.1.0
3
+ Version: 0.2.0
4
4
  Summary: An extensible and sane implementation of JsonLogic
5
5
  Author-email: Victorien <contact@vctrn.dev>
6
- License: MIT License
7
-
8
- Copyright (c) 2024 Victorien
9
-
10
- Permission is hereby granted, free of charge, to any person obtaining a copy
11
- of this software and associated documentation files (the "Software"), to deal
12
- in the Software without restriction, including without limitation the rights
13
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
14
- copies of the Software, and to permit persons to whom the Software is
15
- furnished to do so, subject to the following conditions:
16
-
17
- The above copyright notice and this permission notice shall be included in all
18
- copies or substantial portions of the Software.
19
-
20
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
21
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
22
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
23
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
24
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
25
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
26
- SOFTWARE.
27
-
6
+ License-Expression: MIT
7
+ License-File: LICENSE
28
8
  Classifier: Development Status :: 4 - Beta
9
+ Classifier: Intended Audience :: Developers
29
10
  Classifier: Operating System :: OS Independent
30
11
  Classifier: Programming Language :: Python :: 3
31
12
  Classifier: Programming Language :: Python :: 3 :: Only
32
- Classifier: Programming Language :: Python :: 3.8
33
- Classifier: Programming Language :: Python :: 3.9
34
13
  Classifier: Programming Language :: Python :: 3.10
35
14
  Classifier: Programming Language :: Python :: 3.11
36
15
  Classifier: Programming Language :: Python :: 3.12
37
- Classifier: Typing :: Typed
38
- Classifier: License :: OSI Approved :: MIT License
39
- Classifier: Intended Audience :: Developers
16
+ Classifier: Programming Language :: Python :: 3.13
17
+ Classifier: Programming Language :: Python :: 3.14
18
+ Classifier: Programming Language :: Python :: 3.15
40
19
  Classifier: Topic :: Software Development :: Libraries :: Python Modules
41
- Requires-Python: >=3.8
20
+ Classifier: Typing :: Typed
21
+ Requires-Python: >=3.10
22
+ Requires-Dist: typing-extensions>=4.10.0; python_version < '3.13'
42
23
  Description-Content-Type: text/x-rst
43
- License-File: LICENSE
44
- Requires-Dist: typing-extensions>=4.10.0; python_version < "3.13"
45
24
 
46
25
  ================
47
26
  python-jsonlogic
@@ -0,0 +1,8 @@
1
+ {% set refs = [] %}
2
+ {% if metadata.gh_issue %}{% set _ = refs.append("Issue :issue:`%s`" % metadata.gh_issue) %}{% endif %}
3
+ {% if metadata.gh_pr %}{% set _ = refs.append("PR :pr:`%s`" % metadata.gh_pr) %}{% endif %}
4
+ {% set refs = refs | join(", ") %}
5
+ {% if metadata.gh_author %}{% set refs = (refs ~ " by :user:`%s`" % metadata.gh_author) | trim %}{% endif %}
6
+ {# References are attached to the first paragraph, so that multi-paragraph entries (e.g. with a code example) stay valid: #}
7
+ {% set first, _, rest = content.partition("\n\n") %}
8
+ {{ first }}{% if refs %} ({{ refs }}).{% endif %}{% if rest %}{{ "\n\n" ~ rest }}{% endif %}
@@ -0,0 +1,20 @@
1
+ # Minimal makefile for Sphinx documentation
2
+ #
3
+
4
+ # You can set these variables from the command line, and also
5
+ # from the environment for the first two.
6
+ SPHINXOPTS ?=
7
+ SPHINXBUILD ?= sphinx-build
8
+ SOURCEDIR = source
9
+ BUILDDIR = build
10
+
11
+ # Put it first so that "make" without argument is like "make help".
12
+ help:
13
+ @$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
14
+
15
+ .PHONY: help Makefile
16
+
17
+ # Catch-all target: route all unknown targets to Sphinx using the new
18
+ # "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
19
+ %: Makefile
20
+ @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
@@ -0,0 +1,35 @@
1
+ @ECHO OFF
2
+
3
+ pushd %~dp0
4
+
5
+ REM Command file for Sphinx documentation
6
+
7
+ if "%SPHINXBUILD%" == "" (
8
+ set SPHINXBUILD=sphinx-build
9
+ )
10
+ set SOURCEDIR=source
11
+ set BUILDDIR=build
12
+
13
+ %SPHINXBUILD% >NUL 2>NUL
14
+ if errorlevel 9009 (
15
+ echo.
16
+ echo.The 'sphinx-build' command was not found. Make sure you have Sphinx
17
+ echo.installed, then set the SPHINXBUILD environment variable to point
18
+ echo.to the full path of the 'sphinx-build' executable. Alternatively you
19
+ echo.may add the Sphinx directory to PATH.
20
+ echo.
21
+ echo.If you don't have Sphinx installed, grab it from
22
+ echo.https://www.sphinx-doc.org/
23
+ exit /b 1
24
+ )
25
+
26
+ if "%1" == "" goto help
27
+
28
+ %SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
29
+ goto end
30
+
31
+ :help
32
+ %SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
33
+
34
+ :end
35
+ popd
@@ -0,0 +1,5 @@
1
+ Core
2
+ ----
3
+
4
+ .. automodule:: jsonlogic.core
5
+ :members:
@@ -0,0 +1,5 @@
1
+ Evaluation
2
+ ==========
3
+
4
+ .. automodule:: jsonlogic.evaluation
5
+ :members:
@@ -0,0 +1,15 @@
1
+ .. _api:
2
+
3
+ API Reference
4
+ =============
5
+
6
+ .. toctree::
7
+ :maxdepth: 2
8
+
9
+ evaluation
10
+ core
11
+ json_schema
12
+ registry
13
+ resolving
14
+ typechecking
15
+ typing_helpers
@@ -0,0 +1,8 @@
1
+ JSON Schema
2
+ ===========
3
+
4
+ Types
5
+ -----
6
+
7
+ .. automodule:: jsonlogic.json_schema.types
8
+ :members:
@@ -0,0 +1,5 @@
1
+ Registry
2
+ --------
3
+
4
+ .. automodule:: jsonlogic.registry
5
+ :members:
@@ -0,0 +1,5 @@
1
+ Resolving
2
+ ---------
3
+
4
+ .. automodule:: jsonlogic.resolving
5
+ :members:
@@ -0,0 +1,5 @@
1
+ Typechecking
2
+ ------------
3
+
4
+ .. automodule:: jsonlogic.typechecking
5
+ :members:
@@ -0,0 +1,5 @@
1
+ Typing helpers
2
+ --------------
3
+
4
+ .. automodule:: jsonlogic.typing
5
+ :members:
@@ -0,0 +1,40 @@
1
+ =========
2
+ Changelog
3
+ =========
4
+
5
+ .. rtfc-unreleased::
6
+
7
+ These changes are not yet released and are under active development.
8
+
9
+ .. rtfc-insert
10
+
11
+ 0.2.0 (2026-08-30)
12
+ ------------------
13
+
14
+ Changes
15
+ ~~~~~~~
16
+
17
+ - Add support for Python 3.13 (:pr:`35`), 3.14 and 3.15, drop support for Python 3.8 and 3.9 (PR :pr:`37` by :user:`Viicos`).
18
+ - Rename the ``UnkownOperator`` exception to :class:`~jsonlogic.registry.UnknownOperator` (PR :pr:`38` by :user:`Viicos`).
19
+
20
+ Features
21
+ ~~~~~~~~
22
+
23
+ - Add the ``*`` (multiply) operator, taking two or more arguments. (PR :pr:`30` by :user:`Viicos`).
24
+
25
+ .. code-block:: python
26
+
27
+ expr = JSONLogicExpression.from_json({"*": [2, {"var": "my_int"}, 3]})
28
+ root_op = expr.as_operator_tree(operator_registry)
29
+
30
+ assert evaluate(root_op, data={"my_int": 4}, data_schema=None) == 24
31
+
32
+ 0.1.0 (2024-06-02)
33
+ ------------------
34
+
35
+ - Initial working release. Check the docs for how to use the library.
36
+
37
+ 0.0.1 (2024-03-12)
38
+ ------------------
39
+
40
+ - Initial release.