A generic python REST client
Reason this release was yanked:
premature release
Project description
A Python project for sending requests to REST APIs.
Overview
This project aims to build ORM wrappers around REST interfaces, by separating the configuration from the business logic. For
For example, taking the JSONplaceholder test site, there is a URL http://https://jsonplaceholder.typicode.com/posts?userId=1
To query this rsource, some text formatting magic needs to be combined with the requests module, after which the results need to be parsed.
An easier solution
Would it not be a lot easier to use this format
import jsonplaceholder as jp list_of_pots = jp.filter_posts.fetch(user_id=1) print list_of_posts
To achieve this, we need only this code:
from rest_client import API, APIConfig class JsonPlaceHolderConfig(APIConfig): url = 'https://jsonplaceholder.typicode.com' filter_posts = ResourceConfig(path=['posts'], method='GET', description='retrieve all posts by filter criteria', parameters={ 'user_id': QueryParameter(name='userId', required=False, description='the user Id that made the post'), } ) config = JsonPlaceHolderConfig() jp = API(config) list_of_pots = jp.filter_posts.fetch(user_id=1)
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
qrest-3.0.0.tar.gz
(20.4 kB
view hashes)
Built Distribution
qrest-3.0.0-py2.py3-none-any.whl
(32.7 kB
view hashes)
Close
Hashes for qrest-3.0.0-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 018e00a59390f69d3e2c2e4685ddf77398a257c5c8646320bf6923af0f3caf40 |
|
MD5 | d55bb8df9118831c287dd79e75742652 |
|
BLAKE2b-256 | 48abf65658d6bb9fa279bff6bf5a159fda69a69376d532ce6057641cd5aecc9c |