motor
Non-blocking MongoDB driver for Tornado or asyncio
What it is and what it does
Motor is a non-blocking MongoDB driver designed for Python asyncio and Tornado applications. It wraps pymongo (>=4.9,<5) to provide a coroutine-based API that allows your application to query MongoDB without blocking the event loop, enabling efficient handling of concurrent requests. Motor is used in high-throughput environments where blocking I/O would degrade performance; it lets you scale horizontally by fully utilizing available CPU cores.
The package requires Python 3.9+ and works on Unix (including macOS) and Windows. It has a single runtime dependency on pymongo and offers optional extras for features like GSSAPI authentication, AWS authentication, mongodb+srv:// URIs, OCSP, and wire protocol compression. However, Motor is entering end-of-life: it will be deprecated on May 14th, 2026, with critical bug fixes only until May 14th, 2027. MongoDB recommends migrating to the PyMongo Async driver for new projects.
Use it for:
- Building high-throughput web services with asyncio or Tornado that need concurrent MongoDB access without blocking.
- Sensor systems and IoT applications requiring massively scalable database operations across many concurrent connections.
- Real-time data processing pipelines that must handle thousands of requests per second while maintaining responsive event loops.
- Microservices using async frameworks that need non-blocking database queries.
- Applications requiring GSSAPI or AWS authentication to MongoDB with async/await syntax.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Motor provides a non-blocking MongoDB driver for asyncio and Tornado applications, presenting a coroutine-based API for concurrent database access without blocking the event loop.
Yes, but with a critical caveat: Motor is actively maintained and production-stable, with low install friction and permissive licensing. However, it is scheduled for deprecation on May 14th, 2026, with MongoDB strongly recommending migration to the PyMongo Async driver. Install Motor only if you have an existing Motor codebase or a clear migration plan; for new projects, evaluate the PyMongo Async driver instead.
Install
motor on PyPI
pip
pip install motoruv
uv add motorpoetry
poetry add motorInstalling motor
Before you install
Low install friction with a single runtime dependency (pymongo). Active maintenance as of August 2026, though Motor is scheduled for deprecation on May 14th, 2026, with critical bug fixes until May 14th, 2027—users should plan migration to the PyMongo Async driver.
License in practice
Apache License 2.0 is permissive; you may use, modify, and distribute Motor freely in commercial and open-source projects, provided you include license and copyright notices.
Quickstart
pip install motor
import motor.motor_asyncio
client = motor.motor_asyncio.AsyncIOMotorClient()
db = client.test_database
collection = db.test_collection
# Use in an async context
await collection.insert_one({'name': 'example'})
Requires Python 3.9+; must be used within an asyncio event loop or Tornado application context.
Verify before relying
- Performance characteristics and throughput limits in production environments beyond the quoted use cases.
- Compatibility matrix details with specific asyncio and Tornado versions.
- Migration path complexity and effort for existing Motor applications moving to PyMongo Async driver.
Package facts
| License | Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 1. Definitions. "License" shall mean the terms and conditions for… (full text in the JSON record) (permissive) |
| Python support | supports the current Python release (>=3.9) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 1 — pymongo |
| Maintenance | actively maintained — 457 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 11,494,607/month — #1,389 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: motor-3.7.1-py3-none-any.whl
Keywords: asyncio, bson, gridfs, mongo, mongodb, motor, pymongo, tornado
Tags
More Database packages
psycopg2-binary is a PostgreSQL database…
copyleft · top 1,000 on PyPI
redisPython client library for connecting to and…
permissive · top 1,000 on PyPI
ydbYDB Python SDK is the official client library…
permissive · top 1,000 on PyPI
snowflake-connector-pythonConnects Python applications to Snowflake data…
permissive · top 1,000 on PyPI
sqlparsesqlparse tokenizes SQL text into a tree of…
permissive · top 1,000 on PyPI
dbt-adaptersProvides base adapter protocols and shared…
permissive · top 1,000 on PyPI
mongomock-motorProvides an async mock client for MongoDB that…
permissive · top 5,000 on PyPI
motor-typesProvides Python type stubs for Motor, enabling…
permissive · top 15,000 on PyPI
pymongoPyMongo is the official MongoDB Python driver,…
permissive · top 1,000 on PyPI
Flask-PyMongoFlask-PyMongo integrates MongoDB database…
permissive · top 15,000 on PyPI
tornadoTornado is a Python web framework and…
permissive · top 1,000 on PyPI
dynamixel-sdkProvides Python bindings for ROBOTIS Dynamixel…
permissive · top 15,000 on PyPI
beanieBeanie is an asynchronous Python…
permissive · top 5,000 on PyPI
pymongo_inmemoryProvides an in-memory MongoDB instance for…
permissive · top 15,000 on PyPI
pymongo-auth-awsEnables PyMongo to authenticate to MongoDB…
permissive · top 5,000 on PyPI
pydantic-mongoProvides a Repository pattern for MongoDB with…
permissive · top 15,000 on PyPI