A Python package to handle REST API requests, JSON parsing, and pydantic object generation.
Project description
ObjectREST
A Python package to handle REST API requests, JSON parsing, and pydantic object generation.
Installation
From PyPi: python -m pip install objectrest
From GitHub python -m pip install git+https://github.com/nwithan8/objectrest.git
Usage
This package acts as a middle-man between the user and the Requests library.
Users can call to methods directly, or use the RequestHandler class to set universal parameters (i.e. API tokens), universal headers and/or a universal base URL for all requests
Users can retrieve the raw request, the JSON data from a request, or have the JSON data automatically parsed into a Pydantic model.
Example:
from objectrest import requests
requests = requests.RequestHandler(base_url="http://rootoftheapi", universal_parameters={'api_key': "thisisanapikey"})
my_object = requests.get_object(url="/object", model=MyObjectClass, params={"limit": 10})
Documentation
Documentation available on ReadTheDocs
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
Built Distribution
Hashes for objectrest-0.3.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 53211343adcd1b55fb2045924b370756c6160e3e0ecc93e8909dd3d7607a48bc |
|
MD5 | 603438b744bd4f165886dc7cb84100e3 |
|
BLAKE2b-256 | 34a2761e0457b3fc81ce868a4c33736521faf13280f775bf5eb3c099feeb8648 |