permissionproof 0.1.0.dev1__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.
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Unique Open Sources
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,30 @@
1
+ Metadata-Version: 2.4
2
+ Name: permissionproof
3
+ Version: 0.1.0.dev1
4
+ Summary: Python bridge to the local PermissionProof Node.js CLI
5
+ Author: Unique Open Sources
6
+ License-Expression: MIT
7
+ Project-URL: Repository, https://github.com/Unique50101/permissionproof
8
+ Project-URL: Documentation, https://github.com/Unique50101/permissionproof/blob/main/docs/guide.md
9
+ Project-URL: Issues, https://github.com/Unique50101/permissionproof/issues
10
+ Requires-Python: >=3.9
11
+ Description-Content-Type: text/markdown
12
+ License-File: LICENSE
13
+ Dynamic: license-file
14
+
15
+ # PermissionProof for Python
16
+
17
+ Use your existing Python tests or notebooks to validate permission contracts, evaluate their recorded observations, and render the results through the PermissionProof CLI.
18
+
19
+ Install Node.js 24.12 or newer and run `npm install --global permissionproof@0.1.0-dev.1`. Install the wrapper with `python -m pip install permissionproof==0.1.0.dev1`. The CLI and wrapper run locally.
20
+
21
+ ```python
22
+ from permissionproof import validate, evaluate, report
23
+
24
+ validate("permissionproof.json")
25
+ exit_code, results = evaluate("permissionproof.json", "evidence.json")
26
+ print(exit_code, results["counts"])
27
+ print(report("run.json", format="markdown"))
28
+ ```
29
+
30
+ The wrapper preserves the CLI's failure and incomplete outcomes. [Contract and evidence guide](https://github.com/Unique50101/permissionproof/blob/main/docs/guide.md).
@@ -0,0 +1,16 @@
1
+ # PermissionProof for Python
2
+
3
+ Use your existing Python tests or notebooks to validate permission contracts, evaluate their recorded observations, and render the results through the PermissionProof CLI.
4
+
5
+ Install Node.js 24.12 or newer and run `npm install --global permissionproof@0.1.0-dev.1`. Install the wrapper with `python -m pip install permissionproof==0.1.0.dev1`. The CLI and wrapper run locally.
6
+
7
+ ```python
8
+ from permissionproof import validate, evaluate, report
9
+
10
+ validate("permissionproof.json")
11
+ exit_code, results = evaluate("permissionproof.json", "evidence.json")
12
+ print(exit_code, results["counts"])
13
+ print(report("run.json", format="markdown"))
14
+ ```
15
+
16
+ The wrapper preserves the CLI's failure and incomplete outcomes. [Contract and evidence guide](https://github.com/Unique50101/permissionproof/blob/main/docs/guide.md).
@@ -0,0 +1,30 @@
1
+ Metadata-Version: 2.4
2
+ Name: permissionproof
3
+ Version: 0.1.0.dev1
4
+ Summary: Python bridge to the local PermissionProof Node.js CLI
5
+ Author: Unique Open Sources
6
+ License-Expression: MIT
7
+ Project-URL: Repository, https://github.com/Unique50101/permissionproof
8
+ Project-URL: Documentation, https://github.com/Unique50101/permissionproof/blob/main/docs/guide.md
9
+ Project-URL: Issues, https://github.com/Unique50101/permissionproof/issues
10
+ Requires-Python: >=3.9
11
+ Description-Content-Type: text/markdown
12
+ License-File: LICENSE
13
+ Dynamic: license-file
14
+
15
+ # PermissionProof for Python
16
+
17
+ Use your existing Python tests or notebooks to validate permission contracts, evaluate their recorded observations, and render the results through the PermissionProof CLI.
18
+
19
+ Install Node.js 24.12 or newer and run `npm install --global permissionproof@0.1.0-dev.1`. Install the wrapper with `python -m pip install permissionproof==0.1.0.dev1`. The CLI and wrapper run locally.
20
+
21
+ ```python
22
+ from permissionproof import validate, evaluate, report
23
+
24
+ validate("permissionproof.json")
25
+ exit_code, results = evaluate("permissionproof.json", "evidence.json")
26
+ print(exit_code, results["counts"])
27
+ print(report("run.json", format="markdown"))
28
+ ```
29
+
30
+ The wrapper preserves the CLI's failure and incomplete outcomes. [Contract and evidence guide](https://github.com/Unique50101/permissionproof/blob/main/docs/guide.md).
@@ -0,0 +1,8 @@
1
+ LICENSE
2
+ README.md
3
+ permissionproof.py
4
+ pyproject.toml
5
+ permissionproof.egg-info/PKG-INFO
6
+ permissionproof.egg-info/SOURCES.txt
7
+ permissionproof.egg-info/dependency_links.txt
8
+ permissionproof.egg-info/top_level.txt
@@ -0,0 +1 @@
1
+ permissionproof
@@ -0,0 +1,43 @@
1
+ """Run the same installed PermissionProof CLI from Python 3.9+."""
2
+ import json
3
+ import shutil
4
+ import subprocess
5
+ from pathlib import Path
6
+
7
+
8
+ def _run(arguments, executable="permissionproof"):
9
+ command = shutil.which(executable)
10
+ if not command:
11
+ raise FileNotFoundError("Install the PermissionProof CLI first")
12
+ # On Windows invoke the JS entry with node, avoiding cmd.exe argument parsing.
13
+ if Path(command).suffix.lower() in {".cmd", ".bat"}:
14
+ entry = Path(command).parent / "node_modules" / "permissionproof" / "dist" / "cli.js"
15
+ if not entry.is_file():
16
+ entry = Path(command).resolve().parent.parent / "permissionproof" / "dist" / "cli.js"
17
+ if not entry.is_file():
18
+ raise FileNotFoundError("Cannot resolve installed PermissionProof entry")
19
+ argv = [shutil.which("node") or "node", str(entry)]
20
+ else:
21
+ argv = [command]
22
+ return subprocess.run(argv + list(arguments), capture_output=True, text=True, timeout=60, check=False)
23
+
24
+
25
+ def validate(config, executable="permissionproof"):
26
+ result = _run(["validate", "--config", str(config)], executable)
27
+ if result.returncode:
28
+ raise ValueError(result.stderr.strip())
29
+ return True
30
+
31
+
32
+ def evaluate(config, evidence, executable="permissionproof"):
33
+ result = _run(["test", "--config", str(config), "--evidence", str(evidence), "--format", "json"], executable)
34
+ if not result.stdout.strip():
35
+ raise ValueError(result.stderr.strip())
36
+ return result.returncode, json.loads(result.stdout)
37
+
38
+
39
+ def report(run, format="markdown", executable="permissionproof"):
40
+ result = _run(["report", "--run", str(run), "--format", format], executable)
41
+ if result.returncode:
42
+ raise ValueError(result.stderr.strip())
43
+ return result.stdout
@@ -0,0 +1,17 @@
1
+ [build-system]
2
+ requires = ["setuptools>=68"]
3
+ build-backend = "setuptools.build_meta"
4
+ [project]
5
+ name = "permissionproof"
6
+ version = "0.1.0.dev1"
7
+ description = "Python bridge to the local PermissionProof Node.js CLI"
8
+ readme = "README.md"
9
+ authors = [{name = "Unique Open Sources"}]
10
+ requires-python = ">=3.9"
11
+ license = "MIT"
12
+ [project.urls]
13
+ Repository = "https://github.com/Unique50101/permissionproof"
14
+ Documentation = "https://github.com/Unique50101/permissionproof/blob/main/docs/guide.md"
15
+ Issues = "https://github.com/Unique50101/permissionproof/issues"
16
+ [tool.setuptools]
17
+ py-modules = ["permissionproof"]
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+