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

Python Eve: fields not returned in default configuration

I am trying to leverage EVE to expose a read-only mongo document collection. The problem is none of the object fields are returned through EVE. Trying to start as simple as possible. My mongodb 'restaurants' collection is built using a tutorial. A…
nachonachoman
  • 802
  • 1
  • 13
  • 29
3
votes
1 answer

How to define as subresource list elements of embedded dictionaires in python eve

I defined a resource with this schema # 'people' schema definition 'schema'= { 'firstname': { 'type': 'string', 'minlength': 1, 'maxlength': 10, }, 'lastname': { 'type': 'string', 'minlength': 1, …
3
votes
0 answers

Returning response with header 'Content-Type' as 'application/ld+json'

What would be the recommended way for overriding default (XML and/or JSON) HTML response header field 'Content-Type' to JSON-LD's "application/ld+json" upon GET calls to a python Eve API? The intent here being: Retrieve documents stored in a…
ant1b
  • 51
  • 3
3
votes
0 answers

Application logging in Python Eve

I'd like to add kind of application logging in a REST API I'm developing with the fantastic Python EVE framework. The goal is to provide auditing features to the application, so that application logging is my first choice for it. I've followed steps…
RAmPE
  • 53
  • 3
3
votes
3 answers

How to protect custom endpoints using BasicAuth?

Say I have enabled authentication to the resources using BasicAuth: class MyBasicAuth(BasicAuth): def check_auth(self,username,password,allowed_roles,resource,method): return username == 'secretusername' and password == 'secretpass' I…
DEVV911
  • 448
  • 1
  • 5
  • 9
3
votes
1 answer

Get mongodb collection using Eve

I have mongod instances running on a server with a database on it. I'm trying to set up eve as REST http API to the database, for simple respond to GET requests. If I request http://92.51.132.110:28017/clockrefdb/test/rows by using mongod REST…
MrCastro
  • 435
  • 1
  • 4
  • 14
3
votes
2 answers

How to disable automatically generated fields in Python Eve?

How to disable fields _updated, _created, _etag, _links? I want to limit bandwidth and those fields are bigger size than data which I actually need to get from my database (Mongodb)
d21d3q
  • 365
  • 2
  • 10
3
votes
1 answer

Python-eve GET response does not contain contents of resource (unless I specify its schema)

I have started using Python-Eve to access an existing MongoDB database I have from another project. I was successful in getting correct HTTP 200 responses for queries to specific documents in the database, but I was puzzled by the fact that they did…
Fulco
  • 284
  • 1
  • 3
  • 16
3
votes
1 answer

GeoJSON Python Eve Example

I am trying to make a GeoJSON query work as per the Eve documentation (v0.6.1-dev): http://python-eve.org/features.html However, the query in postman returns an error: Postman GET: http://localhost:5000/people?where={"location": {"$near":…
Dimitri
  • 91
  • 2
  • 3
3
votes
1 answer

Python Eve - POST payload containing a list

I am having trouble with the list type in my schemas. Whenever I try to POST, I get a 422 response stating 'must be of list type'. Below is a simple example that produces this problem. from eve import Eve people = { 'schema': { 'tests':…
Andrew Walker
  • 97
  • 1
  • 7
3
votes
0 answers

Random 404 when using flask test client to test EVE API server

I have an API server build using EVE framework. I am using py.test framework for testing. I came across a weird problem. If I test my APIs using flask's test_client I get unpredictable results. i.e. If I run py.test command 3 times in a row, back to…
Mandar Vaze
  • 1,324
  • 13
  • 20
3
votes
1 answer

Debugging error 500 issues in Python EVE

What is the best way to debug error 500 issues in Python EVE on the resources? I'm having a problem with my PATCH method in one of my item end points. Is there an options to get more verbose error or catching the exceptions with the proper info…
MKoosej
  • 3,405
  • 3
  • 21
  • 29
3
votes
2 answers

Performing PUT , PATCH in python eve application returns , The method is not allowed for the requested URL

I have a written web-services using the Python Eve . I am trying to perform a PUT request on the resource that is already been created . I have defined the item_methods as PATCH in my settings.py file , but I am getting the following Response when…
tushar_sappal
  • 308
  • 4
  • 16
3
votes
1 answer

You don't have the permission to access the requested resource in Python Eve

When hitting the REST endpoint with DELETE (http://localhost:5000/tax/559c0180b9f1f1072f240065), I receive an error. The error was as follows. Tax is the collection I'm attempting to delete and the following value in the URL is the id of the…
Garrett M
  • 103
  • 2
  • 10
3
votes
2 answers

How to have eve write to different databases based on various URL parameters and request values?

I'm attempting to create a REST API that selects the appropriate mongo database to write to along with the correct collection. How do I have eve select the database with the same name as a parameter as well as the collection?
Garrett M
  • 103
  • 2
  • 10