"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.2.0-cp312-cp312-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2dd6dc67326587ace6326a314dfa833756ffe782c7e49ae4027af8ffa5d78393 |
|
MD5 | e1aeb219c3418de812ad9a9445bf130a |
|
BLAKE2b-256 | 499ee6e48a777011b5b44a9af6d93d14dfd21b81e84a5064a8add3f173c9144e |
Hashes for pymongoarrow-1.2.0-cp312-cp312-manylinux_2_28_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5290467a0f5f49f619c9d53f40177abc281aaaf9c6423e77254210e6d6fc7dc8 |
|
MD5 | 881d8b9848a72d964dde4ab072a5e552 |
|
BLAKE2b-256 | 28c0d20ba3ba521c27161d4b60ff4d86528b3ae0abf6d5922c2da618e4034e70 |
Hashes for pymongoarrow-1.2.0-cp312-cp312-manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1eea30a26d1c54b5b6394640b58c5d48c065f0d289de9a1697031472cdf4c2a6 |
|
MD5 | 624b2eab6bf3714e38383b0705b5c383 |
|
BLAKE2b-256 | 97a0b3b8ceaa303c1e76fb62e542781f303bb831e9a6c918b79b25537d2f5fd2 |
Hashes for pymongoarrow-1.2.0-cp312-cp312-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | fb1bb448705bc101f856554abc0aabdc262dc4e32674b2dedc504d6756cf33b4 |
|
MD5 | d2dfa6f27be9d268d1ed0a22c3b93fb0 |
|
BLAKE2b-256 | 58f414ad1efd5c7d592928c3ec7e8f9a15d4e4c27925e5d9d82f3379f7201e74 |
Hashes for pymongoarrow-1.2.0-cp312-cp312-macosx_10_14_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c327354287184142adb3b4e1f22f3860c7a9aeae78d0ef5f00f042b5f32dcd48 |
|
MD5 | a92ae4672d4bb636902791b6174ad98c |
|
BLAKE2b-256 | 10b1d0d532131b7f9cdfa54cd93883bebaa00678d54abe30dfc0e779896f582a |
Hashes for pymongoarrow-1.2.0-cp311-cp311-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | af91849702b5c1bf83435ac268829557d9ab5234b8d70bee7c63483fefb6072d |
|
MD5 | 53dc33b0c956012f20411cfcbd933913 |
|
BLAKE2b-256 | 6404393574a496566ed03431346a6f49c638bfd5c3bbb0f85f45955a2303d46b |
Hashes for pymongoarrow-1.2.0-cp311-cp311-manylinux_2_28_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4b47f2bbea14d52a58af140ca159dd8ea91d429f735b35a11a6cb78305cda306 |
|
MD5 | 74efadc03b2bfed6d7cde1a5dc2a067c |
|
BLAKE2b-256 | 88caa12d0aaea2052518684e43a0d1cd18bd27a48dd6f2fa5a9904ac51009110 |
Hashes for pymongoarrow-1.2.0-cp311-cp311-manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | be58676164889fd864c275c117ba8c54b72ee855b8911d4df007f2cf666dc7ef |
|
MD5 | db1693adcc94c14635550fa59e3784e7 |
|
BLAKE2b-256 | 52a258c7da4a9eff21d9eacd038e24c6d048d4f4549e8fff4e1f203717310948 |
Hashes for pymongoarrow-1.2.0-cp311-cp311-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 00ead2672e07aa86efab19b7de00f4fe803cf9d4c9fab03e3f80f1b6cc6d377d |
|
MD5 | c6c54b27ed185b1b6ecdf6ed2148b22c |
|
BLAKE2b-256 | 11d39f8b30564f36493e5e2f636901e35bf19ce429c937ced0a21d98830c01e1 |
Hashes for pymongoarrow-1.2.0-cp311-cp311-macosx_10_14_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c1cb656aaff248309912b702cb91a441050cf94fa64f277995310f142bc80ae3 |
|
MD5 | e66424ee4fdb6c3a8ee01c7ebeb2fd10 |
|
BLAKE2b-256 | 71f2438c550ac1a68a36ba9343d279a72e3a130d7cc92ab5d578ff37223b99bb |
Hashes for pymongoarrow-1.2.0-cp310-cp310-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 237d1727ba4e585a1f6ae446d690754050b001a27e968e2c02065a16990bbebb |
|
MD5 | 5fd99edbfb8657acc60564e9af8b7a6f |
|
BLAKE2b-256 | bdd862772148b1a5d65f7471cfcbfcf9daf56d635ecbc7e24d72f1b563b92ba6 |
Hashes for pymongoarrow-1.2.0-cp310-cp310-manylinux_2_28_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 39cdd9d3f99e28a5b10855d331dfbd9e704b0991fe32a95675683ff721b96b2c |
|
MD5 | 368c5feec49810a296032bd8171a4615 |
|
BLAKE2b-256 | 2390ce50c64b04ffae0c1d1f0df636d34dad9c14acfab5a87e36ce5bf7ca3890 |
Hashes for pymongoarrow-1.2.0-cp310-cp310-manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b95e616765082a630888ad4b38a7590fe08af3ead113b177a55b87650801b2ba |
|
MD5 | 7853c0819b1518e125145a73cf028175 |
|
BLAKE2b-256 | 51d9fa272ca40fc34f907b60235460fa2b9d78301fc23bfedeee224cb863f7d4 |
Hashes for pymongoarrow-1.2.0-cp310-cp310-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3d502e7adb23cfd2bbe236985ef7f09364f33ccfa5835848669e40dfbbf67468 |
|
MD5 | 70902330f2ff449fb70e5e82a0891629 |
|
BLAKE2b-256 | 67631ced7fdfd03cac65ac5dffd39bb28cc512ec11d5a6e730bccc40231b84c2 |
Hashes for pymongoarrow-1.2.0-cp310-cp310-macosx_10_14_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d178fd7f1d4ee5811fd697b82414df7ab8a99b438d86d12f7ab4461f62fd2247 |
|
MD5 | 5116eac25eb68aab3ac5c12f57110676 |
|
BLAKE2b-256 | ce6e75bef9bdb5136ba4e09459622f50f78459e36a4927a6a85c19ab30285116 |
Hashes for pymongoarrow-1.2.0-cp39-cp39-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c87bf7adc4eb8f395e6960c38a647f29fc1667b07e68c20f7fa4dacdb3b1ce76 |
|
MD5 | b022a7b9e723cd05f89e7c14b193e47d |
|
BLAKE2b-256 | a44339f5e14d3c1c1e18e806fdf310d6072b84e4ca29ca82522ac98280d64270 |
Hashes for pymongoarrow-1.2.0-cp39-cp39-manylinux_2_28_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a4525fbf59e149d044ca6a2774733634a09c9088bfab1b946b601fdaa54dcc07 |
|
MD5 | d15ced1b7a864dd02b129d411b2ffe99 |
|
BLAKE2b-256 | 4b264b93075d55bc50feaac936cb47df3e529c6238ab0d13dc535a3f3aad213d |
Hashes for pymongoarrow-1.2.0-cp39-cp39-manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 320a653d2d934ea7c07a50e38bee4600d922160c96ca4cd4b3fee652f61b11e1 |
|
MD5 | 11d2fbd107ad34ef33fa8eb635a3dd3e |
|
BLAKE2b-256 | ae4b73869601e88777de1d57243fe7a5674b4c808f840a3a006031d0a512ef10 |
Hashes for pymongoarrow-1.2.0-cp39-cp39-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 50bca04ff8946edaa9cb6b66e3eeb85dd70803b4cd06616559bd920d094d6b87 |
|
MD5 | 2a14f3337ff4324c5c470668db58e853 |
|
BLAKE2b-256 | 415508d5898e65bfdaf970858eb6db56dd7bcabe953a5748e688da83d84d0f12 |
Hashes for pymongoarrow-1.2.0-cp39-cp39-macosx_10_14_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6c2bfe1b189cb15fd9ba4cccbbe5bafd60e9b948bfe98caefa79a271922a4981 |
|
MD5 | 68c49dd77662b1eb1a44baff7c0f02d9 |
|
BLAKE2b-256 | e0bb1645a090d8cf9cffacbcdb86369808128e10c9d88d698632d61756d3c72c |
Hashes for pymongoarrow-1.2.0-cp38-cp38-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0db8f8c7bc3102430fea3555cc62e6d99757716f6fe2fca2528963d49e0f498a |
|
MD5 | 7f2f5c9394391dcf051ee9b50e6649cc |
|
BLAKE2b-256 | 3944942106a61aa92a911183ebf08af231aecb89ea6b2b855284aef0ddbd20b1 |
Hashes for pymongoarrow-1.2.0-cp38-cp38-manylinux_2_28_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 53d3e1ca45b97c45a670238669247c9ba2ea094368f9de07bea94a594bb7ef80 |
|
MD5 | 845866b06778cd3a312adf1d438fcbec |
|
BLAKE2b-256 | 831775be108a7be7d5d27ac8b1e627db8e581a2570b447e8cf5e11f54dae89d6 |
Hashes for pymongoarrow-1.2.0-cp38-cp38-manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4eb42f34653ec25e8d32d46f5cd7109ae6693e16b5b5d1b615b19ddae0845a7b |
|
MD5 | 33da998eca4b4271dd96d6b04dad6f82 |
|
BLAKE2b-256 | 71147b30a737eebc965698407a4606d77d897ca68bbfd031efa93e6c9196639c |
Hashes for pymongoarrow-1.2.0-cp38-cp38-macosx_10_14_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 942ebd9054015189871c2379f83b6a3a89c14d7197ae76263fde3c8a1c395340 |
|
MD5 | b615036ea4cfc7ce1ea83e3aefbfad84 |
|
BLAKE2b-256 | e14a4fe891a005b57a0607184533dd3b36e9d3de266d4bdd668f8407935ce52a |