Project: sqlalchemy-stubs

SQLAlchemy stubs and mypy plugin

Project Details

Latest version
0.4
Home Page
https://github.com/dropbox/sqlalchemy-stubs
PyPI Page
https://pypi.org/project/sqlalchemy-stubs/

Project Popularity

PageRank
0.0027805179450815748
Number of downloads
281432

Experimental SQLAlchemy type stubs and mypy plugin

This package contains type stubs and mypy plugin to provide more precise static types and type inference for SQLAlchemy framework. SQLAlchemy uses dynamic Python features that are hard to understand by static type checkers, this is why the plugin is needed in addition to type stubs.

Currently, some basic use cases like inferring model field types are supported. The final goal is to be able to get precise types for most common patterns.

Installation

pip install sqlalchemy-stubs

Important: you need to enable the plugin in your mypy config file:

[mypy]
plugins = sqlmypy