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
2
votes
0 answers

Gunicorn error with running python eve server

I'm running an API written in python and deployed in Eve server. Further, I'm trying to run with gunicorn(production). The command I have run is gunicorn wsgi:app --preload -w 4 -b 0.0.0.0:7000 and it works as expected. Further, when we run this…
Eswar
  • 1,201
  • 19
  • 45
2
votes
0 answers

How to modify python eve request in pre_ hooks

I need to ensure that whenever a user makes a GET request on a resource, it always includes a particular field called "_mes". This becomes a problem when user specifies a projection, so I am trying to always add it app.on_pre_GET_my_resource =…
Mayday
  • 4,680
  • 5
  • 24
  • 58
2
votes
1 answer

cerberus.schema.SchemaError: {'uuid': [{'query_objectid_as_string': ['unknown rule']}]}

Eve API. I need to filter records by where={"uuid": "my_uuid"}. So my 'settings.py' for the Eve application contains: 'schema': { 'uuid': { 'type': 'string', 'required': True, …
Alex
  • 98
  • 7
2
votes
1 answer

Enabling rate limiting in Eve

I have been looking to enable the Rate Limiting feature with Eve, but have found very little documentation or examples on how to completely enabled it. I have added the RATE_LIMIT_GET and other configuration options for HTTP verbs and passed the…
SamS
  • 61
  • 4
2
votes
0 answers

EVE REST API - get random item from endpoint

How I can get one random item from endpoint using EVE REST API? Is it possible? I tried ?sort=rand but without success and I have no idea how to use $sample variable in EVE's REST query.
2
votes
2 answers

Time only field in Python Eve

I want to store time fields in Eve's schema. For example I would like to have a start_time field and end_time field. But Python Eve only provides datetime type. Is there any way to store a time in Python Eve, as I don't want Date included in the…
d3corator
  • 1,154
  • 1
  • 9
  • 23
2
votes
2 answers

how to request multiple values from same key using eve

I have an eve app running on my mongodb collection col10. I am trying to get a response where I have multiple values selected from the same key, example: http://127.0.0.1:4567/col10?where={"var0053":[1130,1113]} ## returns 0 objects I have also…
motipai
  • 328
  • 3
  • 10
2
votes
0 answers

Define multiple sources/collection in a datasource in Eve

Is it possible in Eve to get data from multiple sources/collection to be define in one datasource and used by one endpoint. The usual endpoint definition looks like this: endpoint = { 'item_title': 'title', 'resource_methods': ['GET'], …
Kumar Vikramjeet
  • 253
  • 1
  • 4
  • 13
2
votes
0 answers

How to upload file, using curl, to python-eve field that is inside a dict type

I try to figure out if I can upload media files, using curl (or anything else really), to python-eve field that is inside a dict type. The documentation, http://docs.python-eve.org/en/latest/features.html, only have the simple example of accounts =…
eigil
  • 1,172
  • 2
  • 12
  • 23
2
votes
1 answer

Validations with the SQLAlchemy version of Python Eve

I'd like to use the Eve framework for creating a REST api and performing data validations. But I want to use the SQLAlchemy version of Eve with an rdbms back end. The Eve-SQLAlchemy documentation says nothing about how to do this. For example, I…
Peter Swords
  • 489
  • 6
  • 17
2
votes
0 answers

Python eve: allow_unknown keys with 'datetime' values in embedded schema

I want to have a dictionary with different keys but with datetime value. I have defined my schema as follows: schema = { 'entries': { 'type': 'dict', 'allow_unknown': True, 'schema': { 'entry': {'type':…
Ernest
  • 186
  • 10
2
votes
0 answers

Projection on nested fields in Python Eve

I want to exclude some nested field with the projection es: http://eve-demo.herokuapp.com/people?projection={"location.address":0} but it returns all fields. <_created>Tue, 18…
pCrist001
  • 21
  • 2
2
votes
0 answers

on_fetch_item_resource returns nothing

I want to modify something with database hook, but I think on_fetch_item not working for me. Here is my code: def before_returning_contract(response): print('About to return a contact') if __name__ == '__main__': …
yigitozmen
  • 947
  • 4
  • 23
  • 42
2
votes
1 answer

Filtering on embedded document with Python Eve Rest and Mongo

I want to filter something by embedded document's property. But I couldn't achieve this. http://localhost:5000/vehicle?embedded={"model.brand":1}&where={"model.brand":"5bf3f02e63da120b27dc74b1"} Is there any way to make this query? I didn't find…
yigitozmen
  • 947
  • 4
  • 23
  • 42
2
votes
1 answer

Eve (Flask) app responds with no content to uWSGI

I have very simple application with two resources leveraging the Eve framework, which is in turn based on Flask. TL;DR: The built in WSGI works fine, but uWSGI is not receiving content from the script. Am I configuring the WSGI correctly to…