"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.6.2-cp310-cp310-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6352842ea5a9841b25369c5cd2b25c121ad6469c4be5dd96d3fee9ecd8639aa2 |
|
MD5 | 12fb260b111bf5b63993866f6e88d7c2 |
|
BLAKE2b-256 | 3ff7f92278202e7150468714b022fb243634b61b4d2d3ec80915f49dfaa306ad |
Hashes for pymongoarrow-0.6.2-cp310-cp310-manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a9cb8760aa218b4e5e64d6e635376fc1f33bf78b1fa2248a76e6ff0f0f2eaf70 |
|
MD5 | e3abf5d482761fa29565b65d066751d8 |
|
BLAKE2b-256 | d26f7232f0f8094f830528d78a9e36a04a9d5dfa5c98774d134482f2ac8c5d2a |
Hashes for pymongoarrow-0.6.2-cp310-cp310-macosx_10_14_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f9af8595e130028b476be6528b0ac8d79caa956ab2d09d36788bec3824de7773 |
|
MD5 | ccdff0f9a485af71abb0bbcb57a89e0e |
|
BLAKE2b-256 | 905b2922b644a570d969c4f6166e579a8d5a18fb1822ab4d0aff49ffd4ff627a |
Hashes for pymongoarrow-0.6.2-cp310-cp310-macosx_10_14_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 205ea2a83ee4edcc921131da368bcb19add00a61740b20f8469a2a29d9d896ba |
|
MD5 | f23a4a0b570c2638e0a782acbadc70d9 |
|
BLAKE2b-256 | 4988e2357a7ef78fef9c013e32ecdc83bbef60ab04c55ef58c499b784c2ca332 |
Hashes for pymongoarrow-0.6.2-cp39-cp39-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 978ffadf0008c3ef86fb2731af4d5b342ca69e394988ad05eefc8a7c47e7a75d |
|
MD5 | 98baa1c80fd7efb00df5584b6f793751 |
|
BLAKE2b-256 | 4e7b91cddf7608abb2223797d632d486d8542aff870dd6191291448de299da90 |
Hashes for pymongoarrow-0.6.2-cp39-cp39-manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2dc3d2f933525d8aad08693b1645e9321af44b8dc2c13d0fc737dbb8395d9bf8 |
|
MD5 | bba7cf6643d4f2591f52fbeb1d2811ab |
|
BLAKE2b-256 | fe84a3c6a851bab916da6555c6952abe3c6de6390acb661b65710494868cbf4c |
Hashes for pymongoarrow-0.6.2-cp39-cp39-macosx_10_14_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e8e042a69376e530c9a1adbf349c21e0e469eeaee202422394d9b0fbbf0b5e98 |
|
MD5 | b137809f9287ba00704ce54ff49883d0 |
|
BLAKE2b-256 | c6c4d99e239926082a980c26d281d72c568742e977940d59a93cc6ea8eea9325 |
Hashes for pymongoarrow-0.6.2-cp39-cp39-macosx_10_14_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d347380a423e22d97e1a8cbbc537ac73972241aa241bbf4e42704f59dadaafe3 |
|
MD5 | 6ee2141eeb621e79bb9852c33085c876 |
|
BLAKE2b-256 | 11bb12f416e64ed064506cd29d7eb8574ef2963fa04f46ebf428e5fb11a3ae74 |
Hashes for pymongoarrow-0.6.2-cp38-cp38-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3086fd8295b4ba577eaa65cee844a580924678c723a1c60204f517b38b965fb6 |
|
MD5 | 64c6b03174435f4348eb9b4152ecca6b |
|
BLAKE2b-256 | 10f80bf8a685c5d8343e875066eb18eceb9bc1359fa8dbfce8151717c858613d |
Hashes for pymongoarrow-0.6.2-cp38-cp38-manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e03a890e3b0ac719d67ced3d0ac01f11223300015f952788b211dded223acac9 |
|
MD5 | 1c459f45df7a589ba600bbe783dedd7e |
|
BLAKE2b-256 | 237bdb574663ae45e6886c6fc340c38c89e24fbd213448a4068b0e5d06a369d5 |
Hashes for pymongoarrow-0.6.2-cp38-cp38-macosx_10_14_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2379af98d6e3b7c260980f676adde8de544c09531c5980103d0981334e2901bf |
|
MD5 | fa141b89c34f1a05a9dd514b95b3c0df |
|
BLAKE2b-256 | b690e3e09321cbbf1c4ea2b20c43f4a4ea473bd5f83fd5b72590dd03e904448a |
Hashes for pymongoarrow-0.6.2-cp37-cp37m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5f3ee59d95526133f9fa42c038677cdbbf20656d3ac26c26a8f7a68c5eb5b15f |
|
MD5 | 3fcdab0aa0c6b062882465491035bd43 |
|
BLAKE2b-256 | 84683cff66d17da4e5ad97098bb0b133eab75cc70609dae47a0fac1dc9f08ba8 |
Hashes for pymongoarrow-0.6.2-cp37-cp37m-manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e6189c426c303151f3cd3dc75069d62482c064e96576d239c56f2e5c29f947ec |
|
MD5 | 4f77266c7aa3610809611dff52fa0ae0 |
|
BLAKE2b-256 | 8d3b709c4fe82a0d720a93b5faebdcbc507bb1c1e7a58a006f43fa5c070dc312 |
Hashes for pymongoarrow-0.6.2-cp37-cp37m-macosx_10_14_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 25310d2e567e2a32cae4acde8ad7749e4eabc0b4ee2d91e7d63e658fa1416017 |
|
MD5 | b31f26217342748f03e36bef9d6a1d93 |
|
BLAKE2b-256 | 60c523d903430785800162ae216bf4e25dbf72f268bb102abd2f1bf210e1a5df |