{"id":24067,"library":"motor-types","title":"Motor-Types (stubs only)","description":"Third-party PEP 561 type stubs for Motor, the async MongoDB driver for Tornado and AsyncIO. Current version 1.0.0b4 (pre-release). Alpha-level coverage; many symbols still untyped. Cadence: infrequent.","status":"active","version":"1.0.0b4","language":"python","source_language":"en","source_url":"https://github.com/L0RD-ZER0/Motor-Types","tags":["motor","mongodb","type-stubs","typing","async"],"install":[{"cmd":"pip install motor-types","lang":"bash","label":"Install via pip"}],"dependencies":[],"imports":[{"note":"motor-types is a stub package; motor provides the actual classes.","wrong":"never import from motor-types directly","symbol":"AsyncIOMotorClient","correct":"from motor.motor_asyncio import AsyncIOMotorClient"}],"quickstart":{"code":"import asyncio\nfrom motor.motor_asyncio import AsyncIOMotorClient\n\nasync def main():\n    client = AsyncIOMotorClient('mongodb://localhost:27017')\n    db = client.test_database\n    collection = db.test_collection\n    await collection.insert_one({'x': 1})\n    doc = await collection.find_one({'x': 1})\n    print(doc)\n\nasyncio.run(main())","lang":"python","description":"Basic create, insert, query with Motor (quickstart for the driver, not stubs). motor-types provides the type hints."},"warnings":[{"fix":"Pin to 1.0.0b4 and test coverage before relying on stubs. Expect frequent breaking changes.","message":"motor-types is in pre-release (beta). Do not use in production for type-checking; many stubs are incomplete or missing.","severity":"deprecated","affected_versions":"<1.0.0"},{"fix":"Use `from motor.motor_asyncio import AsyncIOMotorClient` as usual.","message":"motor-types provides stubs only. Do not import anything from it; always import from `motor.motor_asyncio` or `motor.motor_tornado`.","severity":"gotcha","affected_versions":"all"},{"fix":"Install the latest version; if missing, report to GitHub or add your own stubs.","message":"Stubs may not cover all Motor classes and methods. You may see 'cannot find reference' errors in your IDE for some functions.","severity":"gotcha","affected_versions":"<=1.0.0b4"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Ensure motor-types is installed (pip install motor-types). If still failing, the stub might be missing; use # type: ignore or report.","cause":"motor-types stubs for some submodules may be incomplete or not installed correctly.","error":"Cannot find reference 'AsyncIOMotorClient' in '__init__.pyi'"},{"fix":"Install motor: pip install motor. motor-types only provides type hints.","cause":"Motor itself is not installed; stubs alone do not make the package importable.","error":"Import 'motor.motor_asyncio' could not be resolved"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}