Python stubs for Motor, a Non-Blocking MongoDB driver for Python's Tornado and AsyncIO based applications.
Stubs for Motor (version 3.0.0+) for substituting the missing type-hints. These stubs are meant to be used along with
pycharm and mypy to facilitate static type-checking. Installing this package adds these .pyi
files to
libs/site-packages/motor
. Currently, only the stubs for AsyncIO are supported. You can contribute to stubs for
Tornado by opening a pull request for the same.
Note: This project is currently under development and is in no way affiliated with MongoDB. This is an unofficial stub package.
You can either install from PyPI using pip or add files to your project directories manually.
Installing Using pip:
pip install motor-types
pip install motor-types[motor]
Use this command to clone the repository:
git clone "https://github.com/L0RD-ZER0/Motor-Types"
Afterwards, you can do either of the following to use stubs:
- Copy the stubs manually to either
libs/site-packages/motor
orlibs/site-packages/motor-stubs
, ideally the latter. - Add these stubs manually to project directories.
- For MyPy.
- For PyCharm.
- For other static type-checking tools, consider referring to their corresponding documentation regarding stubs.
Without Stubs:
With Stubs:
Without Stubs:
With Stubs:
This package uses following dependencies:
- Poetry (For Packaging and Publishing)
- PyMongo (For PyMongo related types)
- Motor (For Referencing and for motor installation extra)
- Dnspython (For motor installation extra)
- Pre-Commit (For maintaining code quality)
- Typing-Extensions (For using the latest typing features)
The simplest contribution you can make is by opening a GitHub Issue or by forking the repository and making a pull request on the GitHub Repository for the same. The changes can be as simple as improving the documentation or as big as completing any incomplete section of the typings.
Note: All issues and pull-requests are subjected to a preliminary inspection.
This repository is licensed under MIT License. The license can be found within the repository.