skillfed

pymongoarrow

Tools for using NumPy, Pandas, Polars, and PyArrow with MongoDB

pymongoarrow v1.15.0 228.8K downloads/30d#9,146 on PyPI116
Permissive license Apache License, Version 2.0 Active released

What it is and what it does

PyMongoArrow is a companion library to PyMongo that bridges MongoDB query results into columnar in-memory formats. It extends PyMongo's collection API with methods like find_pandas_all(), find_arrow_all(), and find_numpy_all() to materialize query results directly as Arrow tables, Pandas DataFrames, or NumPy arrays without intermediate serialization steps.

The library is designed for analytical workloads where you need MongoDB data in typed, contiguous-in-memory arrays. It supports optional schema specification for type safety and can infer schemas automatically. Runtime dependencies include pyarrow, pymongo, numpy, and packaging; pandas is optional for DataFrame functionality.

Use it for:

  • Export MongoDB query results as Pandas DataFrames for data analysis and machine learning pipelines
  • Load MongoDB collections into Apache Arrow tables for efficient columnar processing
  • Convert MongoDB documents to NumPy arrays for numerical computing workflows
  • Materialize large MongoDB result sets with explicit schema validation for type safety

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

PyMongoArrow converts MongoDB query results into Apache Arrow tables, Pandas DataFrames, or NumPy arrays for analytical processing.

Yes. PyMongoArrow is actively maintained, has no known vulnerabilities, and solves a specific problem—efficient materialization of MongoDB data into analytical formats. The permissive Apache license and broad platform support (Python 3.10–3.14 on macOS, Linux, Windows) make it a low-risk addition. Install it if you regularly need to move MongoDB query results into Arrow, Pandas, or NumPy for analysis.

Install

pymongoarrow on PyPI

pip

pip install pymongoarrow

uv

uv add pymongoarrow

poetry

poetry add pymongoarrow

Installing pymongoarrow

Before you install

Medium install friction due to compiled wheels for multiple Python versions and platforms. Active maintenance with recent release (29 days ago) and ongoing repository activity.

License in practice

Apache License 2.0 (permissive) allows commercial and private use with minimal restrictions; you may use, modify, and distribute this package freely.

Quickstart

pip install pymongoarrow
from pymongoarrow.monkey import patch_all
from pymongo import MongoClient
patch_all()
client = MongoClient()
data_frame = client.db.collection.find_pandas_all({})

Requires MongoDB server connection; pandas optional but needed for DataFrame output; not supported on big-endian systems.

Verify before relying

  • Performance characteristics when materializing large result sets into memory
  • Schema inference behavior when schema parameter is omitted
  • Compatibility with MongoDB Atlas connection strings beyond the documented srv extra

Package facts

License Apache License, Version 2.0 (permissive)
Python support supports the current Python release (>=3.10)
Install friction medium — platform-specific wheel
Runtime dependencies 4 — pyarrow, pymongo, numpy, packaging
Maintenance actively maintained — 29 days since the last release
Last repo commit
First released
Downloads 228,756/month — #9,146 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: pymongoarrow-1.15.0-cp310-cp310-macosx_10_9_x86_64.whl; pymongoarrow-1.15.0-cp310-cp310-macosx_11_0_arm64.whl; pymongoarrow-1.15.0-cp310-cp310-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl; pymongoarrow-1.15.0-cp310-cp310-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl; pymongoarrow-1.15.0-cp310-cp310-win_amd64.whl; pymongoarrow-1.15.0-cp311-cp311-macosx_10_9_x86_64.whl; pymongoarrow-1.15.0-cp311-cp311-macosx_11_0_arm64.whl; pymongoarrow-1.15.0-cp311-cp311-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl; pymongoarrow-1.15.0-cp311-cp311-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl; pymongoarrow-1.15.0-cp311-cp311-win_amd64.whl; pymongoarrow-1.15.0-cp312-cp312-macosx_10_9_x86_64.whl; pymongoarrow-1.15.0-cp312-cp312-macosx_11_0_arm64.whl; pymongoarrow-1.15.0-cp312-cp312-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl; pymongoarrow-1.15.0-cp312-cp312-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl; pymongoarrow-1.15.0-cp312-cp312-win_amd64.whl; pymongoarrow-1.15.0-cp313-cp313-macosx_10_9_x86_64.whl; pymongoarrow-1.15.0-cp313-cp313-macosx_11_0_arm64.whl; pymongoarrow-1.15.0-cp313-cp313-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl; pymongoarrow-1.15.0-cp313-cp313-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl; pymongoarrow-1.15.0-cp313-cp313-win_amd64.whl

Keywords: mongo, mongodb, pymongo, arrow, bson, numpy, pandas, polars

Development Status :: 3 - AlphaIntended Audience :: DevelopersIntended Audience :: Science/ResearchLicense :: OSI Approved :: Apache Software LicenseOperating System :: MacOS :: MacOS XOperating System :: POSIXProgramming Language :: Python :: 3Programming Language :: Python :: 3 :: OnlyProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Programming Language :: Python :: Implementation :: CPythonTopic :: Database

Tags

mongodb to arrow conversionmongo query results as dataframemongodb numpy pandas exportarrow table from mongodbmongodb analytical data loading
mongodb-integrationdata-analyticscolumnar-formats

More Database packages