This release is a pre-release and may not be stable for production use.
spicedb-python
An unofficial SpiceDB client for Python.
pip install spicedb
Note that this is a very unstable package and the API is subject to change.
Getting started
Initialize the client:
from spicedb import SpiceDB, SpiceRelationship
client = SpiceDB("https://api.spicedb.example.net/", "API_KEY")
Set up a schema:
await client.write_schema("""
definition user {}
definition team {
relation admin: user
relation member: user
}
definition project {
relation parent: team
permission view = parent->member
permission edit = parent->admin
}
""")
Create some relationships:
alice = {"type": "user", "id": "alice"}
bob = {"type": "user", "id": "bob"}
team = {"type": "team", "id": "acme-co"}
cool_project = {"type": "project", "id": "cool_project"}
await client.bulk(
create=[
SpiceRelationship(team, "parent", cool_project),
SpiceRelationship(alice, "admin", team),
SpiceRelationship(bob, "member", team),
],
)
Check permissions:
await client.authorize(alice, "edit", cool_project) # => True
await client.authorize(bob, "edit", cool_project) # => False
List resources:
await client.list(alice, "edit", "project") # => ["cool_project"]
Metadata
Release files for spicedb 0.1.0a2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| spicedb-0.1.0a2.tar.gz | 8.1 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| spicedb-0.1.0a2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 17.6 kB
Release files / spicedb-0.1.0a2.tar.gz
| Download URL | spicedb-0.1.0a2.tar.gz |
|---|---|
| Size | 8.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
d7a116cdace39bc79c11b938099607d6fa4e23784ada02b6f480856505a961d8
|
|
BLAKE2b-256 checksum How to use checksums |
463455fd8153805d83f7a85c49e8fb76acb73b1cdaf8fc6a98aff9c45f4cb5e4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.8.2 CPython/3.12.3 Linux/6.8.10-400.asahi.fc39.aarch64+16k
|
Release files / spicedb-0.1.0a2-py3-none-any.whl
| Download URL | spicedb-0.1.0a2-py3-none-any.whl |
|---|---|
| Size | 9.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
dd53dfa3831674a0310e8da840b56b61e9ae90b6f9b6e85aaa0886525d4455eb
|
|
BLAKE2b-256 checksum How to use checksums |
de275a51d0de947ad3dd3df88d054e9d1c75b8361257c3cf4f32533cb89acb49
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.8.2 CPython/3.12.3 Linux/6.8.10-400.asahi.fc39.aarch64+16k
|
Security for spicedb 0.1.0a2
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.
No provenance found
None of the files in this release were uploaded with provenance metadata.
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.