/mongo-helpers

Python scripts for working with Mongo databases in Jupyter notebooks or IPython

Primary LanguagePythonBSD 3-Clause "New" or "Revised" LicenseBSD-3-Clause

MongoDB Helpers

Installation

  1. Clone the repo.
  • git clone git@github.com:mnguyenngo/mongo-helpers.git
  1. Go to the cloned repo.
  • cd mongo-helpers
  1. Install the package.
  • pip install .

Example

screenshot

PyMongo Syntax for Reference

(mongo_helper syntax in comments)

client = MongoClient(host, address)
client.database_names() # use get_db_names()
db = client[db_name]
db.collection_names()  # use get_collection_names(db)
c = db[collection_name]  
df = pd.DataFrame(list(c.find()))  # use convert_db_to_df(db, c)