Instant Rest Api Written in Python

Why would you need an Instant Rest API?

  • You are developing a client side application that doesn’t have a server yet
  • You are trying out a new library and you want to see if it plays nice
  • You are preparing a demo that needs a simple server and don’t want to trouble yourself with actually building one
  • You are doing testing on some system and need a stub

If you need it you can get it here.

Is It Really Instant?

Basically, you just define the objects you want to have in your rest api and start the server.
 It can take you under a minute if you are really fast.

How To Use

First, clone the repository:

$ git clone https://github.com/asafg6/instant-rest-api.git

I usually use virtualenvwrapper, but this is optional.

If you don’t have it and want to install it go here. If you have it:

$ mkvirtualenv -p python3 instant-api

Instant Rest Api is built with falcon so it has to be installed.

Install the dependencies:

$ cd instant-api $ pip install -r dependencies.txt

Let’s say we want our model to be “Dog”. so — the properties that it will have are: name, breed, color, age.

Let’s add our new model to user_models.py.

user_models.py

""" 
your models go here
example:
from model import InstantModel
class User(InstantModel):
name = ''
phone_number = ''
address = ''
age = 0
"""
from model import InstantModel
class Dog(InstantModel):
name = ''
breed = ''
color = ''
age = 0

Continue reading at https://www.turtle-techies.com/post/instant-rest-api-written-in-python

Originally published at www.turtle-techies.com.