permissionproof 0.1.0.dev1__py3-none-any.whl
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,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,6 @@
|
|
|
1
|
+
permissionproof.py,sha256=IBirFUu89a7q-3Nr5oOMu-KmsEx17DpM6yiNaMHQrwM,1782
|
|
2
|
+
permissionproof-0.1.0.dev1.dist-info/licenses/LICENSE,sha256=09hftvfvLRS-7pB9XBX9eAYbgOGYrRp77UciYEHmgDc,1076
|
|
3
|
+
permissionproof-0.1.0.dev1.dist-info/METADATA,sha256=TyLp1ShAEmy8_oXCUSHlXBx_dpGWxVvIwcrFvEO_wgc,1364
|
|
4
|
+
permissionproof-0.1.0.dev1.dist-info/WHEEL,sha256=mOdXR9C3wMVov7cSY8PY-XCzo3SmmWCHvGQr5csJoao,91
|
|
5
|
+
permissionproof-0.1.0.dev1.dist-info/top_level.txt,sha256=S7tUfETaioczCzKc39dib0fiatcgozhzqzI0V2OPB_M,16
|
|
6
|
+
permissionproof-0.1.0.dev1.dist-info/RECORD,,
|
|
@@ -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 @@
|
|
|
1
|
+
permissionproof
|
permissionproof.py
ADDED
|
@@ -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
|