"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.2-cp311-cp311-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 02580509feb4c93e0846bfe0dab069b9f92c565760fe709ac1a1763967ad2fb8 |
|
MD5 | e56d85b1b7e02f90204d8757676f5154 |
|
BLAKE2b-256 | 0dfc90a5088af845d0c0cea1e0279ba702028e5f78f35377a31db3dc6c105550 |
Hashes for pymongoarrow-1.0.2-cp311-cp311-manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4689d31c71d95bdfada33643f21b5a816c5e19b5e9fe871eb619056ff11d357f |
|
MD5 | 30013a36c5c81aed4129c3c77f38f958 |
|
BLAKE2b-256 | 72de425609ef6af6a894c1fbb9ef7147e49e6cbdf2c65862f6ef2aa0d60c0534 |
Hashes for pymongoarrow-1.0.2-cp311-cp311-manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f87dfa798b5d3f73a7678412f239461cb245af53c4e040206f34fd1b5558ac5c |
|
MD5 | 4d2fe279ce62b4b9525ce46daa5def59 |
|
BLAKE2b-256 | be7d8bdafb611c0d3d0d53085af85b56205870a21b970b3fe8e9daecbdbbe090 |
Hashes for pymongoarrow-1.0.2-cp311-cp311-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c87aa7ba272e11fa6fa136cf38b0629b4bc6e1899994b74c0906b493dc1a1654 |
|
MD5 | 7a4d844bc1227eba424e32f7a6d15014 |
|
BLAKE2b-256 | 0ba10c1a472cf7464aadee57961a659034a230cdd9480f0a984791d518e595f4 |
Hashes for pymongoarrow-1.0.2-cp311-cp311-macosx_10_14_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 15d8332d3780dc3895636f49538aca465aea809aea2fbb74209253d42f61f87b |
|
MD5 | 57919d48432e3e95d0c0e1626de167af |
|
BLAKE2b-256 | fa25dc26307bd90df525131bc042b6c01167b10e8b106203f31bb03631068fb9 |
Hashes for pymongoarrow-1.0.2-cp310-cp310-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9d52146de5fe68cac9a094d6af7bd8cf4b5f8c06878a5565f9bf9914df585c26 |
|
MD5 | 89583ec7bf6d99d0f9f63cdc29206983 |
|
BLAKE2b-256 | ef48121c37c52255b51ce31634b2786fcd59ccdc81969fb0a4eb7abcee4325bc |
Hashes for pymongoarrow-1.0.2-cp310-cp310-manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | cb437990eda7c721af068d7ba483ee82cd4f06d2b81bcdcb52d4849c1395d584 |
|
MD5 | a4b726407a314e3380fddabb1dd71ab4 |
|
BLAKE2b-256 | 82a81b29e128103f321b13f4ebe2be04143d2809f976b2c76af5053b6d4852e5 |
Hashes for pymongoarrow-1.0.2-cp310-cp310-manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 40a60dc9cae0e70a4f8212de81d87f150abb4da317149371a292a1d6524a8e0f |
|
MD5 | 216bbc27a0c230ff01d2fa11da37112c |
|
BLAKE2b-256 | eac264ebc598883902cb64505779c167baee7ac9fd1abcd7a57d274b19363f2a |
Hashes for pymongoarrow-1.0.2-cp310-cp310-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d8a2a695625a803bc0c14d02d3518b5550b256f90bb032181004ab71b405d5c2 |
|
MD5 | 12f79925835fcf01352d75d0188c3002 |
|
BLAKE2b-256 | fa4c9cc6e7def66e25d82b5e9d7be208168dd01e28298c4bd6426b9413d95bee |
Hashes for pymongoarrow-1.0.2-cp310-cp310-macosx_10_14_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b7c096f70714d66127daaad11a212ab056899fecc68e38e6ee0b83026a6bfdac |
|
MD5 | 7c5c31df1aac972a8015d4765c6da6dc |
|
BLAKE2b-256 | aaba189c7ba398639454481825f03e985535e04b4354548fa7c04892422c86e6 |
Hashes for pymongoarrow-1.0.2-cp39-cp39-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d1bbdc151b556302386d9d659bea023dba5f594a2f68ea96d100611890b99afc |
|
MD5 | 92c7a7c23061ae5807e9ddb232f688da |
|
BLAKE2b-256 | e07a485161cfbb80ed425ea81119a8b6ea42dfc2e4796bf22d1b1ca5062fb946 |
Hashes for pymongoarrow-1.0.2-cp39-cp39-manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 54ea3c4e4f39bd1b1c916c5c0afee6b5cbd8bb549d44c2fa333b9656d03910a0 |
|
MD5 | 43cae38cab5a6122f5e37df0b57e71ff |
|
BLAKE2b-256 | 4caf2977ce5663afaa44b259a90f2f91dfc4b574a1be1740ac251e5966adb2f5 |
Hashes for pymongoarrow-1.0.2-cp39-cp39-manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 57290932300ee0ccfa14a5e8c89b04d81abe96d421882314383eb5bd1acf0b7f |
|
MD5 | c27b862eafae4e6343a50bc4c290d190 |
|
BLAKE2b-256 | 11684a9b2e7c01c4eb59cbf60d5231bc209f6ce293e29d2d4c2ee6c3f02d29b2 |
Hashes for pymongoarrow-1.0.2-cp39-cp39-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c827802f67156a1a1cd43e6211da8d7de27a7e7f40ca0b2106016d6462004762 |
|
MD5 | 440e0feb6f10ea5d9d0371ef28f86e66 |
|
BLAKE2b-256 | 97938b826d1d8d6b7366da8a4e2174d453d35ffc57b4d3b433a3037466594a80 |
Hashes for pymongoarrow-1.0.2-cp39-cp39-macosx_10_14_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e5f0ac8e80f8683f2560539b25edc7beb1ff3f73218e5f819a17f5c3de531f8d |
|
MD5 | 7a959712209f1733b359377fe5644c7b |
|
BLAKE2b-256 | b482cc826e0785f3254f52649e3444fa8ee186a7d6b7e6a6c74b0dfa0e36c1af |
Hashes for pymongoarrow-1.0.2-cp38-cp38-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7047697deb1685f5b03bc03bc9d1dabdadc7e8a4e6f09053254d84d0bd36b819 |
|
MD5 | 6209350f07d9098121887007201032a0 |
|
BLAKE2b-256 | d7affc2f76c51109477872ed3bf4525bc8042562844da0c5b267a3b86a57b335 |
Hashes for pymongoarrow-1.0.2-cp38-cp38-manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 052bdf49e06f0091ab490424ac6b9381d62d743b5b7fb39444770c80a3d21516 |
|
MD5 | dc2e2e024943d3ba4f2afff16a431a77 |
|
BLAKE2b-256 | 6b95934d234f47ec93f5f82a83d0e18c662e2c25d34f5e87b8f206f6c8c9126a |
Hashes for pymongoarrow-1.0.2-cp38-cp38-manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | fac2ce39eea8f076994ee10ce0ce0c422d1c14a1a45aa3150fc54456ac4465ef |
|
MD5 | ef2e70a2eac88f974133e1621acf6a8e |
|
BLAKE2b-256 | 418a78e1a6feeea3a69d15c5bf95bce50df8a4db4a776f1ad9f0160cc94442a5 |
Hashes for pymongoarrow-1.0.2-cp38-cp38-macosx_10_14_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | bc6a98dd3d28a07789d194d23b728455f578ba71476f8ea8e47f9d30d5fbea62 |
|
MD5 | 59d85458610265d872f19a306e8f56a6 |
|
BLAKE2b-256 | c2dd37f03fda18fe282e3b1dcb47271e1cbdd2218129d4f655519ad29dda2b09 |