Skip to main content

Python REST API Frontend

Project description

restfull 2.0.0

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.0.tar.gz (129.1 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.0-py3-none-any.whl (8.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: restfull-2.0.0.tar.gz
  • Upload date:
  • Size: 129.1 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.0.tar.gz
Algorithm Hash digest
SHA256 cc19b2039ec49c21c57cdd38c6d860452c4d5eb2027859fd94c7ccd67fcade83
MD5 2bc53211ac1782ecf8f927b6ba39fb19
BLAKE2b-256 eee251f0517fae47f1884bae315081488a92cdd838c8b16c9c0618e940711592

See more details on using hashes here.

File details

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

File metadata

  • Download URL: restfull-2.0.0-py3-none-any.whl
  • Upload date:
  • Size: 8.9 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.0-py3-none-any.whl
Algorithm Hash digest
SHA256 07e667fac714be877388e1ceeed4f99331f88d9e5a2ebe4ac59d3b7936685bde
MD5 52bb3072e851a903123c9c9a917774b2
BLAKE2b-256 3ebaa1a901be86460e991bc68b03bce7f1ae4ccc273f575d539cea6b4ff26ec2

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