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

How to implement appendable list of embedded objects

I'm attempting to use Eve to provide an RESTful API for a simple list of items. I'd like to use 1) one HTTP request to create a list (possibly with initial items), 2) one HTTP request to add an item(s) (a common operation), 3) one HTTP request to…
jrc
  • 20,354
  • 10
  • 69
  • 64
5
votes
2 answers

Multiple "where clauses" in endpoint query string parameters

Can I include multiple "where" clauses (or an AND operator) in an endpoint query string? I'd like to do something like this: http://localhost:5000/regions?where=name=="El Salvador"&where=lang=="es" I've tried few different syntaxes, but I can't get…
PachinSV
  • 3,680
  • 2
  • 29
  • 41
5
votes
2 answers

gunicorn fails to launch python-eve

Here's settings.py root@00d72ee95c2d:/var/www/eve-auth# cat settings.py DOMAIN = {'people': {}} And here's run.py from eve import Eve app = Eve() if __name__ == '__main__': app.run() It works when I run it…
holms
  • 9,112
  • 14
  • 65
  • 95
5
votes
1 answer

Python Eve, SQLalchemy and ForeignKey

I am working in a Python Eve based RESTful service with a SQLAlcemy backend. I have two models with a one to many relationship: class User(CommonColumns): """Model of an user in the database""" __tablename__ = "user" id =…
chaos.ct
  • 1,001
  • 1
  • 7
  • 18
5
votes
3 answers

Serve static files with Eve

I am running Flask and Eve on localhost at a same time. The Flask app serves static files and makes requests to the Eve app to get some data. I want to run Eve only, without a separate Flask app. How can I serve static files with Eve?
user3458284
  • 113
  • 1
  • 9
5
votes
1 answer

Requesting list of embedded objects

I have items endpoint which contains a list of embedded images. The scheme looks like: _schema = { 'name': required_string, # group name 'description': { 'type': 'string', 'maxlength': 140, }, 'images': { …
5
votes
1 answer

In Eve, how can you make a sub-resource of a collection and keep the parent collections endpoint?

I want these three endpoints: /games /images /games//images Here's an excerpt from my settings.py file #... games = { "schema": { "title": { "type": "string", "required": True }, "name":…
sam
  • 77
  • 4
4
votes
0 answers

Why Python-Eve does not overwrites Flask JSON encoder

When initializing Eve one can specify a custom made json encoder, like it is specified in the documentation here, you can make something like: from eve.io.base import BaseJSONEncoder class CustomJSONEncoder(BaseJSONEncoder): ... app =…
hectorcanto
  • 1,987
  • 15
  • 18
4
votes
1 answer

connect docker container with python-eve app to docker container with mongodb

I am following this tutorial on python-eve. I use docker container for mongodb and python3 for eve. It works fine if I use venv for the eve app, but I cannot connect to the mongo container, if I run my eve app in another docker container. I always…
user1329187
4
votes
1 answer

Python Eve - How to filter by datetime value

How can I return items filtered by date or date interval? I was trying something like this based on the filtering example from eve's documentation: /records/?where={"date": {"$gte": "2016-10-17"}} I was thinking this python syntax could work too…
gcw
  • 1,639
  • 1
  • 18
  • 37
4
votes
0 answers

python-eve custom media storage file upload not working

I am trying to build a python-eve REST API with mysql backend and I would like to have a custom mediastorage backend. Basicly I want the filenames saved into database and files in filesystem. Here is a draft of the mediastorage based on the GridFS…
4
votes
3 answers

Trouble with CORS using Eve and AngularJS

I'm developing an app using an API in Eve and AngularJS. To avoid CORS issue, I made a simple NodeJS server to serve my static files. However, even after allowing All domains on my Python Eve API by writing 'X_DOMAINS': '*' (I tested with Curl and…
Manuel Lemaire
  • 117
  • 1
  • 5
4
votes
3 answers

Python-Eve: Use Pre-Request Event Hooks to modify data before inserting to DB

I am adding new data into my Database by doing a POST-request on my eve-API. Since there need to be added some data from the Python side I thought I could add these data by using a pre-request event hook. So is there a way to modify the data…
albert
  • 8,027
  • 10
  • 48
  • 84
4
votes
1 answer

Unit Test cases for Python Eve Webservices

We have developed the APIs using the python eve framework . Is there a way we can write the unit test cases for the APIs we have developed in EVE. Is there a Unit Test case component bundled into Python EVE.I need to bundle them with my Continuous…
tushar_sappal
  • 308
  • 4
  • 16
4
votes
1 answer

How to create new user accounts in python eve api secured with User-Restricted Resource Access

I first created a web api using the python-eve framework, without authentication or user accounts, and it worked great! I am now trying to add authentication and user accounts, and am having some difficulty. I want to use User-Restricted Resource…
jenkitay
  • 43
  • 7
1
2
3
32 33