Go to file
2024-09-18 12:25:03 -07:00
.evergreen MOTOR-1314 Test against 8.0 builds (#287) 2024-06-20 08:02:19 -05:00
.github MOTOR-526 Add evergreen link and version handling for SSDLC (#289) 2024-06-25 14:11:48 -05:00
doc MOTOR-1368 Cap PyMongo dependency to <4.9 (#309) 2024-09-18 12:25:03 -07:00
motor BUMP 3.5.2.dev0 2024-09-18 11:17:37 -07:00
requirements MOTOR-1327 Use Hatch as Build Backend (#286) 2024-06-07 08:23:48 -05:00
synchro MOTOR-1335 AsyncIOMotorClient is not suscriptable (#293) 2024-07-09 11:17:36 -05:00
test MOTOR-1368 Cap PyMongo dependency to <4.9 (#309) 2024-09-18 12:25:03 -07:00
.git-blame-ignore-revs MOTOR-896 Set up pre-commit (#145) 2022-02-16 14:25:52 -06:00
.gitignore MOTOR-866 Key Management API (#175) 2022-09-10 16:42:33 -07:00
.pre-commit-config.yaml MOTOR-1210 Update pre-commit to match PyMongo Checks (#232) 2023-11-08 10:13:38 -06:00
.readthedocs.yaml MOTOR-1327 Use Hatch as Build Backend (#286) 2024-06-07 08:23:48 -05:00
CONTRIBUTING.md MOTOR-1316 Drop Support for Python 3.7 (#279) 2024-05-15 17:16:06 -05:00
LICENSE MOTOR-896 Set up pre-commit (#145) 2022-02-16 14:25:52 -06:00
pyproject.toml MOTOR-526 SSDLC Conformance (#288) 2024-06-24 10:29:22 -05:00
README.md MOTOR-1316 Drop Support for Python 3.7 (#279) 2024-05-15 17:16:06 -05:00
RELEASE.md MOTOR-1224 Convert top level docs to Markdown (#244) 2023-12-12 14:12:51 -06:00
release.sh MOTOR-1139 Switch to Pytest (#222) 2023-08-23 15:52:07 -05:00
requirements.txt MOTOR-1368 Cap PyMongo dependency to <4.9 (#309) 2024-09-18 12:25:03 -07:00
sbom.json MOTOR-1299 Add components field to SBOM (#285) 2024-06-07 09:57:41 -05:00
tox.ini MOTOR-1335 AsyncIOMotorClient is not suscriptable (#293) 2024-07-09 11:17:36 -05:00

Motor

PyPI Version Python Versions Monthly Downloads Documentation Status

image

About

Motor is a full-featured, non-blocking MongoDB driver for Python asyncio and Tornado applications. Motor presents a coroutine-based API for non-blocking access to MongoDB.

"We use Motor in high throughput environments, processing tens of thousands of requests per second. It allows us to take full advantage of modern hardware, ensuring we utilise the entire capacity of our purchased CPUs. This helps us be more efficient with computing power, compute spend and minimises the environmental impact of our infrastructure as a result."

--David Mytton, Server Density

"We develop easy-to-use sensors and sensor systems with open source software to ensure every innovator, from school child to laboratory researcher, has the same opportunity to create. We integrate Motor into our software to guarantee massively scalable sensor systems for everyone."

--Ryan Smith, inXus Interactive

Support / Feedback

For issues with, questions about, or feedback for PyMongo, please look into our support channels. Please do not email any of the Motor developers directly with issues or questions - you're more likely to get an answer on the StackOverflow (using a "mongodb" tag).

Bugs / Feature Requests

Think you've found a bug? Want to see a new feature in Motor? Please open a case in our issue management tool, JIRA:

Bug reports in JIRA for all driver projects (i.e. MOTOR, CSHARP, JAVA) and the Core Server (i.e. SERVER) project are public.

How To Ask For Help

Please include all of the following information when opening an issue:

  • Detailed steps to reproduce the problem, including full traceback, if possible.

  • The exact python version used, with patch level:

python -c "import sys; print(sys.version)"
  • The exact version of Motor used, with patch level:
python -c "import motor; print(motor.version)"
  • The exact version of PyMongo used, with patch level:
python -c "import pymongo; print(pymongo.version); print(pymongo.has_c())"
  • The exact Tornado version, if you are using Tornado:
python -c "import tornado; print(tornado.version)"
  • The operating system and version (e.g. RedHat Enterprise Linux 6.4, OSX 10.9.5, ...)

Security Vulnerabilities

If you've identified a security vulnerability in a driver or any other MongoDB project, please report it according to the instructions here.

Installation

Motor can be installed with pip:

pip install motor

Dependencies

Motor works in all the environments officially supported by Tornado or by asyncio. It requires:

  • Unix (including macOS) or Windows.
  • PyMongo >=4.1,<5
  • Python 3.8+

Optional dependencies:

Motor supports same optional dependencies as PyMongo. Required dependencies can be installed along with Motor.

GSSAPI authentication requires gssapi extra dependency. The correct dependency can be installed automatically along with Motor:

pip install "motor[gssapi]"

similarly,

MONGODB-AWS authentication requires aws extra dependency:

pip install "motor[aws]"

Support for mongodb+srv:// URIs requires srv extra dependency:

pip install "motor[srv]"

OCSP requires ocsp extra dependency:

pip install "motor[ocsp]"

Wire protocol compression with snappy requires snappy extra dependency:

pip install "motor[snappy]"

Wire protocol compression with zstandard requires zstd extra dependency:

pip install "motor[zstd]"

Client-Side Field Level Encryption requires encryption extra dependency:

pip install "motor[encryption]"

You can install all dependencies automatically with the following command:

pip install "motor[gssapi,aws,ocsp,snappy,srv,zstd,encryption]"

See requirements for details about compatibility.

Examples

See the examples on ReadTheDocs.

Documentation

Motor's documentation is on ReadTheDocs.

Build the documentation with Python 3.8+. Install sphinx, Tornado, and aiohttp, and do cd doc; make html.

Learning Resources

Testing

Run python setup.py test. Tests are located in the test/ directory.