$npx skillfedfor your agent

pymongo_inmemory

A mongo mocking library with an ephemeral MongoDB running in memory.

With conditionsPyPI UtilitiesReleased Mar 2025117.4K downloads / moMITPure Python

Decision gist · record as of 2026-08-14

pure-Python wheel — pymongo_inmemory-0.5.0-py3-none-any.whl
v0.5.0 · released 2025-03-13 · Python <4.0,>=3.9 · 1 runtime deps: pymongo

Yes, if you test code that uses MongoDB and want to avoid external service dependencies. The low install friction, permissive license, and straightforward API make it a practical choice for unit and integration testing. The aging maintenance status (last release 519 days ago) is a minor concern but not a blocker—the repository is not archived and recent commits exist. No known security vulnerabilities.AI-flagged interpretation of the facts on this page — verify before relying

Before you install

  • Requires Python 3.9 or later.
  • The package downloads and runs a MongoDB binary, so adequate disk space and network access during first run are needed.
  • Low friction install with a single runtime dependency (pymongo).

License · maintenance · safety

MIT (permissive) — MIT license is permissive, allowing use in commercial and private projects with minimal restrictions—only requiring attribution and inclusion of the license text.

last release 2025-03-13 (519 days) · last repo commit 2025-03-13 · 53 stars

0 known vulnerabilities (OSV.dev, 2026-08-14) · 117,381 downloads/mo, #12,165 on PyPI

Verify before relying

pip install pymongo-inmemory

from pymongo_inmemory import MongoClient

with MongoClient() as client:
    db = client['testdb']
    collection = db['test-collection']
    # use collection as normal
  • Whether the package successfully handles all MongoDB versions listed in its URL bank or if some versions have known issues.
  • Performance characteristics and memory overhead of the in-memory MongoDB instance for large test datasets.
  • Compatibility with all pymongo features or limitations in what MongoClient operations are supported.
Same gist for agents: .md · .json

What it is and what it does

pymongo_inmemory is a testing library that spins up an ephemeral MongoDB instance in memory, allowing you to test code that uses MongoDB without needing a separate MongoDB server running. It wraps pymongo's MongoClient and automatically handles downloading, extracting, and configuring a MongoDB binary for your OS and Python version. The instance runs only for the duration of your test and leaves no persistent state.

You configure it via setup.cfg or environment variables (setting things like MongoDB version, port, and data folder), then import MongoClient from pymongo_inmemory instead of pymongo. The API is identical to the standard pymongo client, so existing test code requires minimal changes. It caches downloaded MongoDB binaries to avoid repeated downloads, and supports MongoDB versions from 3.0 through 8.0 across Linux, macOS, and Windows.

Use it for

  • Unit testing code that reads/writes to MongoDB without needing a test database server running locally or in CI.
  • Integration testing a multi-service application where MongoDB is one component, using an isolated in-memory instance per test.
  • Rapid development iteration on MongoDB queries and schema changes without managing a persistent test database.
  • CI/CD pipelines where spinning up a full MongoDB container is too heavy or slow; the in-memory instance starts faster.
  • Testing edge cases and error conditions by configuring specific MongoDB versions or configurations via environment variables.

Worth the install?

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

With conditions

Yes, if you test code that uses MongoDB and want to avoid external service dependencies.

The low install friction, permissive license, and straightforward API make it a practical choice for unit and integration testing. The aging maintenance status (last release 519 days ago) is a minor concern but not a blocker—the repository is not archived and recent commits exist. No known security vulnerabilities.

Install

pymongo-inmemory on PyPI

Before you install

Low friction install with a single runtime dependency (pymongo). Maintenance status is aging—last release was 519 days ago, though the repository remains active with recent commits and no archived status. Supports current Python versions (3.9 through 3.13).

Requires Python 3.9 or later. The package downloads and runs a MongoDB binary, so adequate disk space and network access during first run are needed.

License in practice

MIT license is permissive, allowing use in commercial and private projects with minimal restrictions—only requiring attribution and inclusion of the license text.

Quickstart

pip install pymongo-inmemory

from pymongo_inmemory import MongoClient

with MongoClient() as client:
    db = client['testdb']
    collection = db['test-collection']
    # use collection as normal

Verify before relying

  • Whether the package successfully handles all MongoDB versions listed in its URL bank or if some versions have known issues.
  • Performance characteristics and memory overhead of the in-memory MongoDB instance for large test datasets.
  • Compatibility with all pymongo features or limitations in what MongoClient operations are supported.

Package facts

LicenseMIT permissive
Python supportSupports the current Python release <4.0,>=3.9
Install frictionLow. Pure-Python wheel
Runtime dependencies
1 package
pymongo
MaintenanceAging 519 days since the last release
Last repo commit
First released
Downloads117,381 / month, #12,165 on PyPI 30-day window, as of 2026-08-14
Known vulnerabilitiesNone known OSV.dev, checked 2026-08-14
Classifiers
Development Status :: 3 - AlphaIntended Audience :: DevelopersLicense :: OSI Approved :: MIT LicenseOperating System :: MacOS :: MacOS XOperating System :: Microsoft :: WindowsOperating System :: POSIX :: LinuxProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.7Programming Language :: Python :: 3.9Topic :: Database :: Database Engines/ServersTopic :: Software Development :: TestingTopic :: Utilities

Evidence: pymongo_inmemory-0.5.0-py3-none-any.whl

Tags

Capabilities
mongodb mocking for testsin-memory mongo databasepymongo testing libraryephemeral mongodb instancemongodb test fixturemongo mock servertesting without mongodb server
Topics
mongodb-testingtest-fixturesmocking
PyPI keywords
mongodbtestingpymongo

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 › “mongodb mocking for tests”

  • pymongo_inmemoryProvides an in-memory MongoDB instance for testing by wrapping…
  • pytest-mock-resourcesProvides pytest fixtures that spin up real database and service…
  • mongomockMongomock provides an in-memory mock of MongoDB collections for…

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

More Utilities packages

idna Worth it
PyPI · Python Modules · released Jun 2026

Converts domain names between Unicode and ASCII-compatible encoding (Punycode) according to IDNA 2008 and Unicode Technical Standard 46, with security validation and broader script coverage than the standard library.

Install it if you work with internationalized domain names, need to validate domains, or use HTTP clients that depend on it transitively.

BSD-3-Clausepure Python · 3.9+
1.8Bdownloads / mo
charset-normalizer Worth it
PyPI · Utilities · released Aug 2026

Detects and normalizes text encoding from unknown or ambiguous sources, supporting all IANA character sets that Python's core library provides codecs for, with the ability to register custom codecs.

permissive licensepure Python · 3.7+
1.7Bdownloads / mo
setuptools Worth it
PyPI · Python Modules · released Aug 2026

Setuptools is a Python build backend and package management tool that handles building, distributing, and installing Python packages, including support for C/C++ extension modules.

MITpure Python · 3.10+
1.6Bdownloads / mo
pluggy Worth it
PyPI · Libraries · released May 2025

Pluggy provides a plugin system that lets you define hook specifications and register implementations to be called in sequence, enabling extensible Python applications without tight coupling.

Install it if you're building an extensible application or framework.

MITpure Python · 3.9+aging
1.3Bdownloads / mo
Pygments Worth it
PyPI · Utilities · released Mar 2026

Pygments is a syntax highlighter that colorizes source code and text in over 500 languages and formats, outputting to HTML, LaTeX, RTF, SVG, images, or ANSI terminal sequences.

Install it if you need to display or transform source code.

BSD-2-Clausepure Python · 3.9+
1.3Bdownloads / mo
six With conditions
PyPI · Libraries · released Dec 2024

Six provides utility functions to write Python code that runs on both Python 2.7 and Python 3.3+, smoothing over language differences between the two versions.

MITpure Python
1.2Bdownloads / mo

See also pymongo · mongomock · Flask-PyMongo · pymongoarrow · pymongocrypt · pymongo-auth-aws · motor · pydantic-mongo · gdbmongo · pymongoexplain