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.0-cp312-cp312-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c3ca91d6891a2c8d824cb6cde40ca910aaa72eb797bdef375dfe1cee47509d99 |
|
MD5 | 8ffd03d5f751765591400e942b0ae8fd |
|
BLAKE2b-256 | 4f45589efc1e04bed2a69c2320585792d08bb148073f332f3bdd04a14d0148d8 |
Hashes for pymongoarrow-1.5.0-cp312-cp312-manylinux_2_28_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | bb284faf16267cb421e266c7191f2b653c85e17f06819e5ed0a2eba85edec3a4 |
|
MD5 | 33fd982b0de4d721d85a0073e8fb6263 |
|
BLAKE2b-256 | 63077cc94e2128c07e4a7ba5330f0476fefedab1690fc376c5cb6fb524b9eb2d |
Hashes for pymongoarrow-1.5.0-cp312-cp312-manylinux_2_28_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7e6b61594bbc88aa3a7433896bb05e0640764ced670d9753463591f647cf3f3f |
|
MD5 | 5c0b6d4f1afa9b6ed375cb7d0b3a1917 |
|
BLAKE2b-256 | fe742b21602d306388ef665e11321dec8a1d4bdd12b9e0f04be27f87b4038c1f |
Hashes for pymongoarrow-1.5.0-cp312-cp312-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c209221cc896a6371dfd8370faf93347b10f9dcadd4da90be1fd7a19959e6460 |
|
MD5 | 725d0e841e9d26a38064253da3b53556 |
|
BLAKE2b-256 | 6c3ea9bad2d86445adce0ab86104a0cb7f41901c766ebcf044a8457aec9abc64 |
Hashes for pymongoarrow-1.5.0-cp312-cp312-macosx_10_15_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f192a537d7ff6e4cf7ffe258db6918bd4998993120d688ad34130d5a9cf0d542 |
|
MD5 | 0775b07d87a83c2c1145736808f41b73 |
|
BLAKE2b-256 | bc0b5bfca215f299331d222e410244363c08fbcf79ab6c62a43d8654a5c26fe8 |
Hashes for pymongoarrow-1.5.0-cp311-cp311-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5cc56f399d270761f44fb36b6bcd8cde4c03b3d345f0a4a1ee2c989c150971a9 |
|
MD5 | d7a9ab0e1f66036f7b8f2582f475676a |
|
BLAKE2b-256 | ac1ca2e69d8956007028c9f2ff12efd0020d0801daf2500c6eac8370743edf28 |
Hashes for pymongoarrow-1.5.0-cp311-cp311-manylinux_2_28_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9cf3a9ad46f6f6c601fe26384050c8cb27c0eb1c18eb067861683377a5e3b782 |
|
MD5 | 1bf456f31960e5bfb96969031a7c6dff |
|
BLAKE2b-256 | 44d632fe575b5d2537521639c1c61b6aa3910f20de3af84558cf02d89d53a156 |
Hashes for pymongoarrow-1.5.0-cp311-cp311-manylinux_2_28_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5fb01356291c15337c53baa2c236fd8aa601d41f472e36a5ebf579c73c3e25d0 |
|
MD5 | f69a2bec4cb0e654d371b311dad6d8fb |
|
BLAKE2b-256 | bbaf0c5ab076ce0e950d7bf786882f96af7155fa5d3e8a5f9fe6182e2f8f9be4 |
Hashes for pymongoarrow-1.5.0-cp311-cp311-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 75e498bfd287f62fe078d786ac329d9210693f8721be177b4cc08911b2edd6bb |
|
MD5 | 2f8011c748ee978902d659624abc63ec |
|
BLAKE2b-256 | 0ad7c864505d2d7b2b32e8922e49889933c1c17464ffcb72bcebc713d7c18854 |
Hashes for pymongoarrow-1.5.0-cp311-cp311-macosx_10_15_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | cd0603f4a744267deabd9ab7a4af8bf7d0f9c6d79002d7b38700b3fc6b626887 |
|
MD5 | 61fe3eeba3ae7d7f25e8f07951b4d51f |
|
BLAKE2b-256 | 8020b9c69d722efeb6b1a7d1a7753c9ca75bed44155f4f2d755ba68e21c20389 |
Hashes for pymongoarrow-1.5.0-cp310-cp310-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 95beae599061acdabc0a1c5a9778c636744a0bf6cd4368974d9ff31e7ff3d063 |
|
MD5 | 167c78bee75fe96b60e8e8a94dece339 |
|
BLAKE2b-256 | 748b46643098930f84c999f56b6bbccc6e6c1fc6c97c130d69b6086491729b7c |
Hashes for pymongoarrow-1.5.0-cp310-cp310-manylinux_2_28_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3e1c43ba51d08c23b044fdd18165c5bcd418edd91aba443376b245ecea4a92fb |
|
MD5 | 086f2c19e4d7de6fec292dca51f6b531 |
|
BLAKE2b-256 | 18be4425861d1a0d96fbc1c1fe787ccfa847531d6112de4f1fc39d4934a5d4e3 |
Hashes for pymongoarrow-1.5.0-cp310-cp310-manylinux_2_28_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d25e03c030fd80d1b6cd2b862a96b339b706e3fcc666c0749d92a18d284df54c |
|
MD5 | 08ffd9c945079ec2c3050f433e997cbd |
|
BLAKE2b-256 | cd0ccf938e9ae0e83644d1eb50973ab49e82a24eed454783bfa7be6c6f967c5c |
Hashes for pymongoarrow-1.5.0-cp310-cp310-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d9716ff2adef3a954a729b95e392f5645d7e84377e065196b061dccfffd9b2c3 |
|
MD5 | b90fd2af64c7fdbe8cf291be51d3ad71 |
|
BLAKE2b-256 | c02a74fd8d5cd9e432d409a523e501de0a3f8c6803a41fee67684daf17371f02 |
Hashes for pymongoarrow-1.5.0-cp310-cp310-macosx_10_15_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 76dbf5fd66371fffcaabcf3b33107574f470ed821531d6d69940d611b414c11b |
|
MD5 | d22eb136a8485c2da470e28c6c9db616 |
|
BLAKE2b-256 | 40312125c7984e7cfb8156728b65332d8e6d0c56050e605ac079af848cc97bd0 |
Hashes for pymongoarrow-1.5.0-cp39-cp39-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 69b94b5ceae569ccf82396e2b6f49f06cebfcf5a908f99e51e2a3d379cd7cf20 |
|
MD5 | 08123c2ce3b4f2033aa343977e82b1c0 |
|
BLAKE2b-256 | 08bbabdb854f659cb43d1f4603ee82c7c0e14707e0a1fe295b2b59f76bcb7e7f |
Hashes for pymongoarrow-1.5.0-cp39-cp39-manylinux_2_28_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 57bee1506724936022ae7a5ab52ad9958413735b1b4511d5d9a088315de65676 |
|
MD5 | 27844fc337d7ad07bb2f71e2c9e2172e |
|
BLAKE2b-256 | eb0162c370d8a7adddb435a97b741f860cec452bb2f4129c3420089bcfefbdaa |
Hashes for pymongoarrow-1.5.0-cp39-cp39-manylinux_2_28_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 54a71ecbfdea5b20a553d4d7df2f1d4b4056c67337a67cbaa46268ac790724d1 |
|
MD5 | a842e9d3630fe6ba5c205556d309c245 |
|
BLAKE2b-256 | a3314246cb42d50745d12d84f9dbf7492d513bf668cfbadd47ce66d99b256e4d |
Hashes for pymongoarrow-1.5.0-cp39-cp39-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8ef052afd0be0c29861293476f0900abdc4a2a976c6c51d8ef67dc86bdf5e7eb |
|
MD5 | 91ac7fb228a3f5019605cf4c7ba436a1 |
|
BLAKE2b-256 | 829edfa351974ff6a188c05d96c6eceee808e5a5c1897d1fe14068e6c1c2b695 |
Hashes for pymongoarrow-1.5.0-cp39-cp39-macosx_10_15_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 290474f8f5929ba67b21b2901265245e8c3397a89b650547799a67c4172e10e8 |
|
MD5 | 5c7a211b79c826a6808125fec3ed0bcf |
|
BLAKE2b-256 | 5b806baed0e95eebfc3a026561f05deed4dde24e745a6126947ba42b81ac942e |
Hashes for pymongoarrow-1.5.0-cp38-cp38-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0a22d5454d48c75edf31ae119b3170aef04b3c505ae0358b77605762bade2c42 |
|
MD5 | 3b426ad0f889e66757eb8b8f1fb7d934 |
|
BLAKE2b-256 | 4d1a5ceb26863cf3a63a7f65cf7cfde98316aa71f0d4dbcdcb492284ad3ab2ea |
Hashes for pymongoarrow-1.5.0-cp38-cp38-manylinux_2_28_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 514bf19681ee2bfadf6fab499afa3a5a7a857e5afce61b326d2b54116e20924c |
|
MD5 | 2e809f4e663f58966c7025fe609735f0 |
|
BLAKE2b-256 | 56cc863f4050c316f84d1e4c75a5690becbd8030391c6a452f8e2da6a0ed2826 |
Hashes for pymongoarrow-1.5.0-cp38-cp38-manylinux_2_28_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | fdbd01c5b45f5de32172d5a05f8b4226693bb82abda97ce7904e0a13a295fefc |
|
MD5 | 8769b9226979029c5878e74b53f02b2c |
|
BLAKE2b-256 | 7c2f004a4d33ba3c57b10b0ce2da2a8149bd30b0160b2a501ed2ce5c70435322 |
Hashes for pymongoarrow-1.5.0-cp38-cp38-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 96cf34817db5ce328a4f549569ee7a440e6e8c7fc6e436a4467e64eff4d1af19 |
|
MD5 | bd1e50f1fa76ae6f5e5821f568179503 |
|
BLAKE2b-256 | 7f9cfd5777840dfc0436c402f96af136ca262aa2d517c895fd368a3df323cb5d |
Hashes for pymongoarrow-1.5.0-cp38-cp38-macosx_10_15_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 92883cc022389dede6b587c7fff8360346c195ce7a0fb30234d4ca05a5f5b5a6 |
|
MD5 | f226fb3ff12ad11bf4b6dc446777d0d2 |
|
BLAKE2b-256 | 78d01ab5623b0cc3337908beadaa22a5e6916754217a03d81d03ce3fb10e7ae8 |