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
4
votes
1 answer

Eve Exception: duplicate config_prefix "MONGO"`

from views import app mongo = PyMongo(app) print mongo.db.activity.count() Since I'm trying to use Pymongo count() and it raises File "Z:\Activities\modules.py", line 9, in set_id mongo = PyMongo(app) File…
Gladuo
  • 77
  • 9
4
votes
2 answers

File upload to python-eve using requests

I'm trying to upload a picture to a python-eve server using the requests library. In order to do that, I send a multipart/form-data request. This seems to be a problem for my schema, which looks like this: schema = { 'name': { 'type':…
fsiddi
  • 101
  • 6
4
votes
0 answers

What is the best way to support several API versions when using Python Eve?

I'm thinking of using Eve for the new project that I'm working on, but there's a requirement that there should be a way to introduce new API versions while still keeping the old ones. After reading the Eve documentation, I see that it doesn't really…
Exander
  • 852
  • 1
  • 7
  • 17
4
votes
2 answers

Python Eve contains filter

There's some way to return items that field contains some value? Eg. GET /people?contains="foo" Return all persons that have the word 'foo' in the name. Thanks in advance
Rodrigo
  • 135
  • 4
  • 45
  • 107
4
votes
1 answer

Running Python Eve Rest API in Production

It is no time to move my Python Eve Api into a production environment. There are several ways to do this and the most common requirements are: Error Logging Automatic Respawn Multiple Processes (if possible) The best solution I found is to have a…
Simon Fakir
  • 1,712
  • 19
  • 20
4
votes
2 answers

How to return a more meaningful 500 error in a python-eve app

I have some code in a python-eve app that retrieves some data from a device and populates a resource when that resource is requested for the first time. Sometimes the code can't successfully connect to the device. In this case, I would like to…
cayblood
  • 1,838
  • 1
  • 24
  • 44
4
votes
1 answer

About using eve for python framework in google app engine

Just came to know about a project named python-eve. As I'm just starting out in python, this project seemed kinda easy to get started for building a python based REST API. This framework really has a lot of features out of the box, specifically…
Soham Dasgupta
  • 5,061
  • 24
  • 79
  • 125
4
votes
2 answers

ConnectionException connecting a Eve REST API to a MongoDB instance

I just installed the 'eve demo' I can't get it to start working. The error is: eve.io.base.ConnectionException: Error initializing the driver. Make sure the database serveris running. Driver exception: OperationFailure(u"command…
3
votes
1 answer

Python Eve - REST API additional_lookup not working

I am facing the exact same issue that is described here. I have user_creds endpoint for my API. When I visit localhost:5000/user_creds/, I can see all the documents in that collection. But when I do something like…
Stupid Man
  • 885
  • 2
  • 14
  • 31
3
votes
1 answer

Python-eve: Is the schema respected when directly updating using current_app.data.driver.db[collection].update_one()?

I have a few deprecated custom endpoints in my application to support migration from an old API to Eve. One of my custom endpoints implements an endpoint for updating documents in the MongoDB database. The collection associated with those…
Vorticity
  • 4,582
  • 4
  • 32
  • 49
3
votes
0 answers

How do we use python-eve @requires_auth decorator on custom endpoints?

Following the examples from Nicola https://nicolaiarocci.com/building-custom-endpoint-handlers-with-eve/ regarding requires_auth decorator, I cannot get it to work as intended and I need some help. Essentially, it appears to work for the default…
rick
  • 163
  • 4
3
votes
2 answers

Can I dynamically create db instances for use with mongo_prefix?

mongo_prefix looks ideally designed for simple and effective data separation, it seems though you need to pre-define your available prefixes in settings.py. Is it possible to create a new prefix dynamically - for example to create a new instance per…
Dnsk
  • 51
  • 5
3
votes
0 answers

Is there a way to connect an Eve instance to a Compose mongo cluster over SSL?

I didn't see any Eve documentation on connecting to multiple hosts or using ssl. Attempted to use some examples from pymongo but still no luck. I was however able to connect to the instance using only pymongo. Has anyone else dealt with this…
CloudyHLS
  • 53
  • 3
3
votes
1 answer

Eve with Postman "must be of list type" error

I have an eve schema set up as such: schema = { "month": { "type": "datetime", "required": True, }, "test": { "type": "list" }, } And I'm using postman to make a post request: I'm at a bit of a loss here as to why I'm getting…
Luc Gendrot
  • 806
  • 9
  • 11
3
votes
1 answer

Python Eve Conditional / Bulk Delete

From Nicola's SO answer here and my own testing it seems clear that Eve does not support conditional deletes at resource endpoints. I know I could use a GET: "where={...}" request to the _ids and _etags of the documents I would like to delete, and…
1 2
3
32 33