paya
A minimum rest client based on deboa http client for rust
Installation
pip install paya
Usage
import asyncio
import json
import paya
from paya import send
async def main():
req = paya.Paya("https://jsonplaceholder.typicode.com").get("/todos/1")
res = await send(req)
data = json.loads(res.body())
print(data)
req = (
req.post("/posts")
.header("Content-Type", "application/json")
.body(
json.dumps(
{"title": "Some title", "body": "Some body", "userId": 1}
).encode("utf-8")
)
)
res = await send(req)
data = json.loads(res.body())
print(data)
req = req.delete("/posts/1")
res = await send(req)
data = json.loads(res.body())
print(data)
asyncio.run(main())
License
MIT
Author
Rogerio Pereira Araujo rogerio.araujo@gmail.com
Metadata
Release files for paya 0.1.4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| paya-0.1.4.tar.gz | 14.8 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| paya-0.1.4-cp312-cp312-manylinux_2_34_x86_64.whl | CPython 3.12 | CPython 3.12 | Linux glibc 2.34+ x86-64 | Details |
Total release size: 3.4 MB
Release files / paya-0.1.4.tar.gz
| Download URL | paya-0.1.4.tar.gz |
|---|---|
| Size | 14.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
7c7fea15800ef5fdfc1bd390fe1163175a30b4be3d8e8ced53e9cee40030d106
|
|
BLAKE2b-256 checksum How to use checksums |
5eeb33dfe2aba32b107bca64c35bea49efb71db7f5a373a54d9941d2506dd6bf
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
maturin/1.10.1
|
Release files / paya-0.1.4-cp312-cp312-manylinux_2_34_x86_64.whl
| Download URL | paya-0.1.4-cp312-cp312-manylinux_2_34_x86_64.whl |
|---|---|
| Size | 3.4 MB |
| Tags | CPython 3.12 Linux glibc 2.34+ x86-64 |
|
SHA-256 checksum How to use checksums |
9c22b371c57e0e3e9717faf121a913c910d46c97122bcdb94c052c80f218dba1
|
|
BLAKE2b-256 checksum How to use checksums |
8ba73d32218e8bb424dc6042b8cec5482705df01e194bade247e04b46cc73f7e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
maturin/1.10.1
|