Experimental stubs for motor.
motor-stubs is NOT an officially supported MongoDB product.
motor-stubs
can be installed with pip
pip install motor-stubs
- Python >= 3.9
- Motor >= 3.0.0, < 4.0
- You should not use this stubs package after the official
motor
package supports inline type annotations. - File generator.py can help to parse class
AgnosticCollection
andAgnosticDatabase
, other class might not work
# at the project root, and get into python shell
from motor.core import AgnosticCollection
from generator import gen
gen(AgnosticCollection)
It will output a file in folder pyi_tmp/
.
motor-stubs is experimental and is not an officially supported MongoDB product. For questions, discussions, or general technical support, visit the MongoDB Community Forums.
use poetry
as package manager, you can follow the official installation guide here
use Python package pre-commit
for style check
# after install poetry
# install project dependencies
poetry install
# then
pre-commit install
use Python package commitizen
for commit-msg lint and version bump tool
cz c
# follow the description
cz bump