"Tools for using NumPy, Pandas and PyArrow with MongoDB"
Project description
- Info:
A companion library to PyMongo that makes it easy to move data between MongoDB and Apache Arrow. See GitHub for the latest source.
- Documentation:
Available at mongo-arrow.readthedocs.io.
PyMongoArrow is a companion library to PyMongo that contains tools for loading MongoDB query result sets as Apache Arrow tables, Pandas DataFrames or NumPy arrays.
>>> from pymongoarrow.monkey import patch_all
>>> patch_all()
>>> from pymongoarrow.api import Schema
>>> schema = Schema({'_id': int, 'qty': float})
>>> from pymongo import MongoClient
>>> client = MongoClient()
>>> client.db.data.insert_many([{'_id': 1, 'qty': 25.4}, {'_id': 2, 'qty': 16.9}, {'_id': 3, 'qty': 2.3}])
>>> data_frame = client.db.test.find_pandas_all({}, schema=schema)
>>> data_frame
_id qty
0 1 25.4
1 2 16.9
2 3 2.3
>>> arrow_table = client.db.test.find_arrow_all({}, schema=schema)
# The schema may also be omitted
>>> arrow_table = client.db.test.find_arrow_all({})
>>> arrow_table
pyarrow.Table
_id: int64
qty: double
>>> ndarrays = client.db.test.find_numpy_all({}, schema=schema)
>>> ndarrays
{'_id': array([1, 2, 3]), 'qty': array([25.4, 16.9, 2.3])}
PyMongoArrow is the recommended way to materialize MongoDB query result sets as contiguous-in-memory, typed arrays suited for in-memory analytical processing applications.
Installing PyMongoArrow
PyMongoArrow is available on PyPI:
$ python -m pip install pymongoarrow
To use PyMongoArrow with MongoDB Atlas’ mongodb+srv:// URIs, you will need to also install PyMongo with the srv extra:
$ python -m pip install 'pymongo[srv]' pymongoarrow
To use PyMongoArrow APIs that return query result sets as pandas DataFrame instances, you will also need to have the pandas package installed:
$ python -m pip install pandas
Development Install
See the instructions on Read the Docs.
Documentation
Full documentation is available on Read the Docs.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
Hashes for pymongoarrow-0.5.1-cp310-cp310-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 27d0477a9bfdc0a320c926e0d9dcb2e32fa18c432ceb123d46f0b000fd23ea44 |
|
MD5 | 01e0ecb655d50e3fa2cf2a7a34792036 |
|
BLAKE2b-256 | d12d62f829deb62c90272d35f02ce321fffe6c8c65a7512eef9726e5631b526d |
Hashes for pymongoarrow-0.5.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 310b2d5c0cdeb0ea07b616735d99177ca16bbbd0bdfb9512b479bce7fd606fe3 |
|
MD5 | cb72e23db130338ce617c316efab8b28 |
|
BLAKE2b-256 | 9d9814ddec06709ecd3460c6d89850131aa0a55d0f5c12f9e0077148a7db7cc1 |
Hashes for pymongoarrow-0.5.1-cp310-cp310-macosx_10_15_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6b0e9e08f3c6f0f6c9959d2c99b819d18a032b1729a756053e91558780cbe9f6 |
|
MD5 | 689afbb5fc23d3f3844858ae739d75f8 |
|
BLAKE2b-256 | 444ca170a543daba380699379a98120d8888893191021f9c157afdc1b3feac2e |
Hashes for pymongoarrow-0.5.1-cp310-cp310-macosx_10_13_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5a52a304536d11f5e123c67bd9c2008e8e795743221fa64fbdbf305e39d8e2af |
|
MD5 | abab729bb8aadecae58c7551ee0ad921 |
|
BLAKE2b-256 | fa7673fafeccdd6ee8edfb7e7f7b4fbeeb5913cd59f6c577b7d9509f6966ffa5 |
Hashes for pymongoarrow-0.5.1-cp39-cp39-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | fb4520554b61a2c749a628d99af2b4e9ec9a62c18fef7f5173ba434768920a10 |
|
MD5 | 8896cbd441a1793eba6bbe84eaace785 |
|
BLAKE2b-256 | 9072beaf3158bd8460a2b7d8d1705a5a62cc799ef95bd3dce3f6c68acb429088 |
Hashes for pymongoarrow-0.5.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | bd6c7c5b244964e0d143910a69696fdb574fb2a173ee0edbe249cffa949dc72a |
|
MD5 | 5ad4270aa322086007628c735dc5a286 |
|
BLAKE2b-256 | a818f404df98adacedebf8713c3085448764cbf3a28e23f1de3a34a8d208d56d |
Hashes for pymongoarrow-0.5.1-cp39-cp39-macosx_10_15_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9fd2f4dded782af8fcebb7127547b120376724215ba799fb5e79676d46ffd8ef |
|
MD5 | 55600715a9c7bc0c6f029560216f1152 |
|
BLAKE2b-256 | 0e890a159a757f238639a2d633055478aaba6b95ded00dc20f04d23a15006bd6 |
Hashes for pymongoarrow-0.5.1-cp39-cp39-macosx_10_13_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2b319026e26e5419c84fe69645bf2cd618a878bb86a2850ab91b018d201a091a |
|
MD5 | 93e30fe3d78875f86087e82ec4c97ddd |
|
BLAKE2b-256 | 045c87c84eb725e66304f649a78bc70c957ddca4d183c806ef7c6524416b629d |
Hashes for pymongoarrow-0.5.1-cp38-cp38-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 04bf90f0c8c80427e202a7a4d7c414abf44bca86dc27f6a28900a27a547aa34e |
|
MD5 | c6f86ef3f3c9eb2e25be10fff6b4a634 |
|
BLAKE2b-256 | eb2493554ec8540f510da191f85f1a240b0321cb20e9fb9b8c1a08e80bbf4555 |
Hashes for pymongoarrow-0.5.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 875181a35ebdecf4bad9ec09ebac328857ac86615192678f99163788c715a3ad |
|
MD5 | cdf3934fca7749aeb72d720e3564e10f |
|
BLAKE2b-256 | 971f03a1026be70b5f0233fd9bcc2b69737f39007ef6658be38a6871dd3c2063 |
Hashes for pymongoarrow-0.5.1-cp38-cp38-macosx_10_15_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | bca56ae8ee841e9c3c90eea93395ef05e450b0a73761969cadb9c74d52a179ef |
|
MD5 | d11ef6df4c61eacca811539e9418e905 |
|
BLAKE2b-256 | 55ff634185baaf3644214224cc7e60f559507b8fdbe259bf9710190ae8df56fa |
Hashes for pymongoarrow-0.5.1-cp37-cp37m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 20abe987710272fcc79145ec6f082c7d0647f29873ee9662feef42e59f9e33a6 |
|
MD5 | 412387f2c8e2b9b7505fdc9cf0f59793 |
|
BLAKE2b-256 | a462fc376f1037429a8e601d3fa1dd069865fd6c17aa9cef6a1914259b499113 |
Hashes for pymongoarrow-0.5.1-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 243526540196b60dde7e9f1872889e594f0cf7e298ce2fc78f006148ca9bfb9a |
|
MD5 | a10f788f5f252d9138e98460d7e7aa53 |
|
BLAKE2b-256 | 1b5a373ff82e8d52d2433f57fcd84d1215b6586e17ae789cb76359fa95b650d7 |
Hashes for pymongoarrow-0.5.1-cp37-cp37m-macosx_10_15_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 145f6530f9e27cea12b9f9e7bbc897b46758882e169854921d62e21df965f4bf |
|
MD5 | 26f545d690325d69c0fefd6676c05f3e |
|
BLAKE2b-256 | cb30ef237e4e24a9f546e7f4cbbbb6d429026fb57597972bbb7b412a14e823b6 |