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
PyMongoArrow wheels are available for macOS and Linux on x86_64 architectures.
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.1.1-cp39-cp39-manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1434c93a5af68d16f78a41d28a97c84d6071f978279dbc4f63622e816c12494a |
|
MD5 | 95efbdafa2619263611e8a4c3805ecd6 |
|
BLAKE2b-256 | 1eaab2600236fb8508658bb787565aebcba8a9a45a0b7cf5f9f129a532c7ce75 |
Hashes for pymongoarrow-0.1.1-cp39-cp39-manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4b251de97f66c005803fd4c3a042e0e9dc114ddc5ca72f380c50fec5f3180de1 |
|
MD5 | a809dd8a485ec907f89390b3f0c5f994 |
|
BLAKE2b-256 | f213cd786f367bef94625cb94b06436a5ef7334c941977cb343b39a1f8b23e3e |
Hashes for pymongoarrow-0.1.1-cp39-cp39-macosx_10_14_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9fb9cf2f9ac03961c874a02c55b7b2d40b4976056c70722ff2036299baf0535d |
|
MD5 | 921e4aa491c7bbc7ad8611df6bdd4b54 |
|
BLAKE2b-256 | bbae7abf8d38bfbe4bdf06cb2a7c2da3a3e9022558ca9ece1c8bf039ea1e17a2 |
Hashes for pymongoarrow-0.1.1-cp38-cp38-manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 07eacd70cd23d4ae94bc98deb2ff5432908c2c6d6515f64621a2fcfbc1d1e84c |
|
MD5 | 5f48fa1eedfdc8153d95e56b31ee5743 |
|
BLAKE2b-256 | 688a89cc994dd6a09e9063e739dd486d91b86b49ad6a5019be39a38ea992bb80 |
Hashes for pymongoarrow-0.1.1-cp38-cp38-manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 346db1405651b243a3a0be445b7328ee5a53c6a29d6f92a091b131df3c2604a9 |
|
MD5 | 56e8e2e26489d8157b9a96a387684536 |
|
BLAKE2b-256 | f4bf77c4bd9fe5f22ac73cd20b5103185c9bee553944f1d10d6afb29cb577ac7 |
Hashes for pymongoarrow-0.1.1-cp38-cp38-macosx_10_14_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b78c4a839796baa143a9704be45203d2c9e9abe02e9ed5dd8b8bb243ff97ff83 |
|
MD5 | 5db544df98488770f5b360fd278686f3 |
|
BLAKE2b-256 | 76c22474a7e0c60ccb47161437e2da9cbfb66e4971830d38f51a12347b2732e6 |
Hashes for pymongoarrow-0.1.1-cp37-cp37m-manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 41378dcf5cb366705e14c33bb8c8ed745b5bd5de672670c9db2927dfe8123c61 |
|
MD5 | 5c7598781e382f712cbd169c808f9e00 |
|
BLAKE2b-256 | bd7ac755685e31284ac8d9b369835ce204356f7b210591eeb6f033b74f4cf9fb |
Hashes for pymongoarrow-0.1.1-cp37-cp37m-manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8d7c435e90ea1fe55f6296d5b5cd8e376f8da6f4e2306d9061e442f3069b7442 |
|
MD5 | ae5bed2506e1f9a0c794d2644f08b643 |
|
BLAKE2b-256 | f222c6cce8eafe23977c89ed7b2de1f9a8a98690fa8e41d1f333b299b164c218 |
Hashes for pymongoarrow-0.1.1-cp37-cp37m-macosx_10_14_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e5673595342e7e58f509203729c2f4da53857bba152cdada2888a93f3ec1e605 |
|
MD5 | d3e62c66ebc736f4bfa3ebfb2ee0b2f3 |
|
BLAKE2b-256 | 708418b41056c09d1b0431f1d87aba8c0eacddf22fc7cbf7745c5d6c53b210ef |
Hashes for pymongoarrow-0.1.1-cp36-cp36m-manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3571df29cdd50ab247a5645539b0470c55917ef5ba1aa88e8418aa8945bb0870 |
|
MD5 | dc162664dace0ceac972f087e91cadcf |
|
BLAKE2b-256 | 5664bd8185a13cbd663900dad3b2c1771e9589097842cc52b6e3fb02be48922d |
Hashes for pymongoarrow-0.1.1-cp36-cp36m-manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c0f6047b8ecf2cb309bb69aa37efb72cebacc2d1c5e173ee06f47c436c9c69d7 |
|
MD5 | 8c710ebf3071f2ba3f58c004fe28df3f |
|
BLAKE2b-256 | d71d2988a04df5d8ad8160ff665e3aa6ecc72c06b3bd6206c7b726af475f2050 |
Hashes for pymongoarrow-0.1.1-cp36-cp36m-macosx_10_14_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 11382b0a91d49955442aedb9bb1fc294ed4be109cfeba7eacfcdb2374d8099ab |
|
MD5 | e80a2ec39508badbd44b5ed215bb5499 |
|
BLAKE2b-256 | 2c82e45c9782f70cb4fcc8959f1c32208892d2c2ac61b40714a90ff8be8b21a8 |