"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
Note: pymongoarrow is not supported or tested on big-endian systems (e.g. Linux s390x).
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-1.1.0-cp311-cp311-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8cf26f0f0c51e67e943248c57428dad7de456ee8631d1af9cf0192f7423fa830 |
|
MD5 | f58e1454992ab1e3e958a24e37e467cb |
|
BLAKE2b-256 | 80ecacc3ed90f48154ce13a50500c990f1d0702e704034879dc4169d6df7f402 |
Hashes for pymongoarrow-1.1.0-cp311-cp311-manylinux_2_28_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1a3284ea4a70e046ac09f6e1e6eed3db14b206a19d4660987b3c6fc8b0fff3a1 |
|
MD5 | 59aa668e07156e5dc8f1909b7edb9b4f |
|
BLAKE2b-256 | 1dc15299e0315bb8d08b5634e55edbeb7de68fa8eac0313e1a121a81c16b49dd |
Hashes for pymongoarrow-1.1.0-cp311-cp311-manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4266f2f2d07cf192c22db217e02863609813d3f6a2aa6323fc9b61f868dca318 |
|
MD5 | 38477402980c7e2ec6ed47a357c081df |
|
BLAKE2b-256 | b22baa45b11495ce7ccd31f950bf48afa4493cc53ab94835e07dc66c69ef5b03 |
Hashes for pymongoarrow-1.1.0-cp311-cp311-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d969f64791b8e0baebb9e5907562641d5e4913a80de8ec362703b969c964590a |
|
MD5 | 74347c5adffcdf71aa5a6ed38954fe09 |
|
BLAKE2b-256 | 125b6e608026c88f980fe205ce1072211bc72cf2e45d83b510a4ca656e21f79d |
Hashes for pymongoarrow-1.1.0-cp311-cp311-macosx_10_14_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c0c668ae2f0eaf5342dc3ed3551d3cda7f4363b76e99e96c890cea17de554ea7 |
|
MD5 | 5c6af78bc1ca92e15ff025e5c82cb086 |
|
BLAKE2b-256 | 2d29ff6be5be77eccf966f24b9535be6625113678a538a440704a8a7a6211d03 |
Hashes for pymongoarrow-1.1.0-cp310-cp310-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b4f004d255fe913314af0124be1d4cde70e31ff340ef8c5e5b6027b461df9989 |
|
MD5 | 774591637462057d9be08b569115cc15 |
|
BLAKE2b-256 | 329ec2850c4b4c0d4bea695f29d4d929bd816872f10ada64f363b5e373c7a3e1 |
Hashes for pymongoarrow-1.1.0-cp310-cp310-manylinux_2_28_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e432894bd08ba36807e2def4c4b3047d7aaa2c93e85f71211d13cc14bf1f9c12 |
|
MD5 | 888d6ffc091d4bd125587f14901df92d |
|
BLAKE2b-256 | a016ac4653950aa490dc0f43c104c4cad08b83d324734dccec4f29ffe50ccbd2 |
Hashes for pymongoarrow-1.1.0-cp310-cp310-manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | af4a0751f289628a0ceaaceb9b9b6ab2d8d795374d3ecb0743d8a48553e10de9 |
|
MD5 | 1a0153d552c5245203193d7a5b47da85 |
|
BLAKE2b-256 | 8a5d4c5cbe9ba8f31fdc8459c3c7e496c1af69c343eb1d8a3f49da7bde308066 |
Hashes for pymongoarrow-1.1.0-cp310-cp310-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ab1e83f47190fac1e73c93f5473fefd621b472c4e1fbb0b477bbf90bec0474e1 |
|
MD5 | 954318b326313c7778cc3c1f9d390cfd |
|
BLAKE2b-256 | ed24016ea7880a522e2575e33f141d383b5cb033bfd6f71c3eaee32d7594742a |
Hashes for pymongoarrow-1.1.0-cp310-cp310-macosx_10_14_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a8523b0710627d9dcc3fd8185db1de1f7ac7081a56ac94d1dffd78c54bedbfd1 |
|
MD5 | d2f2b87ae6ea78fdc0513054209bc696 |
|
BLAKE2b-256 | a957d6297ef0e97267f2c36a7dd238a8ac70a37fd7948ba17cb011746b4d38de |
Hashes for pymongoarrow-1.1.0-cp39-cp39-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7f86e79b24af652cd5e9f80dfb779e4ef6e3d1b9cfe05fd23af703dc48af1efd |
|
MD5 | 3112dfbc3d562ee8c9e4d412399bcd45 |
|
BLAKE2b-256 | 0d683f3feb1554abb308983826d719dc4bb5529a24f186d82fdcb45db838d5c3 |
Hashes for pymongoarrow-1.1.0-cp39-cp39-manylinux_2_28_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 901550e175545a6f86762b06fbd5a133388299554e2448809c5043e2891c11ea |
|
MD5 | 80c563ce473a0f2e74d3fb9fba9cad56 |
|
BLAKE2b-256 | 88e20ca04421609aadf502ad28297e6439c75283158879af9ac73d91ac7bcabe |
Hashes for pymongoarrow-1.1.0-cp39-cp39-manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c77162114bcadbc5b9cfd1581b62915cc622dee516edef04eef96b68a60b1085 |
|
MD5 | 8b605703018500198d50a1c6096c7796 |
|
BLAKE2b-256 | dcf1d2cae36431beb100ff0d6efd758f01017dffa2419c76f29ef2e93b2110a2 |
Hashes for pymongoarrow-1.1.0-cp39-cp39-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 65f0410818cf13615134722b7e9f93181bb78536f3caede221fcaddb4a5547b8 |
|
MD5 | 89881b035828d08018b9abdf7ba1c651 |
|
BLAKE2b-256 | f3d45523e29b015e3b45ab71f32bdefa0f6ae51ea006f4735b9e41f31124f9fb |
Hashes for pymongoarrow-1.1.0-cp39-cp39-macosx_10_14_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 92f2e163a82431f7de4952a45ca73d5bf20e4d2f3f1cbe829d89489a7be61b9a |
|
MD5 | 6e9d0003773077b0e5a8ec308100ee3f |
|
BLAKE2b-256 | 4546d23ea9aa7300ffea18dd89e4ebd04b4d3b0c10b004cb5216347aa7be788e |
Hashes for pymongoarrow-1.1.0-cp38-cp38-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3cf87c2f047010c2fe34fca41a4daeca7bd40cbde1de01ca3a27e37ec364eb6a |
|
MD5 | 5e615748cbf2dfedf98b1d2311aaa3f2 |
|
BLAKE2b-256 | 1e46d619ca5f85478dd900cf7e98f780452259ee723b0bfa163423965444cf66 |
Hashes for pymongoarrow-1.1.0-cp38-cp38-manylinux_2_28_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 55a725f5ea0f6402331ae248352ef6eb25ddfa6169259882ceac703a5479582f |
|
MD5 | 9fbce8880475240cbbb7567cbf92a83c |
|
BLAKE2b-256 | f92a5d4da68ffaf972ca9852b533c515748e6eaedc069467aadd7a4d2224d8a7 |
Hashes for pymongoarrow-1.1.0-cp38-cp38-manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 84eb3e35b55e3b8b8b063adc487d3177f37ade1138bf582ea9e3f957bc8bc60b |
|
MD5 | 50d5f6ad2804ea54a28845514ee0ef67 |
|
BLAKE2b-256 | 6346040d9da5d1f4386597888e7686c931d747e9a853fed414582920609dedcd |
Hashes for pymongoarrow-1.1.0-cp38-cp38-macosx_10_14_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 192981dcc9925383019ae2ba8f4d3bc6f3bf1532cdeffac319e4554c4b06bd50 |
|
MD5 | 0d3269271ba1ea91879538d0aa209249 |
|
BLAKE2b-256 | e012e250f0486aaa99696104d63f39dac0c5f9839c6b933f49081f3431a82d0f |