Create an API using Eve in Python

/Users/jitsejan/code  $ mkdir eve-api
/Users/jitsejan/code  $ cd eve-api/
/Users/jitsejan/code/eve-api  $ python3 -m pip install eve
/Users/jitsejan/code/eve-api  $ touch
/Users/jitsejan/code/eve-api  $ sublime

from eve import Eve
import settings

app = Eve(settings=settings.settings)

if __name__ == '__main__':
/Users/jitsejan/code/eve-api  $ touch
/Users/jitsejan/code/eve-api  $ sublime

character = {
    'schema': {
        'name': {'type': 'string'},
        'color': {'type': 'string'},
        'superpower': {'type': 'string'},

settings = {
    'MONGO_HOST': 'localhost',
    'MONGO_DBNAME': 'nintendo-database',
    'MONGO_USERNAME': 'db-user',
    'MONGO_PASSWORD': 'db-pass',
    'DOMAIN': {
        'character': character,
/Users/jitsejan/code/eve-api  $ python

Use Postman to connect to localhost:5000 and start using your API. Since the character schema has been defined, the characters are listed on localhost:5000/character. You can simply search by name and only retrieve a specific field using additional parameters.

localhost:5000/character?where={"name": "Mario"}&projection={"name": 1, "superpower":1}