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:
systemauthactoradminusersspacesgroupsmembersuser_membersrolesmember_rolespermissionsrole_permissionsresource_typesresourcesauthzauditdatapluginstemplates
Non-public endpoints require a Bearer session whose user has an active admin grant.
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
plystra-1.0.0.dev2.tar.gz
(12.4 kB
view details)
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-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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
89ebacad93e4b17bedf7e3af15419272fd1b7d4d12ba95f1b2319d8e0b341c91
|
|
| MD5 |
cd0413d4fea23d552fe009ed83cb9487
|
|
| BLAKE2b-256 |
1e7859ba20b910c76fd933dfbe52f53bd0c706be239119fe99f60987907a2f97
|
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3c670b582a39a869431d014ad12378fb3bab7d0cd8798686c5994b026124316e
|
|
| MD5 |
4213b921429e00e82f90c2f6e771fcde
|
|
| BLAKE2b-256 |
4cb71ab4557d215089fd27760e5a5a53f566755d4c1c34f3766631c0a8d44976
|