$npx skillfedfor your agent

pymongoexplain

Explainable CRUD API for PyMongo

With conditionsPyPI DatabaseReleased Jan 202280.6K downloads / moApache License, Version 2.0Pure Python

Decision gist · record as of 2026-08-14

pure-Python wheel — pymongoexplain-1.2.0-py3-none-any.whl
v1.2.0 · released 2022-01-07 · Python >=3.5 · 1 runtime deps: pymongo

Yes, if you need to inspect MongoDB query execution plans from PyMongo code. The package is stable with no known vulnerabilities and low install friction. However, verify PyMongo version compatibility first—the documented constraint is PyMongo>=3.10,<4, which may limit use in newer projects. Best suited for development and optimization workflows.AI-flagged interpretation of the facts on this page — verify before relying

Before you install

  • Requires PyMongo>=3.10,<4.
  • Fluent Cursor API (chained methods like .find().sort()) is not supported—pass all arguments directly to find().
  • Low friction: pure Python wheel with a single runtime dependency on pymongo.

License · maintenance · safety

Apache License, Version 2.0 (permissive) — Apache License, Version 2.0 (permissive): you can use, modify, and distribute this package freely in commercial and private projects with minimal restrictions.

last release 2022-01-07 (1680 days) · last repo commit 2026-08-03 · 4 stars

0 known vulnerabilities (OSV.dev, 2026-08-14) · 80,630 downloads/mo, #14,280 on PyPI

Verify before relying

pip install pymongoexplain

from pymongoexplain import ExplainableCollection

collection = client.db.products
explain = ExplainableCollection(collection)
result = explain.update_one({"quantity": 1057}, {"$set": {"reorder": True}})
print(result)  # Contains queryPlanner output, not actual update
  • Whether the package works with PyMongo 4.x versions despite the documented constraint
  • Performance overhead of wrapping Collection methods for large-scale explain operations
  • Current maintenance status given 1680 days since last release despite active repository
Same gist for agents: .md · .json

What it is and what it does

PyMongoExplain provides an ExplainableCollection wrapper that intercepts PyMongo CRUD operations and runs MongoDB's explain command on them instead of executing the actual operation. This lets you inspect query plans, index usage, and execution strategy without modifying your data. It supports all Collection methods (find, insert_one, update_one, delete_many, etc.) and accepts explain options like verbosity and comment.

The package simplifies what would otherwise require manually constructing MongoDB command objects. It also includes a CLI tool to run explain on all operations in an existing script. The wrapper is designed to drop into existing code by swapping Collection instances for ExplainableCollection instances, making it useful for performance analysis and query optimization workflows.

Use it for

  • Analyze query plans for slow update or delete operations without running them against production data
  • Debug index usage and rejection patterns before committing schema changes
  • Profile all database operations in a script to identify optimization opportunities
  • Compare execution plans across different query formulations to choose the most efficient one
  • Audit which indexes MongoDB would use for a set of operations without side effects

Worth the install?

AI-flagged interpretation of the facts on this page. Verify before relying on it.

With conditions

Yes, if you need to inspect MongoDB query execution plans from PyMongo code.

The package is stable with no known vulnerabilities and low install friction. However, verify PyMongo version compatibility first—the documented constraint is PyMongo>=3.10,<4, which may limit use in newer projects. Best suited for development and optimization workflows.

Install

pymongoexplain on PyPI

Before you install

Low friction: pure Python wheel with a single runtime dependency on pymongo. Maintenance is active but infrequent—last release was over 1680 days ago, though the repository remains current as of August 2026.

Requires PyMongo>=3.10,<4. Fluent Cursor API (chained methods like .find().sort()) is not supported—pass all arguments directly to find().

License in practice

Apache License, Version 2.0 (permissive): you can use, modify, and distribute this package freely in commercial and private projects with minimal restrictions.

Quickstart

pip install pymongoexplain

from pymongoexplain import ExplainableCollection

collection = client.db.products
explain = ExplainableCollection(collection)
result = explain.update_one({"quantity": 1057}, {"$set": {"reorder": True}})
print(result)  # Contains queryPlanner output, not actual update

Verify before relying

  • Whether the package works with PyMongo 4.x versions despite the documented constraint
  • Performance overhead of wrapping Collection methods for large-scale explain operations
  • Current maintenance status given 1680 days since last release despite active repository

Package facts

LicenseApache License, Version 2.0 permissive
Python supportSupports the current Python release >=3.5
Install frictionLow. Pure-Python wheel
Runtime dependencies
1 package
pymongo
MaintenanceActively maintained 1,680 days since the last release
Last repo commit
First released
Downloads80,630 / month, #14,280 on PyPI 30-day window, as of 2026-08-14
Known vulnerabilitiesNone known OSV.dev, checked 2026-08-14
Classifiers
Development Status :: 4 - BetaIntended Audience :: DevelopersLicense :: OSI Approved :: Apache Software LicenseOperating System :: MacOS :: MacOS XOperating System :: Microsoft :: WindowsOperating System :: POSIXProgramming Language :: Python :: 3Programming Language :: Python :: 3.5Programming Language :: Python :: 3.6Programming Language :: Python :: 3.7Programming Language :: Python :: 3.8Programming Language :: Python :: Implementation :: CPythonProgramming Language :: Python :: Implementation :: PyPyTopic :: Database

Evidence: pymongoexplain-1.2.0-py3-none-any.whl

Tags

Capabilities
pymongo query explainmongodb query plan analysispymongo operation profilingmongodb explain command wrapperdatabase query optimization toolpymongo crud explainmongodb execution plan viewer
Topics
mongodb-toolsquery-optimizationperformance-analysis
PyPI keywords
mongomongodbpymongo

Let your AI agent find packages like this

Example. Real query, live index.

You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.

wish › “pymongo query explain”

Give your agent the search over MCP, or paste the wish link into any chat.

More Database packages

psycopg2-binary Worth it
PyPI · Software Development · released Apr 2026

psycopg2-binary is a PostgreSQL database adapter for Python that implements the DB API 2.0 specification, enabling Python applications to connect to and query PostgreSQL databases with thread-safe concurrent operations.

copyleftcompiled wheel · 3.9+
271.6Mdownloads / mo
redis Worth it
PyPI · Database · released Jul 2026

Python client library for connecting to and executing commands against Redis key-value stores, supporting both synchronous and asynchronous operations.

Install it if your application needs to interact with Redis; the only prerequisite is a running Redis server instance.

MITpure Python · 3.10+
268.3Mdownloads / mo
ydb Worth it
PyPI · Database · released Jul 2026

YDB Python SDK is the official client library for connecting to and querying YDB databases from Python applications.

Install it if you need to connect Python applications to YDB databases.

permissive licensepure Python · 3.10+
210.0Mdownloads / mo
snowflake-connector-python Worth it
PyPI · Software Development · released Aug 2026

Connects Python applications to Snowflake data warehouses using the DB API 2.0 specification, enabling SQL queries, data transfers, and warehouse operations.

Apache-2.0compiled wheel · 3.10+
193.6Mdownloads / mo
sqlparse Worth it
PyPI · Software Development · released Aug 2026

sqlparse tokenizes SQL text into a tree of statements, clauses, and expressions, and provides functions to split scripts, format queries, and inspect parsed tokens without validating dialect or syntax.

Install it if you need to manipulate, format, or analyze SQL text programmatically.

BSD-3-Clausepure Python · 3.10+
148.9Mdownloads / mo
dbt-adapters With conditions
PyPI · Database · released Jul 2026

Provides base adapter protocols and shared functionality that database adapters use to integrate with dbt-core, handling connections, dialect translation, relation caching, and core interface management.

Apache-2.0pure Python · 3.10.0+
121.3Mdownloads / mo

See also Flask-PyMongo · pymongo · pymongo-search-utils · pymongoarrow · pydantic-mongo · mongomock · mongoengine · pymongo-auth-aws · pymongo_inmemory · curatorbin