Trying out MongoDB with python using PyMongo. Working with PyMongo by cretaaing a class that implements CRUD functionalities on MongoDB.
-
main.py
- contains usage of the
mongo_db.MongoDB
class
- contains usage of the
-
mongo_db.py
- contains the MongoDB class which intefaces with PyMongo APIs
-
test_mongo_db.ipynb
- A jupyter notebook that contains unittests for the MongoDB class
-
requirements.txt
- a txt files containing the python requirements
clone (or download zip) the repository and navigate to the directory
git clone https://github.com/iamr0b0tx/mongodb_with_python
cd mongodb_with_python
-
update your pip
python -m pip install pip --upgrade
-
Set up virtual environment. This is optional
python -m pip virtualenv venv source venv/bin/activate #linux users venv/Scripts/activate #windows users
-
install all the requirements
pip install -r requirements.txt
-
run main.py
python main.py
-
run test_mongo_db.ipynb
jupyter notebook