Python REST API Frontend
Project description
restfull 1.0.13
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
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
restfull-1.0.13.tar.gz
(7.2 kB
view details)
Built Distribution
File details
Details for the file restfull-1.0.13.tar.gz
.
File metadata
- Download URL: restfull-1.0.13.tar.gz
- Upload date:
- Size: 7.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.3 CPython/3.12.7 Darwin/24.0.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b6a62941bbf73b43abee1cb33bbc8f84f82ae5e1ed751c1ecc6cec69ddd6c1e8 |
|
MD5 | b2f10f56780d09cef5fc0b93f160e370 |
|
BLAKE2b-256 | 92d8103c73be283eb0763f1abf71b11d1680ce0459a0f02e40d05b3859ad1816 |
File details
Details for the file restfull-1.0.13-py3-none-any.whl
.
File metadata
- Download URL: restfull-1.0.13-py3-none-any.whl
- Upload date:
- Size: 8.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.3 CPython/3.12.7 Darwin/24.0.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | bb2831d594b991585bbc464db1fb5fe1d17168c945bc031d29562e91c4b0a826 |
|
MD5 | 64cd394d67b469a986d12e77e1b88e10 |
|
BLAKE2b-256 | eb3688e7b120a21df24dbcb124fc15cb4a64d86457d24c18e64ca7bbae461e54 |