"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)
>>> 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.5.0-cp310-cp310-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 47d2379e5288e26cdcb24dcdc717bfef520c11d485973aeb167bed3b1a7964c4 |
|
MD5 | 4acc03b3f1959c36e4e99b48e940c4b5 |
|
BLAKE2b-256 | b8849915848ea9c5b7bfb7454c9db19096a1ead4b3b7615d785fcec4456e3af1 |
Hashes for pymongoarrow-0.5.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c60c0bf9ede64dd62bb9e24cf56be2756f038e9f9ff78958ffd345e2cf8f30e7 |
|
MD5 | 6166a05b99318603f33201a9c7f0694c |
|
BLAKE2b-256 | 70b0c070f003bca34bd745b3eb13c27beba70897445d5c536488dbf2b0f6da32 |
Hashes for pymongoarrow-0.5.0-cp310-cp310-macosx_10_15_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | fdf1109671a16be27491ddebe511027dd09ad80b9fe863a69496113a9976a079 |
|
MD5 | e74831d909142f539b17dbdf2f38614c |
|
BLAKE2b-256 | 02b71c2cd578a7197dd670cc7aa36ffb4dfbb0d31543304d748349caecdb1b10 |
Hashes for pymongoarrow-0.5.0-cp310-cp310-macosx_10_13_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 021d7e4920b3da038ddcb6ff83ffed05a734664df1f0b9e082ccf4dc4ae05521 |
|
MD5 | 39d319d1e712bdd3f2327375bede15eb |
|
BLAKE2b-256 | 56d77f6f29f4be38b6cc8804e1aa590532e2a38781162e797b9f47e6e93d248a |
Hashes for pymongoarrow-0.5.0-cp39-cp39-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f2455b50c666991fe3dbf95efc779413000d854f89f3d822d6731dabc2a91d09 |
|
MD5 | 67bf5e25d3fcf5250604b8e9ff98d61f |
|
BLAKE2b-256 | 6698cae867b3dd5c6ffd561048351eafa9512db98b1d84d47cb18b1ed8e0a88b |
Hashes for pymongoarrow-0.5.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5fd54559e50fa9d7fa08294322278274b39acb78b03be5a82b889f868f595933 |
|
MD5 | 4741aaca15b0bbe7a7bb24120c8fbdc9 |
|
BLAKE2b-256 | d6d9d0b3f7cdf8fd0bd8df3790221a1abdd393f40f57902200e1cd382b22f05b |
Hashes for pymongoarrow-0.5.0-cp39-cp39-macosx_10_15_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d50c00c55b3b695e799bcfa6365e8eec0d8173ce876a3481cab9adaf8077b0d1 |
|
MD5 | bcd692628bc5b230bcfd4caaf90309c4 |
|
BLAKE2b-256 | 5a97edb5d61488a1bc6c7b9cffea922fcdbb3162c164641742231e93ace8e762 |
Hashes for pymongoarrow-0.5.0-cp39-cp39-macosx_10_13_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3526e3ddfa4e99a992dcb4eca72e9d4461c254764803e6efc2c2083242defa0c |
|
MD5 | 9b8261379ca01e544bdbb6b2f9aa21e3 |
|
BLAKE2b-256 | 97b985018337fae710496a680bce039e71dd4aef2749acac137e6f9d58f84556 |
Hashes for pymongoarrow-0.5.0-cp38-cp38-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ae28af1adef43a57e2c8a5d3ca9f5e5fa2132d794c4a0aad5598e513eeeda675 |
|
MD5 | 8817b27d30eded41894da6aa3ee32132 |
|
BLAKE2b-256 | b7f3a68ce96e4eb66eea12362d1451b90ed5520ded993f7079f2ada8dc14a0c2 |
Hashes for pymongoarrow-0.5.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | df910b1bdbcb8e0408d6d532154c2508cab96ec3e2616fe66baaa6847d3d6bb0 |
|
MD5 | d48258e243984ec0ff1e9f5707f0fcc6 |
|
BLAKE2b-256 | 4538810099b0e26864857257a8c5306ce03fc70b8b8e00c6d40f39563ef46ef8 |
Hashes for pymongoarrow-0.5.0-cp38-cp38-macosx_10_15_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e158dafa67e753f98e0ac44f76052c5f38266a6003f99a8e206a78b0b5bcd23a |
|
MD5 | 97178cce2b63565e52a1c19d69f7c2ed |
|
BLAKE2b-256 | 9f293c9b20b860dc702d27d024664de21aae1fe5009b17ab70733c3b8478f177 |
Hashes for pymongoarrow-0.5.0-cp37-cp37m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 10a992f6625ec8cfc7fe0da86a4f4a26066fe6ccf8a884b7936033c8908ac4bc |
|
MD5 | dc411caae6e318b835a0e4feb67a17c8 |
|
BLAKE2b-256 | f402aed161886c17b4f6402d0a85d7cb3c9f7e6a03d82540d9127f7cb206030f |
Hashes for pymongoarrow-0.5.0-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 426f354e298d09af1c039666feb6c1d6c80b3c33a317edf65905f48674a62d59 |
|
MD5 | 5aba5269349b623dc58956e732ba257c |
|
BLAKE2b-256 | c1e52dbab8204ccb7f889d9f485e69e89604df66fd03bd62c8899047617a03f4 |
Hashes for pymongoarrow-0.5.0-cp37-cp37m-macosx_10_15_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9ea363e717dfcae0478491bfe9e874dcbd3a451b340ed231df1c75dcac857e4e |
|
MD5 | bb0bb21c2259a62774664930078ece1d |
|
BLAKE2b-256 | 9dfe8697bbe30c5e7b27f51efa3ff84b98c929e6337632e4eab75457d65c0675 |