Questions tagged [eve]

Eve is a Python REST API framework powered by Flask and MongoDB.

Eve is a Python REST API framework powered by Flask and MomngoDB. Allows to effortlessly build and deploy highly customizable, fully featured RESTful Web Services.

Eve is Simple

from eve import Eve

app = Eve()
app.run()

The API is now live, ready to be consumed:

$ curl -i http://example.com/people
HTTP/1.1 200 OK

All you need to bring your API online is a database, a configuration file (defaults to settings.py) and a launch script. Overall, you will find that configuring and fine-tuning your API is a very simple process.

Eve is thoroughly tested under Python 2.6, 2.7, 3.3, 3.4 and PyPy.

Philosophy

You have data stored somewhere and you want to expose it to your users through a RESTful Web API. Eve is the tool that allows you to do so.

Eve provides a robust, feature rich, REST-centered API implementation, and you just need to configure your API settings and behavior, plug in your datasource, and you’re good to go. See Features for a list of features available to Eve-powered APIs.

API settings are stored in a standard Python module (defaults to settings.py), which makes customization quite a trivial task. It is also possible to extend some key features, namely Authentication and Authorization, Data Validation and Data Access, by providing the Eve engine with custom objects.

Documentation

See the Eve Website.

483 questions
3
votes
3 answers

Combination of two fields to be unique in Python Eve

In Python Eve framework, is it possible to have a condition which checks combination of two fields to be unique? For example the below definition restricts only firstname and lastname to be unique for items in the resource. people = { # 'title'…
Yogeswaran
  • 357
  • 1
  • 13
3
votes
0 answers

Using subresources in eve-sqlalchemy

I'm trying to build a RESTful API with eve-sqlalchemy. I would like to use the common pattern where I can access the resources…
blint587
  • 191
  • 1
  • 10
3
votes
2 answers

Python Eve - where clause using objectid

I have the following resource defined in settings.py, builds = { 'item_title': 'builds', 'schema': { 'sources': { 'type': 'list', 'schema': { 'type': 'objectid', …
Yogeswaran
  • 357
  • 1
  • 13
3
votes
1 answer

filename always null when post new media file

Always when I post a new media file the filename fildset in mongo is become null. I've used curl, postman and python requests library but always result is the same :( The definition in the settings.py are: EXTENDED_MEDIA_INFO = ['content_type',…
Anihur
  • 78
  • 4
3
votes
5 answers

Python Eve : No 'Access-Control-Allow-Origin' header is present on the requested resource

I have written an API using Python EVE framework. While trying to access the API from an AngularJS app it shows an error as shown below : XMLHttpRequest cannot load http://127.0.0.1:5000/user/jay3dec. Request header field Authorization is not…
iJade
  • 23,144
  • 56
  • 154
  • 243
3
votes
1 answer

Polymorphic types with python-eve

I would like to have an endpoint that validates against multiple schemas. I've read the docs and some of Eve's code but it's not immediately clear to me that this is possible. Here's a simple example of what I'd like to be able to do: POST…
pmdarrow
  • 734
  • 5
  • 14
3
votes
2 answers

Adding links to a python-eve API resource implementing HATEOAS

I am building an API using python-eve. My design is something simple, it has two resources, users and devices: /users[/ID] /users/ID/devices[/ID] The code is (settings.py) is: users_schema = { 'nickName': { 'type': 'string', 'required':…
MTG
  • 551
  • 3
  • 14
3
votes
0 answers

Angularjs + Python Eve Token based authentication

I am currently implementing a auth APIs for python EVE. There are quite a few projects around token based auth in Angularjs notably https://github.com/sahat/satellizer My question is, How could I integrate satellizer with Python Eve?
Gagandeep Singh
  • 5,755
  • 4
  • 41
  • 60
3
votes
1 answer

Writing tests for Python Eve RESTful APIs against a real MongoDB

I am developing my API server with Python-eve, and would like to know how to test the API endpoints. A few things that I would like to test specifically: Validation of POST/PATCH requests Authentication of different endpoints Before_ and after_…
322896
  • 956
  • 1
  • 9
  • 19
3
votes
2 answers

How to define the schema to make a list not allow empty?

In the python-eve REST API framework I define a list in a resource, the type of the list item is dict. And I don't want the list to be empty. So, how to define the schema? { 'parents' : { 'type' : 'list', 'schema' : { …
3
votes
1 answer

How to run Python Eve application on a different port

I'm trying to run this application on a different port(8080). I tried putting the port parameter but it doesn't seem to work. I'm getting a 404 page, but when i switch port to 5000, I encounter no problem. from eve import Eve app =…
olleh
  • 1,248
  • 5
  • 16
  • 43
3
votes
1 answer

submit request (post) internally in python-eve

I have a resource in eve e.g. ABC, I want to manipulate another resource e.g. BCD when some condition meet while I am posting a new item to ABC, I know I can hook the event for post/pre_POST_ABC but is there a 'internal' way to do post on BCD…
John
  • 2,107
  • 3
  • 22
  • 39
3
votes
1 answer

Organising REST API web service build using Python Eve

I am trying to build a REST API web service using Python Eve. I have experience in using Lithium (PHP framework) and Ruby on Rails but I am struggling to figure out the proper folder structure to use with Python Eve. Any suggestion on where to put…
kobra
  • 4,853
  • 10
  • 32
  • 33
2
votes
1 answer

How to add MongoDB Atlas URI to Python Eve application

I am trying to connect MongoDB Atlas Cluster using Python Eve Framework. However, It keeps giving me Authentication error when I have provided both username and password. Here is my settings.py MONGO_URI =…
Yash
  • 223
  • 2
  • 11
2
votes
1 answer

Workaround the lack of the date (not datetime) type on Python Eve?

According to Python Eve's documentation on schema definition, it currently comprehends the following types: string, boolean, integer, float, number (integer and float values allowed), datetime, dict, list and media. This means that there is no…