Questions tagged [eve]
Eve is a Python REST API framework powered by Flask and MongoDB.
484
questions
1
vote
0
answers
18
views
How to disable pagination for a single request (request all items under resource)?
I have an Eve instance running and pagination enabled. In some cases I want to request all items under a resource. This is done together with a projection to get a full list of ids.
This question is ...
0
votes
0
answers
27
views
Is possible to pass an argument to a pipeline aggregation via url and regex?
I need to perform data aggregation, but variables must be passed in the url and not via arguments ( ?aggregate={}).
I have the following hook enabled:
def on_aggregate(endpoint, pipeline):
print(f'...
0
votes
0
answers
28
views
Eve: How to share a document between multiple resources
I would like to set up a collection on MongoDB where each document holds multiple eve resources.
This is a NoSQL approach that differs from SQL where you would have different tables that share a key- ...
0
votes
0
answers
34
views
Connect python Eve framework to AWS database
I'm trying to connect python Eve 2.0 to Mongo AWS database.
I have a setting.py file where I put a MONGO_URI variable to do the database connection and some schemas to test the framework I tested this ...
0
votes
0
answers
28
views
How to add subdomain for endpoint in Python EVE
I am using Python Eve for creating different endpoints. I want to add subdomain to certain endpoint.
There is an way to create this through their custom endpoint feature like below
agent_login = ...
2
votes
1
answer
98
views
How to add MongoDB Atlas URI to Python Eve application
I am trying to connect MongoDB Atlas Cluster using Python Eve Framework. However, It keeps giving me Authentication error when I have provided both username and password.
Here is my settings.py
...
0
votes
0
answers
47
views
Error 401 of proper credentials with python Eve AuthToken
How can I do authentication and authorization in a REST WEB API in order to get token secret, so that I can make POST requests?
This WEB API already exists, I try just to implement it in my local ...
1
vote
0
answers
46
views
Optional microseconds in Python Eve DATE_FORMAT setting
Within my eve_settings (Python Eve) I have this line for global date format.
'DATE_FORMAT': '%Y-%m-%dT%H:%M:%SZ'
However, I would like flexibility to be able to permit microseconds without needing to ...
2
votes
1
answer
133
views
Workaround the lack of the date (not datetime) type on Python Eve?
According to Python Eve's documentation on schema definition, it currently comprehends the following types: string, boolean, integer, float, number (integer and float values allowed), datetime, dict, ...
0
votes
0
answers
105
views
How to apply $regexMatch to an object field that's nested inside an object with the MongoDB Aggregation pipeline?
Is there a way I can build an aggregation pipeline stage to do a $regexMatch on an object field nested within another object. I typically see examples using the $addFields aggregation pipeline stage, ...
0
votes
1
answer
104
views
Python Eve allow_unknown=True and projection (exclusion)
I have a collection with non well defined schema. It is read-only and I am using python-eve with the option allow_unknown=True, so that it returns the whole documents even if they do not match the (...
0
votes
1
answer
97
views
"Dynamic" datasource in python eve?
how could I achieve a sort of a dynamic datasource got from the incoming post-payload ?
So all incoming payloads "create" a new collection in mongodb or use the old one if available...
Ex. ...
1
vote
0
answers
72
views
How to download from python-eve endpoint that serves files using python requests? I keep getting 401 errors
There's a Python-Eve installation that serves files using endpoints.
The endpoint looks like /smartapi/datafiles/5f4deca38cc01b4384f68529
The Python-Eve installation is not maintained by me.
I can ...
0
votes
1
answer
60
views
Is it possible to render your data using an html template before displaying the data from DB in Eve
I am developing a simple API using Eve, to display the data from my Database on the web client using Eve, just following the quickstart guide in Eve documents to write a schema and defining the ...
0
votes
1
answer
151
views
When using Pyeve is it possible to pass parameters to an aggregation pipeline when using get_internal?
I am trying to call an aggregation pipeline with parameters as part of my server code within eve.
The documentation and the code on the [github]https://github.com/pyeve/eve/blob/master/eve/methods/get....
0
votes
0
answers
135
views
How to permanently delete resources in Python Eve after enabling soft delete?
The docs at:
https://docs.python-eve.org/en/stable/features.html#soft-delete
clearly describe how to enable "soft delete" feature and how to restore items that are deleted.But it is not ...
0
votes
2
answers
1k
views
How to remove empty string and arrays from objects inside an object with the mongodb aggregation pipeline?
I want to remove any document that has an empty text string from an object within an object. Is there a way to do this with the MongoDB Aggregation Framework? In this case it will be the text within ...
1
vote
1
answer
322
views
How to remove empty string and arrays from objects inside an array? MongoDB Aggegation
I want to delete the empty strings and empty arrays within a document. Is there a way to do this with the MongoDB Aggregation Framework? Here is an example of an incoming document:
"item": [{...
1
vote
1
answer
60
views
Is there a way to place a $regexMatch on a specific field on every object level in the MongoDB Aggregation pipeline?
Is there a way I setup a MongoDB Aggregation Pipeline to do a $regexMatch on every 'text' field no matter what level it's in. I'm currently utilizing Wildcard Text Indexes for handling the text index ...
0
votes
0
answers
261
views
Is it possible to create a Text Index on dynamic fields in Mongodb for text query search?
Is it possible to have dynamic text field creation on a text index without dropping the text index itself?
We have data coming into our Eve API layer that can have any {key: value} pair that we want ...
0
votes
1
answer
374
views
Is there a way to not $project keys that have an empty array in the mongodb aggregation pipeline?
I'm getting some [] values for some of my returned key results, but I want to make it so that the keys with [] values are never returned at all. This needs to be in the Aggregation Pipeline.
Ex:
{
&...
0
votes
1
answer
191
views
How to dynamically change the text index in mongodb for a single collection?
Is it possible to change the text index search dynamically on a single collection on mongodb? I originally have a $text index on the first.text field of my collection, but when the user presses a ...
1
vote
0
answers
89
views
Change Eve Python DOMAIN collection schema dynamically during runtime
I am using the Eve Python API Framework for MongoDB. I am writing a feature that allows my users to edit metadata sections for the documents that they are writing.
Example JSON:
{
"metadata&...
0
votes
0
answers
145
views
Uploading file to Amazon S3 with python eve
I am trying to upload an image to S3 bucket. I referred to eve documentation and this git repo. I tried to do it the following way.
#/ run.py
```python
from eve import Eve
from flask_sslify import ...
2
votes
0
answers
230
views
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 ...
0
votes
0
answers
119
views
Possible to specify which text index field to search in MongoDB on a REST call using Eve?
I'm allowing the user to type in a text query for searching for specific documents in my 'names' collection in MongoDB. I'm using 'Eve' for the API layer that connects my React frontend to my mongoDB. ...
0
votes
1
answer
60
views
Python Eve - Datetime filtering not working on Ubuntu 20.04
I am using EVE 1.1.1, python 3.8 and curl 7.68.0
I have a curl GET request which works fine on Windows 10 but when I try to run it on Ubuntu Linux 20.04 I get an HTTP 400 BAD REQUEST error.
I have ...
1
vote
0
answers
108
views
Full-Text Search with Eve and MongoDB on a field in a collection that's an array?
I'm trying to implement MongoDB's text index functionality into my app to allow for the user to make text queries in our specific 'names' collection. The 'names' collection has a field 'first_names' ...
1
vote
0
answers
186
views
Use cerberus coercers to encrypt / decrypt data
I am planning to use python eve & cerberus to save some documents into a mongodb database.
Some of this documents will have some sensible data (pseudo-passwords) which I do want to store encrypted....
0
votes
1
answer
53
views
Profiling for a program using python-eve server
I am running a backend python-eve server with multiple functions being called to provide one service. I want to do profiling for this python backend server. I want to find out which among the multiple ...
1
vote
1
answer
55
views
Pyeve: How to have multiple date formats
Seems like I can only specify global DATE_FORMAT in PyEve. How can I specify different formats for different fields within the same resource?
1
vote
1
answer
133
views
How to disallow "_id" in the request while creating resources using Python eve?
I am using Python Eve to implement REST APIs.
While creating a resource with POST, It seems that I can pass a value for "_id" field in the request body and as long as the value fits Mongo's ...
1
vote
1
answer
325
views
Disable Paging on eve mongodb at API level
So I have an API something like this
http:exmaple.com/people
When I use this to retrive data , the response is limited to 25 entries per page. I want to receive all the data all at once i.e bypassing ...
2
votes
0
answers
176
views
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 ...
2
votes
1
answer
663
views
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',
'...
0
votes
1
answer
53
views
How do you add auth to the routes provided by eve_swagger?
I'm using eve_swagger (https://github.com/pyeve/eve-swagger) in a project and it works great for generating swagger docs. I have a use case where I need to have the default /api-docs endpoint that is ...
0
votes
1
answer
110
views
How can I test Python Eve projections with pytest?
I am trying to somehow do a get request to testing flask client for Eve:
@pytest.fixture(scope='session')
def client():
app = a.create_app()
app.debug = True
client = app.test_client()
...
1
vote
1
answer
221
views
How to make eve create DOMAIN endpoints programmatically
I am trying to make Python Eve create different collections programmatically,
Let's say I want to expose an endpoint receiving a schema to be able to create that collection in mongo:
i.e
DOMAIN = {}...
1
vote
0
answers
36
views
Python Eve document versioning not store all fileds into resource_version document unless i declare the fields in schema,I
I did define all schema in domain because the dynamic fields will create as business require
So I enable document versioning and I find only eve fields strore in shadow document, other fields not ...
0
votes
1
answer
65
views
Get info of an item from database in pre-put callback in Eve
I have items with subId and some other fields stored in mongoDB. Before the PUT request is submitted, I want to check if the subId which is sent in the header of the PUT request is equal to the subId ...
1
vote
0
answers
42
views
Eve REST Api Server on Azure HTTP Connectivity
I'm trying to deploy a server to Azure to provide a RESTful API. I've set up the VM, deployed the code below, but after I run the app in the cloud my HTTP requests hang.
I have this code for the app
...
2
votes
1
answer
97
views
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 ...
1
vote
1
answer
110
views
How do you handle cookie based authentication in Eve?
I'm using Eve 0.7, Eve-Sqlalchemy 0.7.1, and a TokenBasedAuth class implemented and set on my domains. It works as design for requests that are sending a token via the Authorization header.
Example ...
1
vote
1
answer
95
views
Python-Eve: query to ip address saved like string
I have this schema:
DOMAIN = {
'banned': {
'schema': {
'ip': {
'type': 'string',
'regex': '^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:...
1
vote
0
answers
33
views
Create a non-collection resource in Eve
As you know, when creating a resource in the domain named, say "people", you get a collection resource with the following behaviour:
GET /people returns the collection
POST /people adds to the ...
0
votes
1
answer
118
views
how to filter API by URL on Python
My DB has 2 properties("firstname" and "lastname"), I want to print all rows which have "lastname" containing "son" and "7".
Could anyone help me to write an url to do it. I use the code below but it'...
0
votes
1
answer
87
views
Cannot connect to Flask-Eve API
I'm trying to use Eve to manipulate data on MongoDB.
I followed the Eve's official instruction to test the result, then failed.
Eve's official instruction for quick-start
touch 2 files in a same ...
1
vote
1
answer
130
views
How do I use add_resource with Eve application?
I have an Eve application running and I wanted to reorganize it (just to follow best practices) so that it looks similar to a flask application directory structure.
I tried to use something like ...
2
votes
0
answers
182
views
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.
1
vote
0
answers
327
views
Mysterious space character in request/response headers Python Eve
The reason I put request/response in the title is because I'm not sure if its a problem at the request or response.
I created a small restful API in Python with the framework Eve, which is based on ...