"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.7.0-cp311-cp311-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2ebf966eb847d410421b09b9f5b292c98b1f08f9a9dbb36d9854aeb0c4589e9a |
|
MD5 | 4f46cffa669d6aabf37fd52c87e52fcb |
|
BLAKE2b-256 | e30311ec27202fbcb4fb1412d56b7fc67e9c9d6fed865fafaae3879454c09d49 |
Hashes for pymongoarrow-0.7.0-cp311-cp311-manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 967e89c6b57418dfc2913eeb1bde781427f8aa721a236f11f66192163552f3c3 |
|
MD5 | b4e5f9263c73efb0100253ee4497d105 |
|
BLAKE2b-256 | e1d064892c38f86e003b1e2b6c3442feb17d8ceed5f4d943f1c85655c15d79ee |
Hashes for pymongoarrow-0.7.0-cp311-cp311-manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | cfb9718d4e0ccc792a511718b2bc067c3c7a79a18fd5f137aec01e6ff45c5c02 |
|
MD5 | 048b089582093e42ffe323aa2e668083 |
|
BLAKE2b-256 | 94b27bffaa03476bfbd24dfeda4a6ae8bd5825d7f516c33331f8608fa5517fcc |
Hashes for pymongoarrow-0.7.0-cp311-cp311-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | cec315dddda9bfc395690a8b7ad8d9712ab31b51452170c374cfce840eda1618 |
|
MD5 | 8f44463286428b1bb3096a8e9268d42b |
|
BLAKE2b-256 | 5a980b08a0cd4168c5428eeb0401fabc09692feb5684900061480e7c91125817 |
Hashes for pymongoarrow-0.7.0-cp311-cp311-macosx_10_14_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a99de0dd4e92310638090b60a7c766d76b7073ca4596bdd4f1372262e6828707 |
|
MD5 | d00499d45246b0e01042dec64a8539ae |
|
BLAKE2b-256 | 421d35aa2acd2887e0a93f0b05d6f2f7e61198e53a31c45f261cf0b7b45cdffb |
Hashes for pymongoarrow-0.7.0-cp310-cp310-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 38de6448c32ba66c0391dcee7d3e60fc363d7765d795c5fa30f5d25aefd9c129 |
|
MD5 | a8f1136aaa99125eeb3245293b933699 |
|
BLAKE2b-256 | f6c4b41545ec42e3bc878d2d5a939601c03b137227b6e9a36bb7b25974104581 |
Hashes for pymongoarrow-0.7.0-cp310-cp310-manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a01738335384f45c2ff835efe88ca94dd1006a31104fa72d0983c949c5dfc6ca |
|
MD5 | ff5fc70f8d3a3975b801b3a0b8abeefe |
|
BLAKE2b-256 | 1bf9c0493ef62ae4e5a55c831e9da1ee7ab1ae97ef8f44c2720e563bb27dcb7d |
Hashes for pymongoarrow-0.7.0-cp310-cp310-manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c3d6122b1f774cc67a3731fa796fcdb2a1784e21741089c0f0ab640b61c84cd9 |
|
MD5 | a3079ccab91e4f905e7fdb18bd23f572 |
|
BLAKE2b-256 | 5a4d012b8f513bf39df4c3026db9b1b46a79712f848d94c1e7994d63c5b069a9 |
Hashes for pymongoarrow-0.7.0-cp310-cp310-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9aa97065a54855401b2dda99d6f78fb33a4965361f273292b7dac9684bd8a3db |
|
MD5 | 2d26d1d4209916104638292ed421777d |
|
BLAKE2b-256 | 9ab1a69466157e1cebcadca60f65d0b42ecbf8527f6ef1329ddf025232349979 |
Hashes for pymongoarrow-0.7.0-cp310-cp310-macosx_10_14_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d7321231a7c4001e3456097136b0fc265fadf45cc00867d26b87b84c62a751e2 |
|
MD5 | 6a0c85caf77996873cafe7919ed7df88 |
|
BLAKE2b-256 | b26d603ce082398eb46a0322f2d1e841463bc246c8e5d22ba114d0ed33878994 |
Hashes for pymongoarrow-0.7.0-cp39-cp39-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | cf6cd11f72c61fe18d67ae90fda1cc2c19a1f3eacbb5b1189885ac0ed7299cfb |
|
MD5 | 62c2259c13ae71f64cca5cdebd25a282 |
|
BLAKE2b-256 | 23a9a6922a4ca5e35f7a861fbd7c0320ddbf1821ba46b9abec1ad430869e09ac |
Hashes for pymongoarrow-0.7.0-cp39-cp39-manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6835a587710066d980e03cd5fb6d9453660e75bf26af816ec6ebec805ea8eb9a |
|
MD5 | 0c01e67bc6531eb4dad7a4418f5d5aa2 |
|
BLAKE2b-256 | 7321f65a8673688365809b21f6205aad2d5b7b19dd4b793f402ea5d6f938620e |
Hashes for pymongoarrow-0.7.0-cp39-cp39-manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 312a8e1198fdc9f10173a53bc0f5612ae99a589207990f1c54ab5cd9f9425567 |
|
MD5 | 11acc75b9704e90d22a73db92713a990 |
|
BLAKE2b-256 | c357a227e0fe4f01626a37c4a4afb04fa6a0f48dfb19b6a97f67984f99bc47df |
Hashes for pymongoarrow-0.7.0-cp39-cp39-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4cfb124ab95625a8e1c0745aa0181aca413b74260df14f453781fe6fb36b52cd |
|
MD5 | bbf185924ab432dbf03375179666e580 |
|
BLAKE2b-256 | 05578da8ceec9eb773332809fd5bfb69599629dcebd3a82ce98f75d0c3e63400 |
Hashes for pymongoarrow-0.7.0-cp39-cp39-macosx_10_14_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5da07175254e0178ad191dee8c3acc378f27d3096f9cbc4d7f04674dadbd62e3 |
|
MD5 | 43ce05fe23bb52f03d6666d50351171f |
|
BLAKE2b-256 | 45c01286dc7b90a90b769f9b65f437f9cad4f08580722bd5b3e59679262d9e21 |
Hashes for pymongoarrow-0.7.0-cp38-cp38-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 08cde1b49d405a0f444b0385a2a902c68424f739fcf8c78f76a0715601126823 |
|
MD5 | 79f5a537cb34789a42cf38c9a3b1c6fb |
|
BLAKE2b-256 | cc9bff9415f0cb9b746ed5db4d40f22ac5ebc2a82239a801b6abd81c20b669a0 |
Hashes for pymongoarrow-0.7.0-cp38-cp38-manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 84c45feccbc8ea5ffc3ec70dd19c5928f05ec36230d1dd2d02e5004567e65f22 |
|
MD5 | c83216ac44cdd86c550c846ae698a935 |
|
BLAKE2b-256 | 64da20b64968adaa54bd4e4e44245c0f825b0ef9bc44195a957e20931b27d93a |
Hashes for pymongoarrow-0.7.0-cp38-cp38-manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 57f6ca741fdeabdef75e9681ff5732abdffb038f8bb257c7b4127d2a3cf61e15 |
|
MD5 | dfa9efaa334b3e49b8426c63ea92254e |
|
BLAKE2b-256 | 2115a16d4e5fc116a6b0927607a739a79fa4ab5728e70a31a88ceaffa6fc4342 |
Hashes for pymongoarrow-0.7.0-cp38-cp38-macosx_10_14_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3399bd5dcc22097a158cac7bc21e1306c52cedaf2cef90e496a8727678a27ead |
|
MD5 | 0b970ea0d35c9e81ff71d1240c9a20c7 |
|
BLAKE2b-256 | 1f7f0313ff0740261eed2b7bf0a697ff48857a0e391dcd808b3f7a5a4a5f1a0f |
Hashes for pymongoarrow-0.7.0-cp37-cp37m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8452f74046b3823fcb9a49dc1d69cb7aadf53573364ec60ddeceeb3db0bf1c93 |
|
MD5 | 35c3cb4500227c81285a773501f01156 |
|
BLAKE2b-256 | b44c793aab2e6c7b67e38c5b83d30af1b1386f84e093f8fcfbe39de8bc74c3d6 |
Hashes for pymongoarrow-0.7.0-cp37-cp37m-manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5edae9cf694450ed07d828c483763c3c6fd93145390d4f1ce4bb7c3c50070c39 |
|
MD5 | d8b40b4d8af8a9bf612e7493c36133fb |
|
BLAKE2b-256 | 546e0bcfd52a48674ceec6a56193afe38f9207d41b8e389d9784d1d7ca10ba26 |
Hashes for pymongoarrow-0.7.0-cp37-cp37m-manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2ba27ce7df4d7c014088054c7d61d2d57ab90e3539b84220f1bcdecd6aaf4fcc |
|
MD5 | 6b4ec88c2b4b3d30d887d3764637688f |
|
BLAKE2b-256 | 79bad30001eed4da945793f47e5506919529cf34527ef37a0adeec840a8673ad |
Hashes for pymongoarrow-0.7.0-cp37-cp37m-macosx_10_14_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7ce4a2880f4400f611e57410a5536d5e396ce2746efbfe63297fc86b5d362956 |
|
MD5 | a65ac4796532e5780e299df4c8f15f72 |
|
BLAKE2b-256 | bc0f08e731eb553d0dab4c00330423ab8f7af071e8272ff29c37af47fb326089 |