Code Monkey home page Code Monkey logo

motor-types's Introduction

Motor-Types

Python stubs for Motor, a Non-Blocking MongoDB driver for Python's Tornado and AsyncIO based applications.

About

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.

How to use?

You can either install from PyPI using pip or add files to your project directories manually.

Installing Using pip:

pip install motor-types

To install Motor (and Dnspython) alongside the package:

pip install motor-types[motor]

To add files to the project manually:

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 or libs/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.

Examples:

Auto-Complete Example

Without Stubs:

ACNS

With Stubs:

ACWS

Type-Checking Example

Without Stubs:

TCNS

With Stubs:

TCWS

Dependencies

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)

How to Contribute?

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.

License

This repository is licensed under MIT License. The license can be found within the repository.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.