Skip to main content

Official Python SDK for Plystra.

Project description

plystra

Official Python SDK for Plystra Core v1.0.

PyPI package name: plystra

Install

pip install plystra

Synchronous Usage

from plystra import Plystra

with Plystra("http://localhost:8080") as plystra:
    plystra.auth.login("alice@example.com", "plystra-demo")

    decision = plystra.authz.check(
        actor={
            "user_id": "user_alice",
            "space_id": "space_acme",
            "member_id": "member_finance_reviewer",
            "user_member_id": "um_alice_finance_reviewer",
        },
        resource_type="invoice",
        resource_id="invoice_001",
        action="approve",
    )

    print(decision["decision"])

Asynchronous Usage

import asyncio
from plystra import AsyncPlystra


async def main() -> None:
    async with AsyncPlystra("http://localhost:8080") as plystra:
        await plystra.auth.login("alice@example.com", "plystra-demo")
        decision = await plystra.authz.check(
            actor_user_id="user_alice",
            actor_member_id="member_finance_reviewer",
            actor_user_member_id="um_alice_finance_reviewer",
            space_id="space_acme",
            resource_type="invoice",
            resource_id="invoice_001",
            action="approve",
        )
        print(decision["decision"])


asyncio.run(main())

Modules

The SDK exposes v1.0 Core modules as attributes:

  • system
  • auth
  • actor
  • admin
  • users
  • spaces
  • groups
  • members
  • user_members
  • roles
  • member_roles
  • permissions
  • role_permissions
  • resource_types
  • resources
  • authz
  • audit
  • data
  • plugins
  • templates

Non-public endpoints require a Bearer session whose user has an active admin grant.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

plystra-1.0.0.dev2.tar.gz (12.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

plystra-1.0.0.dev2-py3-none-any.whl (5.9 kB view details)

Uploaded Python 3

File details

Details for the file plystra-1.0.0.dev2.tar.gz.

File metadata

  • Download URL: plystra-1.0.0.dev2.tar.gz
  • Upload date:
  • Size: 12.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.9

File hashes

Hashes for plystra-1.0.0.dev2.tar.gz
Algorithm Hash digest
SHA256 89ebacad93e4b17bedf7e3af15419272fd1b7d4d12ba95f1b2319d8e0b341c91
MD5 cd0413d4fea23d552fe009ed83cb9487
BLAKE2b-256 1e7859ba20b910c76fd933dfbe52f53bd0c706be239119fe99f60987907a2f97

See more details on using hashes here.

File details

Details for the file plystra-1.0.0.dev2-py3-none-any.whl.

File metadata

  • Download URL: plystra-1.0.0.dev2-py3-none-any.whl
  • Upload date:
  • Size: 5.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.9

File hashes

Hashes for plystra-1.0.0.dev2-py3-none-any.whl
Algorithm Hash digest
SHA256 3c670b582a39a869431d014ad12378fb3bab7d0cd8798686c5994b026124316e
MD5 4213b921429e00e82f90c2f6e771fcde
BLAKE2b-256 4cb71ab4557d215089fd27760e5a5a53f566755d4c1c34f3766631c0a8d44976

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page