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

How to make sub document unique

I define a schema like { 'info' : { 'type' : 'dict', 'unique' : True, 'schema' : { 'propertyA' : {'type':'string'}, 'propertyB' : {'type':'string'}, 'propertyC' : {'type':'string'} …
0
votes
1 answer

How to sort from the field of embedd document

There are two documents product : { name : string, price : integer } score : { product_id : { 'type': 'objectid', 'required': True, 'data_relation' : { 'resource': 'product ', 'field':…
0
votes
2 answers

how shall we implement the login functionality with python-eve

I understand python-eve support HMAC or token based authentication i.e. including the token or hash in the header for each request. however how shall we implement login in the first place i.e. the process we verify username and password before we…
John
  • 2,107
  • 3
  • 22
  • 39
0
votes
1 answer

Internal Server Error when using event hooks in Eve

I am trying to get an event when ever I do a POST request. This is the code: from eve import Eve def before_insert(response): print 'About to return artists' app = Eve(settings='settings.py') app.on_insert += before_insert if __name__ ==…
martin
  • 3,289
  • 5
  • 22
  • 27
0
votes
1 answer

python eve distinct values

Trying to set a static filter in python eve using Mongodb. I am looking to return a list of distinct categories based on a content collection. category = { 'datasource': { 'source': 'content', #'filter': {'category': {'$distinct': True}…
cg1207
  • 13
  • 3
0
votes
2 answers

GeoLocation API Calls against an EVE RESTful API

I easily can store geolocation Data into MongoDB with an Eve RESTful API Server running. So I store data like: loc : { lng: 13.01111, lat: 51.01111 } Validation etc. works nicely. But: I was unable to find a way to get geolocation data out of…
Ralf Marmorglatt
  • 265
  • 1
  • 2
  • 10
0
votes
1 answer

embeddable array type of schema in python-eve

I know we can make a resource embeddable in another resource, however below schema does not seems to be working? what is the right way to make an array of resources embeddable in another resource? outer = { 'type': 'dict', 'schema': { …
John
  • 2,107
  • 3
  • 22
  • 39
0
votes
1 answer

python-eve array field contains query

I understand eve is by default using mongodb as backend, and mongodb actually support indexing/query on array field (doc) e.g. db.inventory.find( { tags: { $in: [ /^be/, /^st/ ] } } ) do we support the same in eve? if not, how far are we (want to…
John
  • 2,107
  • 3
  • 22
  • 39
0
votes
1 answer

python-eve hook after document is inserted

I understand we have a on_insert_resources event that is triggered once a post is sent to python-eve, but this is before the document is saved onto mongodb, is it possible to get a hook after the document is saved? (I need to populate some of the…
John
  • 2,107
  • 3
  • 22
  • 39
0
votes
1 answer

Eve REST Api always returns 404 when not connected via localhost

I followed the Quick Start Guide and setup the /people endpoint. It's all working fine as long as I just ask the API via 127.0.0.1. So when I try to connect remotely via 192.168.0.206 it's giving me a 404. I already changed app.run() to…
Ralf Marmorglatt
  • 265
  • 1
  • 2
  • 10
0
votes
1 answer

How to add data during an on_fetch hook and also include HATEOAS info?

I have the following on_fetch hook, which populates a resource before it is retrieved the first time: # bootstrap resources with default data if it's not already there def before_returning_resource(resource, documents): if resource == 'vlans' or…
cayblood
  • 1,838
  • 1
  • 24
  • 44
0
votes
1 answer

In Python-Eve, what is the most efficient way to update the NumOfView field?

I am looking to find a way to increment the numOfViews field when an item is retrieve from GET, my current approach is hock on the app.on_post_GET_items event and update the field accordingly, is it something we do typically? my concern is this will…
John
  • 2,107
  • 3
  • 22
  • 39
0
votes
1 answer

Eve pretty _links for items, multiple entry points

I'm just getting myself into eve. Great framework but I'm stuck with the _links to items. I have a collection with contracts allowing only item_methods. domain.com/contracts/19687176add597c50b13b4188fcafd6d Each contract may have n credit notes,…
alanderex
  • 3
  • 1
0
votes
2 answers

Why python-eve is returning http status 200 after an update fails?

I've found a behavior that looks not good too: I updated a record using python-eve, there was an error because I sent some fields that shouldn't be send, but it was not the problem. I found that even there was an error and the response body show a…
Gaston Pisacco
  • 213
  • 1
  • 3
  • 10
0
votes
1 answer

Cant import Eve module

Hello I recently installed Eve using pip3 install eve. But now I am having import problems. After installing eve from pip3. I can't import it. I tried it with Python3.3 and with Python2.7. When I try: from eve import Eve I get back Module not found…
Swaroop Nagendra
  • 609
  • 2
  • 15
  • 25
1 2 3
32
33