restfull 2.0.1
Installing
$ pip install restfull
Usage Examples
Basic API GET:
auth = BasicAuth("username", "password")
rest = RestAPI(auth, "example.com")
endpoint = "/api/users/1"
data = rest.get(endpoint).validate().as_json().record()
assert data.get("data", {}).get("id") == 1
Get record with paged API (specifically getting page 2)
auth = BasicAuth("username", "password")
rest = RestAPI(auth, "example.com")
endpoint = "/api/users"
data = rest.get_by_page(endpoint, page=2).validate().as_json("data").list_item(2)
assert data.get("id") == 9
Get all records from paged API (assumes records are in an array assigned to the "data" key):
auth = BasicAuth("username", "password")
rest = RestAPI(auth, "example.com")
endpoint = "/api/users"
data = rest.get_paged(endpoint).validate().json_list()
assert data.size == 12
Release files for restfull 2.0.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| restfull-2.0.2.tar.gz | 129.3 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| restfull-2.0.2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 138.3 kB
Release files / restfull-2.0.2.tar.gz
| Download URL | restfull-2.0.2.tar.gz |
|---|---|
| Size | 129.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
fc93bb014a66c89aa5187d26793f2c0546f8efaab0cfebfb50346c1d886f3576
|
|
BLAKE2b-256 checksum How to use checksums |
15705b5ccf2709063bc013a7794f39f10cdc4f5de7702ca31cb0d99c259cd1d1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
Hatch/1.17.1 {"ci":null,"cpu":"arm64","distro":{"name":"macOS","version":"26.5.2"},"implementation":{"name":"CPython","version":"3.12.10"},"installer":{"name":"hatch","version":"1.17.1"},"openssl_version":"OpenSSL 3.0.16 11 Feb 2025","python":"3.12.10","system":{"name":"Darwin","release":"25.5.0"}} HTTPX2/2.5.0
|
Release files / restfull-2.0.2-py3-none-any.whl
| Download URL | restfull-2.0.2-py3-none-any.whl |
|---|---|
| Size | 9.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
dbf683c9b479b20232d01886388f3006b406ec4e5cd12fc20ebce13e394bff45
|
|
BLAKE2b-256 checksum How to use checksums |
45e66b6c2c8c9f5b1daa48b149322338826b9671950bd6d34552b2902f65876c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
Hatch/1.17.1 {"ci":null,"cpu":"arm64","distro":{"name":"macOS","version":"26.5.2"},"implementation":{"name":"CPython","version":"3.12.10"},"installer":{"name":"hatch","version":"1.17.1"},"openssl_version":"OpenSSL 3.0.16 11 Feb 2025","python":"3.12.10","system":{"name":"Darwin","release":"25.5.0"}} HTTPX2/2.5.0
|