Skip to content

Python REST Client Login, JWT Auth, and Pagination of result sets for any PostgREST server serving a PostgreSQL database

License

Notifications You must be signed in to change notification settings

davidthewatson/postgrest_python_requests_client

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PostgREST Python Client

This repository provides a generic python REST client for any PostgREST server with a PostgreSQL database behind it.

This client implements the following features:

  • Login
  • JWT Auth
  • HTTP GET
  • Pagination of result sets based on Content-Range header

PostgREST installation and configuration is beyond the scope of this document.

See http://postgrest.com/ for more information.

Installation and configuration

  1. Clone this repository

     git clone https://github.com/davidthewatson/postgrest_python_requests_client.git
    
  2. Install requirements

     pip install -r requirements.txt
    
  3. Copy config.in to config.py

     cp config.in config.py
    
  4. Edit credentials and urls in config.in to suit

     vi config.py
    
  5. Save config.py

     [esc]:wq
    
  6. Run

     python client.py
    

The example above uses python 3.5. You may have to edit the source to accommodate python versions < 3.5. For instance:

from __future__ import print_function

david watson

About

Python REST Client Login, JWT Auth, and Pagination of result sets for any PostgREST server serving a PostgreSQL database

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages