"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
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-0.6.3-cp311-cp311-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0b2f23164c162d006a43190518b4da87e4e7469e8e9884c343c71bd1dc7441a9 |
|
MD5 | ca592db2a302ce6dad74c2a966397e41 |
|
BLAKE2b-256 | 3cd004921b328a680f405cfc78dbc88de64d247ec4122d9b822a36038b9ebc94 |
Hashes for pymongoarrow-0.6.3-cp311-cp311-manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 33ecc57e635d4b919f3ad4bef2aeb94d813054b7d61bc7bd23b5343fa5865e25 |
|
MD5 | c6897ef29884e3e11f5cf312231b1c7f |
|
BLAKE2b-256 | 61a9184d97c0d5f9359cddf72c5bea18f8b69388fa37162bfc5c6d9dd2f50588 |
Hashes for pymongoarrow-0.6.3-cp311-cp311-manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2426b4388a1863244ca50770f9862b552cfb919b2d9977660af126d1acd6c1b9 |
|
MD5 | a002e4f692bdff77b89f724a2f1e1eab |
|
BLAKE2b-256 | 7fc6dd26f380ca9082563891b754bfc81b80ce75c350e43f697ecd8d17b9ef2c |
Hashes for pymongoarrow-0.6.3-cp311-cp311-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8b7c70c7a8b457d6a47a45409d5e1d7fa1a9a71435b1d449e7bfd13b5162a8cc |
|
MD5 | 7c80ceeaca71fe2c72e3d8630029ea80 |
|
BLAKE2b-256 | bdd78bc63f5ca14725f43c369c5063a28808ddf0e454455e272c591772ac059d |
Hashes for pymongoarrow-0.6.3-cp311-cp311-macosx_10_14_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9ac332151716416ddc8912709fa9e65b03e3ade55e8b22bcceeb5521eddbbd79 |
|
MD5 | f3a8a8dc0f58ed9d8b467a6bbdcc2751 |
|
BLAKE2b-256 | 1b72395f15266f985f51ea43bcfbb54108b7423cc1a0dcd1064c310299c5fbca |
Hashes for pymongoarrow-0.6.3-cp310-cp310-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8e988a0208323c894186501c1b2c34b6fd6564df4ee8beaf8e95198030a8a8fa |
|
MD5 | 13cab069f7b4a9c768001c76d9738fa0 |
|
BLAKE2b-256 | 77a9b2d988e9e8a2035b8fd5247038a8e9401b5d693aec67518a1b53366b9adb |
Hashes for pymongoarrow-0.6.3-cp310-cp310-manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 918f95c3c51613a7bc9774255b6355dc0c078d8d151639a6f3848e17c79036f6 |
|
MD5 | df109cbb08b5092af22dbd6162302bb9 |
|
BLAKE2b-256 | 1f02bbc7817d481e3b744aa8c72c076ceb203b392a417b6543e84ddaee509d9e |
Hashes for pymongoarrow-0.6.3-cp310-cp310-manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 48c5b543e976370604c176a67f1186d59c6d91859cdd57c74e010eed0a9fe526 |
|
MD5 | 6d43fad8987ad83405e7bbf88ffc8fb2 |
|
BLAKE2b-256 | b049eb37ee059027c779b3088bd52938661f4e018d8682e93cff9cacfe606828 |
Hashes for pymongoarrow-0.6.3-cp310-cp310-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 48f56c5202c402d20b40cedfa9a1fabe061a9020e89caa12e1fc39df9420a595 |
|
MD5 | 414dbb7c99141cf8a6484e7f0c76f7ec |
|
BLAKE2b-256 | 53ed5e6fa668be1b927adf4f0cde37de6c3206588a63af3288758f32c16620ea |
Hashes for pymongoarrow-0.6.3-cp310-cp310-macosx_10_14_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 743bfb9cc1dba0990599b33370e586517251e2276034225c978e2333b9c8c7c0 |
|
MD5 | 2f65f506d7e1698a5de454bf03c66cfd |
|
BLAKE2b-256 | 9294c69c7526c6506e1914dc514e7f6943c4eda49da63bc5286ad1099ad53c21 |
Hashes for pymongoarrow-0.6.3-cp39-cp39-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 485f067212babccfdf5f454f46a924a217586b79c4f5a64e233a37e0cb943df4 |
|
MD5 | b13e22c71b06b348346d862cd5f1a94e |
|
BLAKE2b-256 | 32f51352b50a7cf0e9b913f761abb3dff4caabd32c6dbcfbc35f0a777450a023 |
Hashes for pymongoarrow-0.6.3-cp39-cp39-manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6647edb13432ef2306085ade6a205c93c0e72689844d8266eddc4407d1ade8f1 |
|
MD5 | f49d75c2cff8b97c470dd25c4706a40f |
|
BLAKE2b-256 | 8867c7ac97e6729278b1197b32de645d6fd4ab7c26ea379fd383f5b9cf09b033 |
Hashes for pymongoarrow-0.6.3-cp39-cp39-manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | dec7f07ca11af3a4888e50d12f2c9f5fe3491f246d48ce4ef9dc6c1b10c9de3b |
|
MD5 | ee7b40bec27a7a71e5324959345b6b6b |
|
BLAKE2b-256 | 3c3e78c8dc05d26e1715e4bf07aee91797844fc97f89d682819374ecd2abee32 |
Hashes for pymongoarrow-0.6.3-cp39-cp39-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2b64afe29e8ea4a08420eb39fdb1f6dfa66c5094d957a94792ee9f34510cc371 |
|
MD5 | e9ee495ddb94343137f9eca1787124ad |
|
BLAKE2b-256 | e1efef5e7f0eea5b6213edf68a0d0ae0a1d196122c5e3613b76eebce7b39643e |
Hashes for pymongoarrow-0.6.3-cp39-cp39-macosx_10_14_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b364c2cd4ee1897595475088b03e8637cc30a219a5ff23662070291ab5598cad |
|
MD5 | 11bc78eba9045b7dc50c6b38df18114f |
|
BLAKE2b-256 | 82685bcdc8aa636d371a482e4d57d7a714b45707d4d4a80deff9bb4d777c7911 |
Hashes for pymongoarrow-0.6.3-cp38-cp38-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8a324b11497a370145c603d62c5a969a5628d4b7cdb71fbb76f7b33d85f3d79b |
|
MD5 | c167462fd5bb1c17bdcadc3893cc295f |
|
BLAKE2b-256 | b88662411332bda707cef1fd10b22b074fe822959ff43da75a7dcddca80ce18c |
Hashes for pymongoarrow-0.6.3-cp38-cp38-manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f5d306e35aae64f04486240aebba4a5301e345661f82262d666d1e60f1ada128 |
|
MD5 | 28b5c335ff8c01026901f91ff3e74f79 |
|
BLAKE2b-256 | efaaa2423c272459768d78b80de5e1c1c097d875e77a567b4385d53bf4766445 |
Hashes for pymongoarrow-0.6.3-cp38-cp38-manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4184e0fcfb8377cbfb6329b7e08fa9ad5c6e8ebad4a6ff6d9a9caf7d37d124d5 |
|
MD5 | 003e0d3de89fd22166b90de94cc84283 |
|
BLAKE2b-256 | 577820a6a68ffbc78307c9fac4ec0ec87cb84798dffc29e010dae55d88c0c674 |
Hashes for pymongoarrow-0.6.3-cp38-cp38-macosx_10_14_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | edc762d073979129dc26bb9976b6e536ad4c6d57063d477eeff36322d9cb2551 |
|
MD5 | 8fc103bc3a56229155ac8e326c16268a |
|
BLAKE2b-256 | c5d4df9cc954a3dd2cef06934faafdbd0c579ba19d3ed0902cbdf32b4c1bbfed |
Hashes for pymongoarrow-0.6.3-cp37-cp37m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 43261af5f047ef17e05a8b0f8d3ab08adcaadccff095486b45ad1933125e35cc |
|
MD5 | e97d9f367d9db612011dcb7a2b80ba1d |
|
BLAKE2b-256 | 783762406f4326d08b931496710414a7c24950d1b2ba1285a85ae2833220e7ce |
Hashes for pymongoarrow-0.6.3-cp37-cp37m-manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a977ae0500b4b9321df7030aa62662b125db26b7a9e16f50ef6ab5fcaa8b167d |
|
MD5 | 95abbf842fb2a877152be2ac079beed7 |
|
BLAKE2b-256 | cfc5f4e679f21fdd16fc796e051a1822fa12621816a5f0dee2478a91c43fae59 |
Hashes for pymongoarrow-0.6.3-cp37-cp37m-manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a23447a76d22c24908f877909378d8638629ad6f86b3ed26d92a34f8426ec67f |
|
MD5 | 1b9a20999ade16481564477e664f5362 |
|
BLAKE2b-256 | 2e8e9910cfb7010aa225c46ff32b163e82bfa731ac0dee68b0337db7017f8f81 |
Hashes for pymongoarrow-0.6.3-cp37-cp37m-macosx_10_14_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5a00cce95f787688acc77e49872e8fdc55442e775670fa9975b538949b8d28bc |
|
MD5 | 799826fa1d4885b9412cffc992b6ee80 |
|
BLAKE2b-256 | 451bf67e8b1e14b4b3b5816f9d775f41142e0af4aa92758f8567295664244a37 |