Client library for the Authzed service.
Project description
Authzed Python Client
This repository houses the Python client library for Authzed.
The library maintains various versions the Authzed gRPC APIs. You can find more info on each API on the Authzed API reference documentation. Additionally, Protobuf API documentation can be found on the Buf Registry Authzed API repository.
Supported API versions:
- v1alpha1
- v0
- arrakisclient (v0 Legacy ORM)
Installation
pip install authzed
Example
Everything API specific is in its respective authzed.api.VERSION module.
grpcutil contains functionality for making interacting with gRPC simple.
from authzed.api.v1alpha1 import Client, ReadSchemaRequest
from grpcutil import bearer_token_credentials
client = Client("grpc.authzed.com:443", bearer_token_credentials("mytoken"))
resp = client.ReadSchema(ReadSchemaRequest(object_definitions_names=["example/user"]))
print(resp.object_definitions)
If an event loop is running when the client is initialized, all functions calls are async:
import asyncio
from authzed.api.v1alpha1 import Client, ReadSchemaRequest
from grpcutil import bearer_token_credentials
async def async_new_client():
# Within an async context, the client's methods are all async:
client = Client("grpc.authzed.com:443", bearer_token_credentials("mytoken"))
resp = await client.ReadSchema(ReadSchemaRequest(object_definitions_names=["example/user"]))
print(resp)
loop = asyncio.get_event_loop()
try:
loop.run_until_complete(async_new_client())
finally:
loop.close()
Full Examples
Full examples for each version of the API can be found in the examples directory.
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 authzed-0.3.1.tar.gz.
File metadata
- Download URL: authzed-0.3.1.tar.gz
- Upload date:
- Size: 61.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.1 importlib_metadata/4.6.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.61.2 CPython/3.9.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
634d52d57c0312a2cdd0e92eb0e88bb50e294a3f6898a6b9546161b2d8b7cda2
|
|
| MD5 |
1a0a296b6e4d83dd606178858fd8b6f2
|
|
| BLAKE2b-256 |
5ef5c2e1c67c4c830dd0dba3d3769c43f90690df289ecda4170fd78d3041a46a
|
File details
Details for the file authzed-0.3.1-py3-none-any.whl.
File metadata
- Download URL: authzed-0.3.1-py3-none-any.whl
- Upload date:
- Size: 79.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.1 importlib_metadata/4.6.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.61.2 CPython/3.9.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
80eabc90f97f0b9408af1928267ef5cd8ac8c5a7a0c157b6f8969aac9c2c6e71
|
|
| MD5 |
de644e1be9c76c6333a1e125a229ca08
|
|
| BLAKE2b-256 |
84b020ba95a22fc39da4d4fb01ecd1add3c53654d130b9dd38028c4f88083b66
|