{"id":22497,"library":"types-peewee","title":"types-peewee","description":"Typing stubs for peewee, provided by typeshed. Version 4.0.1.20260426 corresponds to peewee 4.0.1. These stubs enable static type checking for peewee projects, but they cover a subset of the runtime API and may be incomplete or incorrect for less common features. Release cadence is tied to typeshed releases.","status":"active","version":"4.0.1.20260426","language":"python","source_language":"en","source_url":"https://github.com/python/typeshed","tags":["type-stubs","peewee","typeshed","mypy"],"install":[{"cmd":"pip install types-peewee","lang":"bash","label":"Install stubs"}],"dependencies":[{"reason":"types-peewee provides type hints for peewee; peewee must be installed at runtime.","package":"peewee","optional":false},{"reason":"mypy is the primary type checker that consumes typeshed stubs; other checkers may also work.","package":"mypy","optional":true}],"imports":[{"wrong":"from peewee-stubs import SqliteDatabase","symbol":"SqliteDatabase","correct":"from peewee import SqliteDatabase"}],"quickstart":{"code":"import os\nfrom peewee import SqliteDatabase, Model, CharField, IntegerField\n\n# Use OS env for auth-like pattern (not needed for SQLite, just for consistency)\ndb_path = os.environ.get('DB_PATH', ':memory:')\ndb = SqliteDatabase(db_path)\n\nclass User(Model):\n    name = CharField()\n    age = IntegerField()\n\n    class Meta:\n        database = db\n\n# This will pass type checks with stubs installed\ndef get_user(name: str) -> User:\n    return User.get(User.name == name)\n","lang":"python","description":"Minimal peewee usage that checks types correctly with types-peewee stubs."},"warnings":[{"fix":"If you encounter missing stubs, consider adding local stub files or using # type: ignore for the affected lines.","message":"The stubs may be incomplete: many peewee methods (especially from playhouse extensions) are not typed. You may see 'Any' or errors when using advanced features like SQLite aggregate functions, FTS, or custom fields.","severity":"gotcha","affected_versions":"all"},{"fix":"Ensure your peewee version matches the stubs version. The stubs are released frequently via typeshed, so upgrade regularly.","message":"The stubs version is pinned to a specific peewee release (currently 4.0.1). If you use a newer peewee version, some stubs may be out of date and cause false positives or missing type hints.","severity":"gotcha","affected_versions":"4.0.1.20260426"},{"fix":"No action needed now, but be prepared to switch to a first-party stubs package if peewee adds it.","message":"The types-peewee package is part of the typeshed project, which may eventually be bundled into peewee itself or other distribution mechanisms. Keep an eye on peewee's own type stub support.","severity":"deprecated","affected_versions":"all"}],"env_vars":null,"search_vec":"'4.0.1':16 '4.0.1.20260426':12 'api':34 'cadenc':46 'check':22 'common':43 'correspond':13 'cover':28 'enabl':19 'featur':44 'incomplet':38 'incorrect':40 'less':42 'may':36 'mypi':57 'peewe':3,7,15,24,55 'project':25 'provid':8 'releas':45,51 'runtim':33 'static':20 'stub':5,18,54 'subset':30 'tie':48 'type':2,4,21,53 'type-stub':52 'types-peewe':1 'typesh':10,50,56 'version':11","created_at":"2026-04-27T17:05:28.925787+00:00","updated_at":"2026-04-27T17:05:28.925787+00:00","problems":{"verify_error":"Traceback (most recent call last):\n  File \"<string>\", line 1, in <module>\nModuleNotFoundError: No module named 'peewee'"},"ecosystem":"pypi","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":"4.0.5.20260518","cli_name":"","cli_version":null,"type":"library","homepage":null,"github":"https://github.com/typeshed-internal/stub_uploader","docs":null,"changelog":"https://github.com/typeshed-internal/stub_uploader/blob/main/data/changelogs/peewee.md","pypi":"https://pypi.org/project/types-peewee/","npm":null,"openapi_spec":null,"status_page":null,"smithery":null,"categories":["type-stubs","database"],"base_url":null,"auth_type":null,"provenance":{"verified_status":"import_fail","verified_at":"2026-07-03","last_verified":"2026-07-03","next_check":"2026-07-10","install_tag":null}}