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.5.1-cp312-cp312-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ed23f13f6424aca9adadff68e480d206786ae360c2dd44241eafc041b1673ab3 |
|
MD5 | c0edbb5cd619ea3058af220175c40578 |
|
BLAKE2b-256 | 0a7c4b240a4e1f164fa0b2fe5244085cf4ddecf92c6fff08e333876bd53c1ecb |
Hashes for pymongoarrow-1.5.1-cp312-cp312-manylinux_2_28_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3dc638c26476dd9e574949eb56c6fc147e377a08cb199e6fb53be86ec74b1652 |
|
MD5 | 540ffe454f0766be6e261ca5cb259463 |
|
BLAKE2b-256 | 1db5e5165565bd0f2746cbb94fe3606c6271eb03a747f7e0ffc48c1a8f4a176b |
Hashes for pymongoarrow-1.5.1-cp312-cp312-manylinux_2_28_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2fa9a757f5273baa7897c070dece9eb80158f6b622113892b969d4d13503e0d8 |
|
MD5 | 29e88ec92cd7732fc44960eca60a4945 |
|
BLAKE2b-256 | cba638cdfab6fd5ec07cb51f0e2a0faf1501d7424dc58b20fa29657ff84f238b |
Hashes for pymongoarrow-1.5.1-cp312-cp312-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9514190c0a9996f481a0bbc6b7374436ddf565fa73d94313917d2d1c8c4fc235 |
|
MD5 | 64372026caab21c544a4bb66380e610d |
|
BLAKE2b-256 | 5d4c5bc3f47e223d107b79b529942a06a06284ec9b9f7b258ba8da6e1ab4780f |
Hashes for pymongoarrow-1.5.1-cp312-cp312-macosx_10_15_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 30d4066d45bbe08a78341f0e51aa9dbb74bf31636a2201584d676c1b4aaf60e5 |
|
MD5 | 33621660f41c14d66c8379738c47bbc0 |
|
BLAKE2b-256 | 502c5d5ffb0ddcc949bcf3bde37a1dc900bb180f32dc9634b68e202e0b503941 |
Hashes for pymongoarrow-1.5.1-cp311-cp311-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | eca0ae26f42fc6a7db597818b2c6fed54817c2d287f2f15421bc6f61df8b9c14 |
|
MD5 | 086aac689e3f1198053d047a04736462 |
|
BLAKE2b-256 | 6679fb22f9b1fc6ca7c832179e87f8ea448ffca4d08803dfd7ad56b8e3761182 |
Hashes for pymongoarrow-1.5.1-cp311-cp311-manylinux_2_28_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 368f5a3dfe0e3c1651aa71db2864a6782b1391d3383af1cdb4765ed02e0fd22f |
|
MD5 | 3e929e2788201efb05ee91b875d5b801 |
|
BLAKE2b-256 | da54513a09b136ebda60a32c6c781063ba064f2675655c88d71d7647c772ef21 |
Hashes for pymongoarrow-1.5.1-cp311-cp311-manylinux_2_28_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 74ddca5714bd3c72c8914458956945f9822e73a5abbab97dde6745a9037a75e3 |
|
MD5 | a76ea1c11a67ba6f11b7fecb162a8130 |
|
BLAKE2b-256 | 06c11b779737fbee9b4220fc7d4c06f1f52728ecdcf3140d63908d17556f0bdc |
Hashes for pymongoarrow-1.5.1-cp311-cp311-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | fe91dbcc2fa48b6dce44947c94c6eb9f472f14a9591170c41ba8c067de67d3fb |
|
MD5 | db27330325e3d05800d3c66dbad5e4a3 |
|
BLAKE2b-256 | 2da3f337f9ffad3abd7e032ab457ad29ce251b4c1f5ebfaac1bee18dbc42a3ec |
Hashes for pymongoarrow-1.5.1-cp311-cp311-macosx_10_15_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 16cae6d30d7fb580d334a818d3d618557c81670f060dcfa8afc2e24b2bdebb87 |
|
MD5 | 5ea76355ed3fd5e9124ccdac631334bf |
|
BLAKE2b-256 | 8c9ab315720cb036c9a1300822747fc63ecd656063149b69ed98d36793747c62 |
Hashes for pymongoarrow-1.5.1-cp310-cp310-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ff77263173521cceaad6f0143fd730d3535cda47c01d54cfcae714438c7dcfa7 |
|
MD5 | f9729407e7cfdee3466c71691021f7bb |
|
BLAKE2b-256 | 17e1f4295b9df3843b13e561c8f7e33baa27ba11beb19b5de0ec795897e06c92 |
Hashes for pymongoarrow-1.5.1-cp310-cp310-manylinux_2_28_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 92f91e2e8be2d34455911794eb07f734bf6daac0d9aa407d376c888aba3c422a |
|
MD5 | d1c815e3355216370778f9a50c7db133 |
|
BLAKE2b-256 | 9e16b4d1199d1d9adc7aa904838e373ff222498c4becd43ac52be47ce43b0ee8 |
Hashes for pymongoarrow-1.5.1-cp310-cp310-manylinux_2_28_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 60e95b396bba6ec9581c752b7ec6f1f8f3f7b4523f112a482f932f8282aac8d2 |
|
MD5 | 28206525bdf5d485427cde26e28c08e7 |
|
BLAKE2b-256 | a25039ca36957a1d45cc37f7ef4ed829c7d2baaf665215a70d752cf09b9413db |
Hashes for pymongoarrow-1.5.1-cp310-cp310-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | fb2a26cf098b194965d4080ff82560da110e7bb6758041fe7f27374a1245c1e5 |
|
MD5 | 9fa884fb5fddeb525858e46ad431075e |
|
BLAKE2b-256 | 3c621430653cd4b8c0a65cf06111d8fa5c37b9bcabf42f74219ddca6108f268d |
Hashes for pymongoarrow-1.5.1-cp310-cp310-macosx_10_15_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 36576f0f6693524594f40298e7a3099332bdcabb7e49f91b92f343a65995347b |
|
MD5 | d57164f0ffaf9cebf6505cce218c48e6 |
|
BLAKE2b-256 | 565bc95af33d7d7e9d09cc588cf5c6e8f4fd85b5bf6372e44d6bce374272e0df |
Hashes for pymongoarrow-1.5.1-cp39-cp39-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b412276eaa9ef89477f1280702ea0c69d1e6d861b2f69135e45b201966ff0c74 |
|
MD5 | e2bd56b7711ffe2cbb79312cb5b208dc |
|
BLAKE2b-256 | 82f27aa3039969051c2cd6186eefaa5602b1cfae286f5df32294c6ee855afdc3 |
Hashes for pymongoarrow-1.5.1-cp39-cp39-manylinux_2_28_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 11e9dca28ebcc3332c2796ba9cbf9a0cf5baf2ca579864884e9705c493598be7 |
|
MD5 | f0ca4a5897dbba2a79ab46f0f5dc838e |
|
BLAKE2b-256 | b1ee1e818d094421ab3865a70252b5ff57db7fd25f89e36829a82be10caad0eb |
Hashes for pymongoarrow-1.5.1-cp39-cp39-manylinux_2_28_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 013ac995a1dbf8a8d70d26f801a005e134e7343cf651cfd4e3e9435e850b9b82 |
|
MD5 | aa8377e5d59f6bcaabd1d02ee19f539a |
|
BLAKE2b-256 | da3331ad42a37ef88e0fd2fa7ce05f0c756c87483192d4b4146f17959f40c283 |
Hashes for pymongoarrow-1.5.1-cp39-cp39-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 17809bbc248ce5a313cb5f19ece880c0c90bb895165ee8925dbcff113df94db4 |
|
MD5 | 0790c0a21d871cce6b14883cd7ac4c36 |
|
BLAKE2b-256 | 49eaaccb6115c92ea001a94baa224136b284a557e7102c7aaf3b5f55ef8fe9e4 |
Hashes for pymongoarrow-1.5.1-cp39-cp39-macosx_10_15_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f1f2f4b86fd32acbf3895e288dea119f0518e32b5aaee47902ed8e188ad3d64a |
|
MD5 | 9b69b1096fb87ce47be02242c24ae027 |
|
BLAKE2b-256 | e0de6ee4daf5bbd7d4aa70863b5df4542885599cd40f7928d1b299d33c6d2957 |
Hashes for pymongoarrow-1.5.1-cp38-cp38-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | aa1b13fe9cabc62c82e095bf0d4bb20533a7bef27a7bb0755778a447073ea8c5 |
|
MD5 | 7c571edb139821838092ac0dea2b39f0 |
|
BLAKE2b-256 | 6dd4e423ca23fef02facfafeb94e06c2f1de572b7595025de11695f9eab6959b |
Hashes for pymongoarrow-1.5.1-cp38-cp38-manylinux_2_28_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9b727aee5d447fd269464752c6270e88152ee8f05fdaf46b423704f3058b240a |
|
MD5 | 422fdfdff4095fd66ba5bbd9f57d2c99 |
|
BLAKE2b-256 | 038ea7ff35a1bbc2d2f59188cdf48f9e54170a8dcdd7e80f55746189dad08134 |
Hashes for pymongoarrow-1.5.1-cp38-cp38-manylinux_2_28_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a854f0ad13ff19c89d66f9787d0132685ed6f1b5a0cb89c70f6bcd439c9ed539 |
|
MD5 | 55874de90c59a27af0b3b9761f483992 |
|
BLAKE2b-256 | 3310b739c18e1e49c3f6be4599edd9935a9d18f229090b1cad4ba936ebcbcb3d |
Hashes for pymongoarrow-1.5.1-cp38-cp38-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 67c1ca874b6cefdc25848e5c0ae9c810682eab798b00e93393bfaaa6f9030bae |
|
MD5 | de733955abee45a982b4f8f7d3a9ae43 |
|
BLAKE2b-256 | dcff8a48e1e458c91a127947da900bafc391589f7590688d491452b1a05dbc0a |
Hashes for pymongoarrow-1.5.1-cp38-cp38-macosx_10_15_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | cc050c9c576c180aee39ce2c03279d6106c1fd9a38c79075a57ae5f228e20bb3 |
|
MD5 | 43cd10ba504825c6fdaf95fa872d9252 |
|
BLAKE2b-256 | 99a9f0805dfac017b24d48f8b4cad99ac405fc2dc5da1a86f7b22709eff3c5dd |