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 RequestHandler
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
File details
Details for the file objectrest-2.0.0.tar.gz
.
File metadata
- Download URL: objectrest-2.0.0.tar.gz
- Upload date:
- Size: 24.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.8.14
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0426aa36e88a44971d995633b75d466ea293062715df18005dc10d9aac2b3d85 |
|
MD5 | 669ef63acc0232e3bb950540424c1081 |
|
BLAKE2b-256 | fbc0dbd92b095e254e738326c8e89531b36cf1ed137790a21ef9b5aa4be4235f |
File details
Details for the file objectrest-2.0.0-py3-none-any.whl
.
File metadata
- Download URL: objectrest-2.0.0-py3-none-any.whl
- Upload date:
- Size: 27.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.8.14
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | aedcdc35d8e8288522ebe6d3c44d2691c4ee22f3c9e1e05c78bedfb603873277 |
|
MD5 | 19dff47ada5fe8183bfeafd64440e646 |
|
BLAKE2b-256 | 072adbc10e57eeb0c84068d4824e4080dba2872b79fdeb46e43158385834e885 |