Skip to main content

Python REST API Frontend

Project description

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

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

restfull-2.0.1.tar.gz (129.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

restfull-2.0.1-py3-none-any.whl (9.0 kB view details)

Uploaded Python 3

File details

Details for the file restfull-2.0.1.tar.gz.

File metadata

  • Download URL: restfull-2.0.1.tar.gz
  • Upload date:
  • Size: 129.2 kB
  • Tags: Source
  • Uploaded using 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

File hashes

Hashes for restfull-2.0.1.tar.gz
Algorithm Hash digest
SHA256 f42217eae0ea1fcd967080b1bd71ac7d1ae42395c58dafe91f2d5ab66e56eac8
MD5 f4ac51fec4af239c10e3e32e8377062c
BLAKE2b-256 ecde753db7de64902b9cad602ab9215639e343ffdfc6ca4c98a593f0563fb595

See more details on using hashes here.

File details

Details for the file restfull-2.0.1-py3-none-any.whl.

File metadata

  • Download URL: restfull-2.0.1-py3-none-any.whl
  • Upload date:
  • Size: 9.0 kB
  • Tags: Python 3
  • Uploaded using 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

File hashes

Hashes for restfull-2.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 dd9e51ee8e3b5647ab6ae3b044239527a358c1c1790ab5310cae995c4cfd6e5d
MD5 4819c6f1364261fd24c25134362eb6ed
BLAKE2b-256 996ca311518363313f834cede30a81832a5732a3849a0f87449a01a396b19a26

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page