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.
-
Clone this repository
git clone https://github.com/davidthewatson/postgrest_python_requests_client.git
-
Install requirements
pip install -r requirements.txt
-
Copy config.in to config.py
cp config.in config.py
-
Edit credentials and urls in config.in to suit
vi config.py
-
Save config.py
[esc]:wq
-
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