"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
Note: pymongoarrow is not supported or tested on big-endian systems (e.g. Linux s390x).
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-1.0.1-cp311-cp311-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1345527614d0f77c39f50f0d207e9d24f1dfa6ff56f6550b2a797189ae25a2e8 |
|
MD5 | 24bdf1ab517d3765d7c8cebcf8a32e5b |
|
BLAKE2b-256 | 309de14e79dac72759b45e2fa2394542b4b2db9b1a044e28c58be03a2f5a46c3 |
Hashes for pymongoarrow-1.0.1-cp311-cp311-manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | cd9e858ce9a630111efa67e0f976508af024defc756457143fa6fee121fe4ecb |
|
MD5 | 5d62ca53a9d5e34bc8eb50c340160b48 |
|
BLAKE2b-256 | 7ba07f909cc5bee507ddcc06718058422fdd46ae19e43df6c9bb057719b8dd7b |
Hashes for pymongoarrow-1.0.1-cp311-cp311-manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a472c628078170ba2fa6ae4ca1bb10447842357d7a022a1bbd94cc6d2ee21b67 |
|
MD5 | 0339f362278b603bf8921a92312e8736 |
|
BLAKE2b-256 | 79924322b25379a6ee30382c51ef94949b7ccc5d75dc7a2de4865b2fc0c23b30 |
Hashes for pymongoarrow-1.0.1-cp311-cp311-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 37338e44a2738c1e4e477c225afd4e4680ad46e48140bd8e6a30a430f55ae6a5 |
|
MD5 | 6957aa8a5274a0e10be6b10a5e60b9dd |
|
BLAKE2b-256 | eff4b989d829b3259e71f58d2ce54023de213a72cb56397263071ad92a822a43 |
Hashes for pymongoarrow-1.0.1-cp311-cp311-macosx_10_14_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0642ecd645e464606e6eed94b3dbdcb9477de0a26f999a335667a0614d1ff591 |
|
MD5 | 91afa5034085526aec603552997983df |
|
BLAKE2b-256 | 62411edf4152a6c54e4de6d2bdf3803043a2ad994b752433c9ab5619cda567b4 |
Hashes for pymongoarrow-1.0.1-cp310-cp310-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7e9267687bc513d9fd2a142afbd2be99c58dc1960027abbaca01508b3220c035 |
|
MD5 | b74c37d9915cd1ec92059e7c3c9cff3b |
|
BLAKE2b-256 | 318f80a346d6d4fca025be39c7484edbc52dc6e72bd53cf06290fe77efb63563 |
Hashes for pymongoarrow-1.0.1-cp310-cp310-manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 85637910575af65b7485f6e5505b616f1bd834d24956b93def422d537ff52885 |
|
MD5 | 0cac002d70f2e5dfe7a0fca34769275a |
|
BLAKE2b-256 | a4a8029b852b53acba0ba7a253ca77ac38ba99558a7df855522ed9d3fa539844 |
Hashes for pymongoarrow-1.0.1-cp310-cp310-manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 579a901c076d0d194a17bdec58dcdf05858f9a45b1588eb480dfb0a6e2ee75fc |
|
MD5 | 43b38719e7120dde32ae6a77137c0581 |
|
BLAKE2b-256 | a00188a9cc0aab0ce0bf0a968927bd7415e62c3f30476837af3ca5d39bec3c55 |
Hashes for pymongoarrow-1.0.1-cp310-cp310-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 03d935738972eb8b97cd6889de7eadd512b3c0c5d6ab092ec60bfb85a885a402 |
|
MD5 | fe5bb20b22f0816db648fa04d3c7fb9c |
|
BLAKE2b-256 | 3cae0dc14a637fc5e319029790601d1b31689f69e2e80140ce8625fa1ebc0943 |
Hashes for pymongoarrow-1.0.1-cp310-cp310-macosx_10_14_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a6c78320cf05f1c0634cc8e60eed631681f4cbfd3b81808446dff835684bd708 |
|
MD5 | 722a553c692620e08d94e6cf3e44f968 |
|
BLAKE2b-256 | 5a0795cb0b7ca1525cc828eff280aad50bce256bfd46f983eb5012fa643b047a |
Hashes for pymongoarrow-1.0.1-cp39-cp39-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b4ca43a56840f53181dc9f90f3398fb522e62f26f4740683e2a76a8e93342831 |
|
MD5 | 9b9ba715f423669a9369f98077f2b155 |
|
BLAKE2b-256 | 317403328f0a41f58412fc1cb6b2141afc077f8f0251a0df39e199c42ddb8f03 |
Hashes for pymongoarrow-1.0.1-cp39-cp39-manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 114b9a8dacf0756968354527038207f6e6be438153dcf9bc7add93d280eb816b |
|
MD5 | bd59a6753043763fc48ce898f6e07442 |
|
BLAKE2b-256 | a12c82f23162b4c9ae57529cff743e321c529ea0a7a7034fb7e973a2ad0b882a |
Hashes for pymongoarrow-1.0.1-cp39-cp39-manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 376fce64e6512d9d1b7a4ed2b86cc02152b1449b97221e718de918e345593168 |
|
MD5 | ec29ad2e42114b502e65765165a9af31 |
|
BLAKE2b-256 | 1b303cc42d3147346831e2f6d3c9b46b2ffe395a743068787564b5f7aebed545 |
Hashes for pymongoarrow-1.0.1-cp39-cp39-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3b8bb8e384f86cc9090de8afcd1d1460d0e7570996af0716177c74c674630a17 |
|
MD5 | 8dd34224eaa84610f15b7a3d0670177a |
|
BLAKE2b-256 | 8c8020a9ecae8476f882a877c56b2454d05aadb3b18e6b904e37784f044e729d |
Hashes for pymongoarrow-1.0.1-cp39-cp39-macosx_10_14_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | bc08c506e9a04a2016c4c89e2da222c5166b229ae132ecf57d39a90036b90deb |
|
MD5 | 001f1b4a2af3b2a45ba50cee8f9de624 |
|
BLAKE2b-256 | 052f91245f559a924f07f517dbac438f3ca278a20ab037cf000310dd6429110f |
Hashes for pymongoarrow-1.0.1-cp38-cp38-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 55e3b30a5c48121d51f7113b5f2590d0aa3eaf1d54ba238f3532a2ed9604ae2b |
|
MD5 | b2bbe5a21992c2b4c591184189ca9b2f |
|
BLAKE2b-256 | 7544359b3e5934d077bde9e7b8cccaa15782381a233678bd62261f4656497c32 |
Hashes for pymongoarrow-1.0.1-cp38-cp38-manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2f0eb8980edf6074ddd24e00e462b226992f3f1e5a0b3cd70c335ae6c33519fe |
|
MD5 | a463893d8478abf1d74fca83d6bc4218 |
|
BLAKE2b-256 | a0997122f313b8f0366ede484ad3a3aa517571ed2b5e3a4a6d1b5a44b3ae8aab |
Hashes for pymongoarrow-1.0.1-cp38-cp38-manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b23e091549fd5b1866499c335670c4f173974edc37c219f0115bed9e0ca9493a |
|
MD5 | 5641e244e04a6d8ed3815e09551feaa7 |
|
BLAKE2b-256 | 6ebd59308ec5e686016767e50b4cb0fafde0722eaddb6c532ce328a2513a9fd4 |
Hashes for pymongoarrow-1.0.1-cp38-cp38-macosx_10_14_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 07472c13f497681a546af67c7b02c955ed3793bf74bf981bd47fe5d4b77cedb7 |
|
MD5 | 42253af1d8ffbf83c7bf5323289eb3df |
|
BLAKE2b-256 | 7ac9a2c51d5f2ca3eaf8ffce8ae685bb120978e12c140b2b8aa20afdb6b3d2f8 |