"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-cp310-cp310-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ac953020ed00abda7324c17034816447837e7f5a05ac7e35cb7bb7483a6f044f |
|
MD5 | 688d0dd4f8e2a63f56518acdfc44ee7c |
|
BLAKE2b-256 | f19b305b655767254d86cd525c8989be8d2b37b0fec6213bd087291dc16904a8 |
Hashes for pymongoarrow-0.4.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 28da95764e2e64ca6395e3aa6341ae4d6c7ad744ca48bc5660df56644ea7f681 |
|
MD5 | ea4ecee406c1074bf2aacb92d78119bd |
|
BLAKE2b-256 | 81eb620b6d1ca30f0c5c1eb2e195897ea21f8ef21aa7da080415cf80ac2170f0 |
Hashes for pymongoarrow-0.4.0-cp310-cp310-macosx_10_15_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1377842478a23dbfe1bcecdefc391e7676283a74d8115d4a18258b9a0e07a638 |
|
MD5 | 23b45910bace0c2edd2b4cfe580f1390 |
|
BLAKE2b-256 | 6cfaa1ec2cbba07d7090a543fe5e27e3e613f84742b8a90fa5a96b33737a4252 |
Hashes for pymongoarrow-0.4.0-cp310-cp310-macosx_10_13_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b5426f4f835ce0826003a228a433c4c96fd81449456d1d5a88d055d219359c20 |
|
MD5 | 1566fb6b764d329451977ec4e3804f2b |
|
BLAKE2b-256 | 9ee8ac0e081d10fe793325983b0df5bb6fb467de8ec1435ad0e41ac1893b4d45 |
Hashes for pymongoarrow-0.4.0-cp39-cp39-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 40b8de04718d735ad4296a99c75758436c5601d7684c071635694086fa6bae93 |
|
MD5 | 5219db19806d53f24c71c3400b734c0f |
|
BLAKE2b-256 | 7b57a2692f9b1f1c829d6cc57c5a1e0edac2b4321b8e156555c350fd8f162b26 |
Hashes for pymongoarrow-0.4.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6897ac0517fdf9ae6e6f83e1b44f63afcc67368133aeafd44527d042c05ab142 |
|
MD5 | 0ca03d47d6e34525ee5b912ffba8000f |
|
BLAKE2b-256 | cd89a9e33e64f6d536f284bfc4e1d4a983ab74dfa95f6e1132677e21e1d4a959 |
Hashes for pymongoarrow-0.4.0-cp39-cp39-macosx_10_15_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a47351f63002bb18c93ef8c79df3be759e588b231d31a3edb433526fff606f1a |
|
MD5 | 81f83d562cce54c0e68e70f1dbd168f1 |
|
BLAKE2b-256 | d9119d8f72d60128b2bc9385e5aee21d9a1ba799226c5ed18f53560eac30d435 |
Hashes for pymongoarrow-0.4.0-cp39-cp39-macosx_10_13_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 134744bad918a6f58a2df7fdddabf6ed7e99bd31c93cbfd989efc4c0dd6faf7b |
|
MD5 | e78fe46d0a2a7e46420676eecd5256a1 |
|
BLAKE2b-256 | f4ff9470917cad2879e550d9de145c3bfc5dfe401002e0cb5bedaf367085468c |
Hashes for pymongoarrow-0.4.0-cp38-cp38-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 27251d4222f7e0074d5544e9815a6cb7e88285859365c1164052b81c2e5210fd |
|
MD5 | 93110db4838e0a62d001e3a783dafd54 |
|
BLAKE2b-256 | efda1671938cd0098344b1dbc6975d519500a95cadc301ca9a40be49bd318332 |
Hashes for pymongoarrow-0.4.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8867ce3de6fcbce7dbc4d3a6a94f7e7023dd4515860cc7722cde621473ebbaef |
|
MD5 | 12e8a3db01f32919cb4684c09708bb2a |
|
BLAKE2b-256 | 73c0605547b31b764b41209e115a0774939f98b7166df581b8c73b1e528ed6e4 |
Hashes for pymongoarrow-0.4.0-cp38-cp38-macosx_10_15_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e844a2806dbbda5b82db73965ea8158dcce3c6135a9dd38fbaa08cffa2150da2 |
|
MD5 | 3f52c778ee183d52a07100c5dd305267 |
|
BLAKE2b-256 | 15b1161d42caa780feb89c4adac3999385d2f91e4f22bb1ff42fb883f0fa76cc |
Hashes for pymongoarrow-0.4.0-cp37-cp37m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 40e8458e61b6baabc56805dc11d8e72324dcbaedc8e6965fed619db48e574066 |
|
MD5 | b20ab7e01746aae96ed06b3efe3db1e9 |
|
BLAKE2b-256 | 7dd906ab96a918f2fa1bb50872cd1350c3b0b01fe084bfeb043cb1ebfb52cce7 |
Hashes for pymongoarrow-0.4.0-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5a734af0461af3f9bdf2a48e3bd95c66a9e61e1e19b5c13603becff2675dc78f |
|
MD5 | 22898d90bae4c58a0e3bc8f028681cee |
|
BLAKE2b-256 | 737db976b048935e54a8049eadf15100964505af4c302192c5515841f313287d |
Hashes for pymongoarrow-0.4.0-cp37-cp37m-macosx_10_15_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 48eb0cd41bd688d5523710ac91d7077c90f9956c0832af65474e5d0d4422699f |
|
MD5 | de3978b66d25909765493c0dd7272ae6 |
|
BLAKE2b-256 | efa94cf3fe11df15f08c24cb3508a7ef5c4b9b609b31289002b0912de50e1e3b |