Background:
- Designing a RESTful Web API -- good high level resource (no pun intended)
- OpenStack SDKs
- Introduction to the OpenStack API
- OpenStack Python SDK
- API Creation on Full Stack Python
- FlaskRESTful documentation
- RESTful Web API with Python, Flask and MongoDB
Tutorials:
- Django REST Framework Tutorial
- Implement RESTful API with Python and Flask -- Example code
- Designing a RESTful API with Python and Flask -- Github repo
- Designing a RESTful API using Flask-RESTful
- REST API with Flask + MongoDB
- Creating a REST Api using Flask-Restful and MongoDB
- csvtojson Quick Start
- csvkit
Environment setup
$ conda install --name py36 flask
$ conda list -n py36
# packages in environment at /Users/jacobliberman/miniconda2/envs/py36:
#
aniso8601 1.2.1 <pip>
click 6.7 py36_0
flask 0.12.1 py36_0
Flask-HTTPAuth 3.2.2 <pip>
Flask-PyMongo 0.4.1 <pip>
Flask-RESTful 0.3.5 <pip>
itsdangerous 0.24 py36_0
jinja2 2.9.6 py36_0
markupsafe 0.23 py36_2
mkl 2017.0.1 0
mongodb 3.3.9 0
numpy 1.12.1 py36_0
openssl 1.0.2k 1
pep8 1.7.0 py36_0
pip 9.0.1 py36_1
pygame 1.9.3 <pip>
pymongo 3.3.0 py36_0
python 3.6.1 0
python-dateutil 2.6.0 <pip>
pytz 2017.2 <pip>
readline 6.2 2
setuptools 27.2.0 py36_0
six 1.10.0 <pip>
sqlite 3.13.0 0
tk 8.5.18 0
werkzeug 0.12.1 py36_0
wheel 0.29.0 py36_0
xz 5.2.2 1
zlib 1.2.8 3
$ source activate py36
$ python -V
Python 3.6.1 :: Continuum Analytics, Inc.
Six Design Rules for a REST system
- client-server
- stateless
- server indicates if requests are cacheable
- layered system -- intermediaries can respond instead of server without client interaction
- uniform interface
- optional -- servers can provide scripts or executables for clients to run in their context
REST was originally designed to fit the HTTP protocol.
In REST resources are represented as URIs.
Designing a REST API is an exercise in identifying resources to expose and writing request methods to affect them.