Questions tagged [pymongo]

PyMongo is the official Python driver for MongoDB created and maintained by MongoDB, Inc.

Filter by
Sorted by
Tagged with
2
votes
0answers
47 views

Simple Flask REST API to a MongoDB

I'm writing a simple REST API to my MongoDB using PyMongo (Python 3.7). Each collection I have in the DB has a route (e.g http://the.api.url/collection_name ), and every document under that collection ...
2
votes
0answers
37 views

Utilising pymongo to scrape over 4 million urls using multiprocessing to examine the impact of coronavirus

So I want to do some research on the impact covid 19 is having on businesses. I've managed to generate a database with the company name and the website urls associated with it. Now I want to scrape ...
2
votes
1answer
64 views

How to think smarter when you need diff args in functions

I have this code, and the point is I want to dynamically change the mongo connecter to change between ssl, not ssl and with and without username in the same connecter function. ...
7
votes
2answers
496 views

Insert 271 million records from text file to mongodb

I have 271 million records, line by line in a text file that I need to add to MongoDB, and I'm using Python and Pymongo in order to do this. I first split the single file containing the 271 million ...
1
vote
1answer
63 views

Work command handler for an economy system

I have been working on this code, which is the part of an economy system that handles the work command. This lets the user pick a role and if they have enough level then they will get it by updating a ...
2
votes
0answers
986 views

Flask-PyMongo best practices to manage a mongodb database using python

The functions below are from a class of slave function which interact with my mongo database. The purpose is to serve a Flask based API by responding with the appropriate data required along with the ...
1
vote
1answer
240 views

Models in a Simple PyMongo-based Blogging Web App without ORM/ODM

I am currently using PyMongo + Flask for building a simple blogging application. I am not using any kind of ODM, instead I decided to use PyMongo directly. I need to know how to improve my code since ...
3
votes
1answer
126 views

RAII style API wrapper for PyMongo

I just watched Raymond Hettinger's talk on making Python more Pythonic and realized I should be putting a lot of his ideas into practice, particularly wrapping API's in a class that makes everything ...
4
votes
1answer
190 views

Tabulating a report

I have a method for generating a report in Python. I want to organize the section about the date into a separate method so I can repeat the report for different dates. What's the best way to ...
5
votes
1answer
1k views

E-commerce product price tracker

I building a very simple price tracker web app. I am using MongoDB with pymongo. The user will enter the URL of the product he wishes to track and the desired amount, when the price goes below this ...
2
votes
1answer
252 views

Views Counter made in Python, Gevent and MongoDB

I've created a Views Counter in Python, Gevent and MongoDB (Flask is also included in the full stack as you can see from the context issue in the code). My gut still tells me that it can be still ...
3
votes
2answers
2k views

Number of Google search results over a period of time, saved to database

I am writing a Python script that scrapes data from Google search results and stores it in a database. I couldn't find any Google API for this, so I am just sending a HTTP GET request on Google's main ...
1
vote
0answers
650 views

PyMongo collection wrapper

I am writing a package that will provide a light weight wrapper for PyMongo insert (and eventually other methods), in order to perform basic validation, logging, etc. I'm looking for design and code ...