Transfer data between pandas dataframes and MongoDB
Project description
Overview
This package allows you to read/write pandas dataframes in MongoDB in the simplest way possible.
Free software: MIT license
Quick Start
Writing a pandas DataFrame to a MongoDB collection:
import pdmongo as pdm import pandas as pd df = pd.DataFrame({'A': [1, 2], 'B': [3, 4]}) df = pdm.read_mongo("MyCollection", [], "mongodb://localhost:27017/mydb") df.to_mongo(df, collection, uri)
Reading a MongoDB collection into a pandas DataFrame:
import pdmongo as pdm df = pdm.read_mongo("MyCollection", [], "mongodb://localhost:27017/mydb") print(df)
Installation
pip install pdmongo
You can also install the in-development version with:
pip install https://github.com/pakallis/python-pandas-mongo/archive/master.zip
Documentation
Development
To run the all tests run:
tox
Note, to combine the coverage data from all the tox environments run:
Windows |
set PYTEST_ADDOPTS=--cov-append tox |
---|---|
Other |
PYTEST_ADDOPTS=--cov-append tox |
Changelog
0.0.2 (2020-05-04)
Dropped support for pypy3
0.0.1 (2020-04-30)
Added read_mongo and basic support for reading MongoDB collections into pandas dataframes
Added to_mongo and basic support for writing pandas dataframes in MongoDB collections
0.0.0 (2020-03-22)
First release on PyPI.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for pdmongo-0.0.2-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | fc5fef0883d504eb39aacfd430fc1ef009dca2276489e0716edbd85114c9581a |
|
MD5 | e9478bf3b09d157fa38cd4ec0b556481 |
|
BLAKE2b-256 | 5602b74034484772a961ccfd2e697fae600e2edbf9e4764c11d6fa61768ffa4b |