Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

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() and authz.explain()
  • audit.list() and audit.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.

Metadata

Release files for plystra 1.0.0rc121

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for plystra 1.0.0rc121
File Size Uploaded Provenance Actions
plystra-1.0.0rc121.tar.gz 11.2 kB With provenance Details for plystra-1.0.0rc121.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for plystra 1.0.0rc121
File Interpreter ABI Platform Actions
plystra-1.0.0rc121-py3-none-any.whl Python 3 none any Details for plystra-1.0.0rc121-py3-none-any.whl

Total release size: 21.7 kB

Release files / plystra-1.0.0rc121.tar.gz

Download URL plystra-1.0.0rc121.tar.gz
Size 11.2 kB
Tags Source
SHA-256 checksum
How to use checksums
fbb79f865e76a630d01262cf4c57971ad3c4d5cd4de575673b03aacda1804a0a
BLAKE2b-256 checksum
How to use checksums
dc62987801cd6a3ab9a30e11b03689707a6569952effb57a2d49a10382324ba2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on May 17, 2026.

Transparency log

Release files / plystra-1.0.0rc121-py3-none-any.whl

Download URL plystra-1.0.0rc121-py3-none-any.whl
Size 10.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
921957a726f694acdacb9d7920900e8062807bd5908f72ce205c6d57c4f07a6e
BLAKE2b-256 checksum
How to use checksums
1a70e156ff8f81aee5bbc9fa32e0372c97ca809a5d21bf83250d9d8afbca2b72
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on May 17, 2026.

Transparency log

Security for plystra 1.0.0rc121

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for plystra-1.0.0rc121.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on May 17, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page