Official Python SDK for the Plystra Kernel Phase 1 API.
Project description
plystra
Official Python SDK for the Plystra Kernel Phase 1 API.
PyPI package name: plystra
Repository name: plystra/python-sdk
Requires Python 3.10 or newer.
Install
pip install plystra
Usage
Phase 1 is Context Mode: your trusted backend keeps its existing users, organizations, roles, and business rows, then calls Plystra to protect one action.
from plystra import Plystra
with Plystra("https://plystra.internal", api_key="ply_kernel_secret") as plystra:
decision = plystra.authz.check(
actor={
"user_id": "user_external_alice",
"member_id": "member_finance_reviewer",
"binding_id": "binding_external_alice_finance",
"space_id": "space_acme",
},
resource={
"type": "invoice",
"external_id": "invoice_001",
"space_id": "space_acme",
"group_path": "finance.apac",
"owner_member_id": "member_invoice_creator",
},
grants=[{
"role_key": "finance_approver",
"resource": "invoice",
"action": "approve",
"scope": "group_tree",
"space_id": "space_acme",
"scope_anchor_group_path": "finance",
}],
action="approve",
explain=True,
)
Inline actor, resource, and grant context is trusted server-side input. Build it from your authenticated session and database state, never directly from browser-submitted JSON.
Async Usage
import asyncio
from plystra import AsyncPlystra
async def main() -> None:
async with AsyncPlystra("https://plystra.internal", api_key="ply_kernel_secret") as plystra:
print(await plystra.system.capabilities())
asyncio.run(main())
Kernel Surfaces
system.health(),system.ready(),system.version()system.capabilities()resource_types.list()authz.check()andauthz.explain()audit.list()andaudit.get()request()for low-level calls
Attach a correlation id to a group of calls:
scoped = plystra.with_request_id("req_01HY...")
scoped.authz.explain(**context_mode_request)
Protected routes require a scoped server API key. Public health, readiness, and version checks do not send the key.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file plystra-0.0.1.tar.gz.
File metadata
- Download URL: plystra-0.0.1.tar.gz
- Upload date:
- Size: 11.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
87f6a3de07eaaf54fd8aef1dc93337b253979f274766265a66ee68a7714c809d
|
|
| MD5 |
a44609112fe33d0f76a96c1295fc96c0
|
|
| BLAKE2b-256 |
2d7dc6ae4f51c464a1aab0f5763c4b3754f82fd1e35da51d68bcd462fd00a64b
|
Provenance
The following attestation bundles were made for plystra-0.0.1.tar.gz:
Publisher:
publish.yml on plystra/python-sdk
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
plystra-0.0.1.tar.gz -
Subject digest:
87f6a3de07eaaf54fd8aef1dc93337b253979f274766265a66ee68a7714c809d - Sigstore transparency entry: 1678961711
- Sigstore integration time:
-
Permalink:
plystra/python-sdk@0d501ddcb664417a75fc63377b46e9b2d09863a7 -
Branch / Tag:
refs/tags/v0.0.1 - Owner: https://github.com/plystra
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@0d501ddcb664417a75fc63377b46e9b2d09863a7 -
Trigger Event:
push
-
Statement type:
File details
Details for the file plystra-0.0.1-py3-none-any.whl.
File metadata
- Download URL: plystra-0.0.1-py3-none-any.whl
- Upload date:
- Size: 11.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
11df9c4d1615af4f34d51638ff5d95a0aecf8148fc8037c841afa0ca51c41da4
|
|
| MD5 |
f34cc2a35457cf15c656acc30f2ba7ff
|
|
| BLAKE2b-256 |
2401ed840084a8c13b04ea3478ded7d1de27be15a3b2ac615986093140a87b12
|
Provenance
The following attestation bundles were made for plystra-0.0.1-py3-none-any.whl:
Publisher:
publish.yml on plystra/python-sdk
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
plystra-0.0.1-py3-none-any.whl -
Subject digest:
11df9c4d1615af4f34d51638ff5d95a0aecf8148fc8037c841afa0ca51c41da4 - Sigstore transparency entry: 1678961897
- Sigstore integration time:
-
Permalink:
plystra/python-sdk@0d501ddcb664417a75fc63377b46e9b2d09863a7 -
Branch / Tag:
refs/tags/v0.0.1 - Owner: https://github.com/plystra
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@0d501ddcb664417a75fc63377b46e9b2d09863a7 -
Trigger Event:
push
-
Statement type: