REST API in Google App Engine + Python?

TeknasVaruas picture TeknasVaruas · Oct 15, 2013 · Viewed 18.3k times · Source

How create a RESTful API using Google App Engine with Python? I've tried using Cloud Endpoints, but the documentation does not focus on a RESTful API. Is there something similar to django-tastypie for GAE?

Answer

lucemia picture lucemia · Oct 15, 2013

The RESTful api can be build based on EndPoint API. There are some tools can help you make things easier:

appengine rest server (not based on endpoints)

Drop-in server for Google App Engine applications which exposes your data model via a REST API with no extra work.

https://code.google.com/p/appengine-rest-server/

Another one is based on endpoints

By extending the functionality provided by ndb.Model class and the endpoints library, this library allows you to directly interact with model entities in your API methods rather than ProtoRPC requests. For example, instead of:

https://github.com/GoogleCloudPlatform/endpoints-proto-datastore

EDIT1:

I wrote a RESTFul api generator for endpoints.

# generate restful api in one line
BigDataLab = EndpointRestBuilder(GPCode).build(
    api_name="BigDataLab",
    name="bigdatalab",
    version="v1",
    description="My Little Api"
)

repo: https://github.com/Tagtoo/endpoints-proto-datastore-rest