"Tools for using NumPy, Pandas, Polars, and PyArrow with MongoDB"
Project description
PyMongoArrow
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 in the [Contributing Guide][./CONTRIBUTING.md]
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.4.0-cp312-cp312-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8a5344aa71af7c110870768589c455ff98b80e6f83ca61c422ebfd61d01debb3 |
|
MD5 | 543e79b97d3d17e3e937a704ce26789f |
|
BLAKE2b-256 | 10166e4002de020316d5f157b38a433ba8ebc07d1ddca6ea9a9c679ff9dffa80 |
Hashes for pymongoarrow-1.4.0-cp312-cp312-manylinux_2_28_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 61737cfb693f7ee41d0607fe3ba3ce0d9f0f160452fdfd5d6d439c697b795b0a |
|
MD5 | 2b3a43f8243e6d66ff5b26376d23c563 |
|
BLAKE2b-256 | 22d2917fc0ff576e46981c4bd77bcaecf0f6a5a8c634f1e80f0b90586de20e74 |
Hashes for pymongoarrow-1.4.0-cp312-cp312-manylinux_2_28_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b0e1eae400651ea84f61db57588f9b1e6def08642ac7d57292827e1366ac08e3 |
|
MD5 | f3ca0ade8b26707bb37d6f26b98ba2b7 |
|
BLAKE2b-256 | 9ae7ac3615e4e0a2e993a8d274e45d71f230830c15f2400a8f5b5e5bed02756b |
Hashes for pymongoarrow-1.4.0-cp312-cp312-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 916449c542bea9734de814755020b864069ff77d9258883d7ff3d51ce99ab9d6 |
|
MD5 | 8aa3d49b677ca600dee0c43ee02a42ab |
|
BLAKE2b-256 | b02694142bafb4444212fbad4fb60233fe55e69642a5320cfd7eb6089a436a2f |
Hashes for pymongoarrow-1.4.0-cp312-cp312-macosx_10_15_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c2de01264439c6598f5e9d490fc0e48dc68e9cc4eca5fdf7d689724d3a654fbf |
|
MD5 | 3defdcd7f24247468fe0133de779714c |
|
BLAKE2b-256 | f7e0f10c05bf41db482dbf5ddafb57baf5d904b9dd0ce520d35687ad47c5c2aa |
Hashes for pymongoarrow-1.4.0-cp311-cp311-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e456d96acd2dfa88b9ce48370137ef88bfbb60b8c1a94b320429d217d7dbdf6e |
|
MD5 | 79bd3074cd974d854da59a86a842527f |
|
BLAKE2b-256 | e70999727e880e56094e23f50a6be3d75812cc2b71b4a9d675f49ff430ef2edd |
Hashes for pymongoarrow-1.4.0-cp311-cp311-manylinux_2_28_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a47322231087f2a4fb0494050bd8870f776dfc64a30ae3d1fcdffeace33f42d9 |
|
MD5 | 5804a4679ebe85726f9d19139c95c2e6 |
|
BLAKE2b-256 | ac6c21da21ec91c0f01d2b111a8ea75ea1ae194c9f73079fe29d9bbee7c3ce35 |
Hashes for pymongoarrow-1.4.0-cp311-cp311-manylinux_2_28_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | dd4e538f086035e84b59c250f866f2f0da5b0d4da0dc653aee5914c683b5c2b0 |
|
MD5 | ff5037ba2078ee6a4c3498686947c536 |
|
BLAKE2b-256 | b9fb5d4ef4b534c5facc405e7b686f6732f42a513ead9b14cf807043882eb359 |
Hashes for pymongoarrow-1.4.0-cp311-cp311-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ee98a0b504584e360eb57671b722253cb85bdaa1a6396317d5e45e190a97ffad |
|
MD5 | ef56e64b02435db4aea640a82511c1aa |
|
BLAKE2b-256 | ae22e4e6ea5e74fb5b6b6a62c66af692878e72ab863d0cb3979a05dda9d22433 |
Hashes for pymongoarrow-1.4.0-cp311-cp311-macosx_10_15_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 304666ddaafa606292f68e99347b189d3bff0f05ce1fe1a2f0d0bc703cb1e14b |
|
MD5 | 6c242d4851fb52326350f9daff89c633 |
|
BLAKE2b-256 | fdec156a1bbb2d0247364e0025d8f39b01126d01d50e096c14199acd00797722 |
Hashes for pymongoarrow-1.4.0-cp310-cp310-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 015b35cfaed3c84eaae9010ebdc1b26d208a9353bce06f0dca484c008cc21766 |
|
MD5 | bec925c94eea9b4bd3507596732f5eaa |
|
BLAKE2b-256 | 145c41af634b32d96ce3154512991042716c83a09245ea3b1f1935ca13485da8 |
Hashes for pymongoarrow-1.4.0-cp310-cp310-manylinux_2_28_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d1d89eaf0d5b1211648cde1001baebbf43c9ba6349cf4daa832602efc9058519 |
|
MD5 | 3c72b4ae342e90b3406061f779f7b666 |
|
BLAKE2b-256 | 47389483431e87a775a57bea6d6c47498c3c92909ece02516d56bb19e17f9292 |
Hashes for pymongoarrow-1.4.0-cp310-cp310-manylinux_2_28_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | eaf560af5a4bac911a9f39a66331374bef0991c576569fa8feac7b319fd89970 |
|
MD5 | c2e90d6ecb5e26f8c81265b64acc8d92 |
|
BLAKE2b-256 | 93faad5548f5e093c2f105a6ab0b0d58b9812602a83085132135cfe787c5eda8 |
Hashes for pymongoarrow-1.4.0-cp310-cp310-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | de545ecfc591288c75b602b4baeb6cd9f7db9ff6890c69d46dcb63eebd5e379d |
|
MD5 | 08883cde373661572c8de972b50e8097 |
|
BLAKE2b-256 | 4472ed7b84a674d55e8f653a5978145cfc231c6b51b9f821dead9e80f7360382 |
Hashes for pymongoarrow-1.4.0-cp310-cp310-macosx_10_15_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 57a438dad3808c10931ffadd6028c8107133d254229996f8260e7c61417d98fe |
|
MD5 | d33f8288b79056ea4e7c40bfcf25f972 |
|
BLAKE2b-256 | 361909df51df4dda8b3cbe9ca30d0a1385b2367a21ee609c1129f9f7d3e7de6c |
Hashes for pymongoarrow-1.4.0-cp39-cp39-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d84668db48e9875d1813dd68f524aeb42ba79ff03e4daa67c2efab5a3dcdf933 |
|
MD5 | bf08c008e58ed3579d4e10620282ff2e |
|
BLAKE2b-256 | 107a80084dff56444461c33c34473d16848e74f75f1f797aa459d1b7277bd344 |
Hashes for pymongoarrow-1.4.0-cp39-cp39-manylinux_2_28_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3ea9e2f2e5f1fa24ef8c8e0f3a88456374dc55135b3f16eefe8e99dd20a6c06d |
|
MD5 | de2191ff294ff6fb7cd1d844e706a0ee |
|
BLAKE2b-256 | e8320238cd8ffb100bfc87df4a1fdee124e90bb7cac65b815dfc61419d0b1cac |
Hashes for pymongoarrow-1.4.0-cp39-cp39-manylinux_2_28_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 560cccfea8a975ac3d55e65de06f575c53bf807d3381e6205fc964fc776ae627 |
|
MD5 | 9300b2cf7766bd53d47140ac1834b4be |
|
BLAKE2b-256 | 2bb54cd1ee27c4d480f91322bd0eab1644cacbc8de6b8d479734e9d407b13a52 |
Hashes for pymongoarrow-1.4.0-cp39-cp39-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2f5eed62a0b6d5d794c14f9beafa27449273a49a6be5ccf882b282befffd1868 |
|
MD5 | 003ede526e95b028481e3bc8d86e0c51 |
|
BLAKE2b-256 | 7afe35bf6d1a90e853be0c32111219cc5cc5bb5802438f508a48cb0e4241fd3d |
Hashes for pymongoarrow-1.4.0-cp39-cp39-macosx_10_15_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b888fb9caf7a2620d9ef646d963295ff54c86ae2dfd4c23fef824111ff51f643 |
|
MD5 | c75f12b8a5657ad56ad82dee84189e9b |
|
BLAKE2b-256 | 4583cf2338578ae48ca366cfd0f80afe4631e2a32bdf76312570bf2484562c38 |
Hashes for pymongoarrow-1.4.0-cp38-cp38-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 31be12ad678293da9f6d7e3e63ef42c575f3e518150679d52eb287d6bca7bae9 |
|
MD5 | 9bb992293e721b3abf5a8284246bfa83 |
|
BLAKE2b-256 | 5475ba628b08d0f2860a9ff694ef9022495dd4a01b072584c9f0fcbe80b733f2 |
Hashes for pymongoarrow-1.4.0-cp38-cp38-manylinux_2_28_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0ff3fae33a3b98129f8027bfab145743643a2009afcc04b29793cabaad33e196 |
|
MD5 | f893ce3732b9ccc4743b394df0419d87 |
|
BLAKE2b-256 | 257f37babcc9e1042d469c81a65f477a4ccf5c68af6b2ddeabf05d3f7d2b1234 |
Hashes for pymongoarrow-1.4.0-cp38-cp38-manylinux_2_28_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0b917c3d6a1aae8cee8fb3c08668bd4b361b21fcd4a363e1bfec534ab7b26a0d |
|
MD5 | 48b861d3b78f42794a2929a1e0a0a7d1 |
|
BLAKE2b-256 | 2d395a0e448e5dbdfa51e4dfc58054b6201bca9c1110f2265ef8d697ccb4b826 |
Hashes for pymongoarrow-1.4.0-cp38-cp38-macosx_10_15_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 81c2efd035d2adfda097703415bdf6a10898b321e4ad1d5de2552f3597bd5bb2 |
|
MD5 | 21d389eb47aa6df365e208854c0377be |
|
BLAKE2b-256 | f5796558ae000aa7d892a0f9261ff3ee744effbe9baecaec0ac17f4e4a6dba99 |