"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)
>>> 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.3.0-cp310-cp310-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | cee90fab8b4051d36418085fe96144103e0b67cbd00d5232d26c452452b29b23 |
|
MD5 | 9b73f66433b4aa3f43db39ba59e73dc4 |
|
BLAKE2b-256 | 7d701e7251d3a043a65a70f1c81164aca19ca84c6957a6c47ae06592019f0de8 |
Hashes for pymongoarrow-0.3.0-cp310-cp310-manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5f230a6c55dca9e5a2c6190662a72e189c3e2dc94e5627cdfa587ddd9fcba33e |
|
MD5 | 52b88a5e89e7865de4248a3104cdf331 |
|
BLAKE2b-256 | bac2015600f4ab184b5062867a811a675aed3667b110cc4ebeeb647ef45eef21 |
Hashes for pymongoarrow-0.3.0-cp310-cp310-manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a04ebc004367f0fd9923b40c035ebd00e6cba18d3a2f6d41953a7a124938d34a |
|
MD5 | b1d03b0051f381469b037d04b4dbad4c |
|
BLAKE2b-256 | 29ef26390af76aa0fc44431abf6c3cd85701a657c177a27affbaa6cde9b17284 |
Hashes for pymongoarrow-0.3.0-cp310-cp310-macosx_10_15_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | cfcb688c568e2bd72b0bf02b27b6fb70d91133fa9dde84c40e42339b4a7cd811 |
|
MD5 | 48ca7c508d21123e183d3bf39de1d489 |
|
BLAKE2b-256 | 5ede81276b7bef90b719234529675faa81e515ed03d0c6a7a4f4fb48aa019299 |
Hashes for pymongoarrow-0.3.0-cp39-cp39-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3d192eb997f1e9d0abca3f6497a450bc7274bdf81885328272f50580109443f9 |
|
MD5 | f0270753a9c38b53eb74a759e8c66fb4 |
|
BLAKE2b-256 | 00aef03a3ea61e083c3d7fb084e2cf6ccbd81faefcc8c3edede202374bb29d45 |
Hashes for pymongoarrow-0.3.0-cp39-cp39-manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3d2743a5955b845c716ac4be61ae1400b4e1d0a2fcd58a0c4e19c6a469e3375c |
|
MD5 | 30c5c80237efe3ce8bbaab85f0e9d7d1 |
|
BLAKE2b-256 | ee0dfa4ea0e2b43c1483f2bf74f2dd43632535374791e9934d2df88f26b8493a |
Hashes for pymongoarrow-0.3.0-cp39-cp39-manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | eee6a4c33dc2e8c5082f40ab4f31fba221c9f438b955a9c9ea9087b7e51f5436 |
|
MD5 | cf3c532ddd2844332cf51f82dca198b2 |
|
BLAKE2b-256 | 74d153ddf9110046da18a53fc694b1ac6f9536557a521a4cba1232b402a313f7 |
Hashes for pymongoarrow-0.3.0-cp39-cp39-macosx_10_15_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 46eef53fd2c151189e4ac138b55f30e0827e79dff38f0ded1173b0614fdb41eb |
|
MD5 | 24662b773b8346acf1761fc7b37aaf83 |
|
BLAKE2b-256 | cdc86c565fceea9eaa7580356c0b17dab37a48c833c956c6919fe4982ec218b9 |
Hashes for pymongoarrow-0.3.0-cp38-cp38-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 09000e5bbb5cd59fffdf9b493065bc6b017a0b094652829fbf2cc42ee9549ffa |
|
MD5 | d27a57cd612dc89fccd818301e2a6fa2 |
|
BLAKE2b-256 | c6c656361bcfad9928024ff3c9103a1f5912976f241077375ad0ec7b3c0f5382 |
Hashes for pymongoarrow-0.3.0-cp38-cp38-manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | db21ebd6dcc3b044db916167d78412127c49110265159584cfe0f2d898332605 |
|
MD5 | 8c4806734ac0bd7e9a852f09cc36328d |
|
BLAKE2b-256 | 6e8462392509a1fc556a4cda2068f0642615ad36f0d9f8dd60c36ed6c047a78c |
Hashes for pymongoarrow-0.3.0-cp38-cp38-manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 73108c553bcd761994385f1d4d8d1da248674b49ea7560c6728ccc3489487e3a |
|
MD5 | 066f5fe223646cb609f5247d5e3e0b79 |
|
BLAKE2b-256 | e538022daf91c421a71776a146239ff2461360776b39c8bbd0e285f558a3cc95 |
Hashes for pymongoarrow-0.3.0-cp38-cp38-macosx_10_14_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8c7c96ce600c2f1a40e9ce2b6190c7da17835f94b297662d76d6713b21339bc9 |
|
MD5 | 5f80f55cc4d4433196ce64237357deb0 |
|
BLAKE2b-256 | f69ab5ee456d6d0c7f355c807f8b033ccb3804b28874b4d2d6243c638cb8debe |
Hashes for pymongoarrow-0.3.0-cp37-cp37m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ae0e00fa8fb82e792378ac08625e64bca8b116f832c621ce12c028e8b91058fe |
|
MD5 | 247cc51bd0eca2d86c7bbfb0796edbd4 |
|
BLAKE2b-256 | bde98267645fde9e2beea924141267d1204847484b32049ab81ba94e03888941 |
Hashes for pymongoarrow-0.3.0-cp37-cp37m-manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1fe21ad2fb23b49c5a24e5151fc6513692589e420db1bfe6a06fbeebcceb1a5d |
|
MD5 | 890e3ed69d00595c5c8257f3b5e29daa |
|
BLAKE2b-256 | ddc616e44270cc1594cf04fcb5c4321c640e8cfb120cf704c986cff2e8532451 |
Hashes for pymongoarrow-0.3.0-cp37-cp37m-manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d561b292d5a27b16a09ded889ba14f0a5c0050373cbbb60c7617a073d5ba862d |
|
MD5 | 29a5e812de2534907637b3bc3aea14c4 |
|
BLAKE2b-256 | 4cb861971e7fe6509c243ecb907c3a9ed17e849843e084342a4723e593eca756 |
Hashes for pymongoarrow-0.3.0-cp37-cp37m-macosx_10_14_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 37b69cf59926167951b20ad5045d5bb9fdbc1a7e741480d308e00f3e6a8d6358 |
|
MD5 | 2ee660f326360b810d5669ac87f1124c |
|
BLAKE2b-256 | 536381e87f057ecd8fb85d851732767dc809d318f0c741b889e5fe430d64d3c3 |