"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.0.0-cp311-cp311-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1f9cb5e19263b5e99fadcac8e8bf5a7b84ee3e21c7897c3970748c0e2fdfc312 |
|
MD5 | 3aec4d145249fc1fbdca56e4a8ab03b1 |
|
BLAKE2b-256 | a4b226b6edefa3b819188e1cf5cb5ee38faea06c234d50fc6bf470a0daa3b255 |
Hashes for pymongoarrow-1.0.0-cp311-cp311-manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 76f805efd828314a9b55721db734f2049a01b3444438293f88c175cf12a14932 |
|
MD5 | 3adb2b4226765a9c20d5f1a9a4df42a0 |
|
BLAKE2b-256 | 72a3f9902caa7763f5b5986dfc10ba67330eebee0e48af118aac1d0564e19392 |
Hashes for pymongoarrow-1.0.0-cp311-cp311-manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a0e0f6e0119364a2bb197e5a59b3d5bb545ee4a8eda1a894911b38a58bba2653 |
|
MD5 | 550f5b0f38449d7514a5373f9b0a7722 |
|
BLAKE2b-256 | 94c477047d597622509b57be186ad81b1ad21727accbf96e79dc912ebcb1647d |
Hashes for pymongoarrow-1.0.0-cp311-cp311-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b6cdc2421ff9eb8312479f3c759cab2b20f23a964a90085c8bee25171098b28c |
|
MD5 | 89761ee3994e71912eed6317b6b61af5 |
|
BLAKE2b-256 | 97175683f50d70513cdcb5154fb002e369226417d2e735bbd8454203df49e835 |
Hashes for pymongoarrow-1.0.0-cp311-cp311-macosx_10_14_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 286a2a01b2d60e04d7f429f7975a43959c6c4906acfd97a97d31ad29f2846645 |
|
MD5 | 04dc3968ab1d720b4d3fae819f67b326 |
|
BLAKE2b-256 | 552d4ce58e0259e233e10e390c73ca302049c18976b86db21f392b34a7b81ca8 |
Hashes for pymongoarrow-1.0.0-cp310-cp310-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4eda4595cf9b0419b27460b4ab11a4602f337d4a948edfb69c480c5092e15bcb |
|
MD5 | b1eb95d5c1646eb1729b5f0586d4214e |
|
BLAKE2b-256 | 756b64c5d9bd12d011dac111a6840d66f897e46285cabd76c6a78b4fca51798c |
Hashes for pymongoarrow-1.0.0-cp310-cp310-manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | bd8f24ed35c1f8970efd401c15b87c964af8bbcc0ba33a48de1a5e42bc310a6f |
|
MD5 | 4c5dab228479bdb8fcfbcf16185fbc55 |
|
BLAKE2b-256 | ea4e9f4617c53c5ebe7fb60ddadfd88865bffb9843a0db504d13847fcb18fa18 |
Hashes for pymongoarrow-1.0.0-cp310-cp310-manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 236aea4eb203bf7ba7014ec416f0bb2fb7775424f47b82842d36718450091e99 |
|
MD5 | 1ac4ca6503e9198920c6177628093240 |
|
BLAKE2b-256 | a6d98309c8b306fb5f31f3649b29d1df901562ba2661bb0e72b850a692cb46dc |
Hashes for pymongoarrow-1.0.0-cp310-cp310-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b3aaba976f26726c3f82a6f3f023ec86a59b69df96a1265286f922802677d8e2 |
|
MD5 | f597c6b835e9c688a0e299fe4082ccfe |
|
BLAKE2b-256 | e8bf029642efac58dbcf750309b72e504c721a308059a34e6210f21a5fc499cb |
Hashes for pymongoarrow-1.0.0-cp310-cp310-macosx_10_14_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5a192dc9a1067a763bda55a5a856909ea1318a770e15262a462ddb79a83e6bcc |
|
MD5 | b98bee853f16772f596934a21122370d |
|
BLAKE2b-256 | 5f5886abf3bee6233bfdcd84966085f06da6039750458f069103ffa968151120 |
Hashes for pymongoarrow-1.0.0-cp39-cp39-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | df68b9ca581982edee7e8bd3b8d9ea8f4b02d121f55fa66f15ccf3b0c30384f2 |
|
MD5 | 2332945a9476c8e835c644e5c13c48a2 |
|
BLAKE2b-256 | dd24ebc63d18d9141835849cf5593b22f0ba208970f66d0d02270719861819ed |
Hashes for pymongoarrow-1.0.0-cp39-cp39-manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 14e9f19f2089aa3259af39c2ef8a40729eb755fe617595636ef246d60dc82885 |
|
MD5 | 46cf9faf8d919d97193115d8d0cafac7 |
|
BLAKE2b-256 | 8c8e4ca4e8088ac2ad2e32d5853e28aac43f3f21ee81f11a2373e4f560143be1 |
Hashes for pymongoarrow-1.0.0-cp39-cp39-manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c57552703efacb1a6781a7dc340483fb7beef42cc4533381260fa8bd1d68c920 |
|
MD5 | 1cd01996b9473428655d4400b35afa1b |
|
BLAKE2b-256 | 056cd2be3e2ff638131714d0e1aac408aa88b64245f770badc7ef5ff02b4d1f4 |
Hashes for pymongoarrow-1.0.0-cp39-cp39-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 42a486a5eec900cd3c552abb39cf0f26bf26747b4cb0be1d731d0b1259f88011 |
|
MD5 | fa68e6b4b30bc1950b10c810e672951e |
|
BLAKE2b-256 | ea5caa0bcc1005e4bc4653b3dd7c66be37fbc08109235434546a38f2610be614 |
Hashes for pymongoarrow-1.0.0-cp39-cp39-macosx_10_14_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7a4dbdd1215d418dd1598dcc3b90f94b5034c4950817e90fd8de16d59ad3a9db |
|
MD5 | 009ac202c9ccc6338d57412bd2aaf3e1 |
|
BLAKE2b-256 | 1705cbf285a0aa621f150916473d2232121d66750ec59dfd117a820048203df5 |
Hashes for pymongoarrow-1.0.0-cp38-cp38-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6d229eeab1adba8024abab09407da70042087c4a87f98e3179e5814614f5c39a |
|
MD5 | d888212f41e2505b016c7f47386b476d |
|
BLAKE2b-256 | bc14cae4451cf988ea88dbbfc0b42a55a77cf5b86a4127fb5f88a613c9850673 |
Hashes for pymongoarrow-1.0.0-cp38-cp38-manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4675118197c562c24ff7241d3a49d7356d2688a81a0af710cbf033cc94491260 |
|
MD5 | 376dcff14c02ebba6eb695a55a2e512d |
|
BLAKE2b-256 | 478f50d6272ac944c07a190393ee5ba3bbebf359e0d119334298337780acd5d2 |
Hashes for pymongoarrow-1.0.0-cp38-cp38-manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 81c65fc5a656668bf5ee8f2ca60edfc18466e03db8256b29cbe98cae347e70fe |
|
MD5 | e84eaf705da309f649732260b767586e |
|
BLAKE2b-256 | d5641e1d6f67bd6eabed7f2dec105af4a3bf2080336ddb54f1dedb8c02095a71 |
Hashes for pymongoarrow-1.0.0-cp38-cp38-macosx_10_14_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 419b7125c02a8773853e99abeb7d3d3c7ab744af5472c62690fb4b883bdc65fe |
|
MD5 | ab5f12c65699b25d7c37b5f6c18fab90 |
|
BLAKE2b-256 | 9f0098567b765b0292d550a6934725b94e966a22d66563bab2270d03a8d81f8a |