"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.4.0.dev0-cp310-cp310-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | bc285199a26c61108edc9776561a695e662f0824f6cadef4a5e4fa7872d265b6 |
|
MD5 | 3b478dc055bd62d3e5ba3c0a5b5ace4d |
|
BLAKE2b-256 | 030284492ac38125dbdc41050afc4caf629a4bff9c9df3c41cefabadd1e7821b |
Hashes for pymongoarrow-0.4.0.dev0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c18818411fbfb2ddb4b5cde3c2dc2691e1f0d506de41d2a1521333dc72de8922 |
|
MD5 | 6db448718612cb7f03e4bea6ec95791a |
|
BLAKE2b-256 | 697ee141207f3645cc83e279d3831f80c51a635980dba7e05505c5b9de03a73a |
Hashes for pymongoarrow-0.4.0.dev0-cp310-cp310-macosx_10_15_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2a38f58baa6e2de8494c75fc4cd58ea6835055fadd49557238c47ad181a8343b |
|
MD5 | 3260b5079c6beaf40e6eae1013cea28d |
|
BLAKE2b-256 | c64fce55e1d7220e68c625443eab81ec96c60a762427815187eb26282f48fc5c |
Hashes for pymongoarrow-0.4.0.dev0-cp310-cp310-macosx_10_13_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3c394af4387c21d0dbf28777c3d4d682652b283e3933ca1768d944875162bd2e |
|
MD5 | 5847442a4ccba53e66de6a756ea66f2e |
|
BLAKE2b-256 | a9276f88722130cbad5f8511496e9a3bcccad826521fea7473df671eb2a4d578 |
Hashes for pymongoarrow-0.4.0.dev0-cp39-cp39-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4d729e50922462a65b7b6113b7aaa7e1bf04200191f49cdfd891711b31af4fb8 |
|
MD5 | bab6b9aa06901d2286651803754846a7 |
|
BLAKE2b-256 | 02bb710214b9f360f2b33d1582c02043b99cc0366a967620ec54ae6bd28483f6 |
Hashes for pymongoarrow-0.4.0.dev0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b7d46d19ec2b03d4d3a2faae413df4690a148a0ffccfbabe2bff46df7277fa6d |
|
MD5 | 8dfcd58d9c9b8201d9f68d693f7e2e9d |
|
BLAKE2b-256 | e6f3916e528e60147e9a17062e234c4a844f94343684a1865a8f8e0733c1dd4a |
Hashes for pymongoarrow-0.4.0.dev0-cp39-cp39-macosx_10_15_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f0a8f9f340b68ad64679cc48da3c892524c5fd9dc0406544e2e10fa749ceb0a7 |
|
MD5 | 77d7ae43f130091a1d6d902ed874469c |
|
BLAKE2b-256 | b81fb215efd5a1b9c0dec7d9bae750192fe264b4f796fff1d6a28307623ce91c |
Hashes for pymongoarrow-0.4.0.dev0-cp39-cp39-macosx_10_13_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | bc20e15cdb26b1f44310bcf833c9097ac9e8ba31cbd57d57d21bc4c103e7be45 |
|
MD5 | 207638ff777c6d4d88c5dc5566202370 |
|
BLAKE2b-256 | ee74907cde27c3968f5657bfccc4c6c935adb458d984005f03e0c354577b74b3 |
Hashes for pymongoarrow-0.4.0.dev0-cp38-cp38-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 30276bd0aef857898e1caf68e89b59042e6a7649958d3bac35cc9ec4a5ca20d7 |
|
MD5 | e0bcaf862b027a38567dcf3e2fd2a476 |
|
BLAKE2b-256 | df90c83035f1f2f70bd88e63a008f34876ab98f83dd09efff689319d398324fd |
Hashes for pymongoarrow-0.4.0.dev0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e87381f07365ca05fecead1696aceacdadf54ee9fc4c518746943b423734f842 |
|
MD5 | 173847e2f4e5e66191d5e6bebf26469f |
|
BLAKE2b-256 | 85995e95ef1a8d9893c90fbaa98aa104459f63bff64edea1790c7041f8f62719 |
Hashes for pymongoarrow-0.4.0.dev0-cp38-cp38-macosx_10_15_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7e4f0e80895c7d231e39e7d563acf62e505846cdf34a6a411f043dd06d172404 |
|
MD5 | 24cab1a9981e771fbbe53fe1d0fbee66 |
|
BLAKE2b-256 | b3d1f4a98a879966ae84f8b64684824937603c5d6e4a4a475b4eeafedb661545 |
Hashes for pymongoarrow-0.4.0.dev0-cp37-cp37m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 908f3699ddf0975df975cec711539829651ede1d7a9fa69e4d97e2c35fafc4a8 |
|
MD5 | 2b89a19a515de7f595baae9930fbe117 |
|
BLAKE2b-256 | 4361538360a36f8c111757c3de4733a0b9feff03331d2d1a53bd107a0ade921e |
Hashes for pymongoarrow-0.4.0.dev0-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b04dd9af00aebe9ed8a36eb253ae91e2a730803f2b43ecf0e5e16e91092cee61 |
|
MD5 | 87d32699b24f41f3e54db6ead0138d22 |
|
BLAKE2b-256 | e8c9dc0db9c2dd5d4d5a57bb1f75ff6c42b5f2642e5ccb45d8637b53bf09b7f6 |
Hashes for pymongoarrow-0.4.0.dev0-cp37-cp37m-macosx_10_15_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e3d67a774b7e5944d87401b9cf0e0c449450a10170cb81cc911ebe1cf682267c |
|
MD5 | da0a5cb8c2273a1ddea49029233aba8a |
|
BLAKE2b-256 | 16710bbb66725b8dea63663be3bc09285bbb55a455d2af67787a3836408d13ee |