SDK for calling running http service of puan-server-db
Project description
Puan Client DB
A small tool for calling a running puan-server-db
http service.
Install
pip install puan-client-db
Quickstart
import puan.logic.plog as pg
from puan_client_db import Client
# create a client
client = Client("http://localhost:8000") # we run a service on our local machine on port 8000
# create a puan model (pip install puan)
model = pg.All(
pg.Xor(*"xyz"),
pg.Imply(
pg.Any(*"AB"),
pg.All(*"ijk")
)
)
# store the model by commiting it into the service
# This will commit to a new model with default branch name (usually "main" but depends on backend config)
# (second parameter returned is an error)
sha_first, _ = client.commit(model)
# ... and we later made some changes
model = model.assume({"i": 1}) # this fixes `i` to always be set to 1/True
# then made another commit
client.commit(model)
# some time later we want to checkout the first commit
# (second parameter returned is an error)
model_first, _ = client.checkout(sha_first)
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
puan-client-db-0.0.3.tar.gz
(6.9 kB
view hashes)
Built Distribution
Close
Hashes for puan_client_db-0.0.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a49ec0c88e0c96cedef1e30a70069b837f40744824fef729653dd528bca8e5e3 |
|
MD5 | cb19d85375e11cdaa5a62d842e841189 |
|
BLAKE2b-256 | 8f9dcfe766928d906db88a0dfdb9d898d669975c38e17f0a5638dd59bcacdff3 |