{"id":5540,"library":"types-seaborn","title":"Typing Stubs for Seaborn","description":"types-seaborn is a type stub package providing static type annotations for the popular Seaborn statistical data visualization library. It allows type checkers (like MyPy or Pyright) to verify code that uses Seaborn, improving code quality and catching potential errors during development. This package is part of the broader typeshed project, and its current version, 0.13.2.20260408, aims to provide accurate annotations for seaborn==0.13.2.","status":"active","version":"0.13.2.20260408","language":"en","source_language":"en","source_url":"https://github.com/python/typeshed","tags":["typing","stubs","seaborn","data-visualization","type-checking"],"install":[{"cmd":"pip install types-seaborn","lang":"bash","label":"Install types-seaborn"},{"cmd":"pip install seaborn matplotlib pandas numpy","lang":"bash","label":"Install Seaborn and its core dependencies"}],"dependencies":[{"reason":"Provides the actual runtime functionality; types-seaborn only provides type hints for this library.","package":"seaborn","optional":false},{"reason":"Seaborn is built on Matplotlib and is a core dependency.","package":"matplotlib","optional":false},{"reason":"Seaborn is designed to work closely with Pandas DataFrames for data input.","package":"pandas","optional":false},{"reason":"A core dependency for numerical operations in both Pandas and Matplotlib.","package":"numpy","optional":false}],"imports":[{"symbol":"seaborn","correct":"import seaborn as sns"},{"symbol":"matplotlib.pyplot","correct":"import matplotlib.pyplot as plt"},{"symbol":"pandas","correct":"import pandas as pd"}],"quickstart":{"code":"import seaborn as sns\nimport matplotlib.pyplot as plt\nimport pandas as pd # Often used with seaborn\n\n# Apply the default seaborn theme for aesthetics\nsns.set_theme()\n\n# Load an example dataset provided by seaborn\ntips = sns.load_dataset(\"tips\")\n\n# Create a relational plot\nsns.relplot(\n    data=tips, \n    x=\"total_bill\", \n    y=\"tip\", \n    col=\"time\", \n    hue=\"smoker\", \n    style=\"smoker\", \n    size=\"size\"\n)\n\nplt.title(\"Tips by Total Bill, Time, and Smoker Status\")\nplt.show()","lang":"python","description":"This quickstart demonstrates a typical use of Seaborn to create a statistical visualization. It imports Seaborn (aliased as `sns`), Matplotlib for displaying the plot, and Pandas for data handling. It then loads a sample dataset, applies a default Seaborn theme, creates a complex relational plot, and finally displays it."},"warnings":[{"fix":"Ensure 'pip install seaborn' is run alongside 'pip install types-seaborn'.","message":"types-seaborn is solely a type stub package. Installing it does not provide the Seaborn library's functionality. You must install the actual 'seaborn' package separately to use the library at runtime.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Always check the 'types-seaborn' PyPI description for the targeted 'seaborn' version (e.g., 'types-seaborn==0.13.2.20260408' targets 'seaborn==0.13.2'). Try to keep the versions aligned.","message":"Type annotations provided by 'types-seaborn' are specific to a particular version of the 'seaborn' library. Mismatches between the installed 'types-seaborn' version and the 'seaborn' library version can lead to incorrect or missing type hints, causing type checkers to report errors or fail to detect issues.","severity":"breaking","affected_versions":"All versions"},{"fix":"Refer to the typeshed GitHub repository (github.com/python/typeshed) for reporting issues or contributing changes to the type stubs.","message":"Contributions and bug fixes for 'types-seaborn' should not be directed to a dedicated 'types-seaborn' repository. As part of the typeshed project, all improvements to these stubs must be contributed to the main typeshed GitHub repository.","severity":"gotcha","affected_versions":"All versions"}],"env_vars":null,"last_verified":"2026-04-13T00:00:00.000Z","next_check":"2026-07-12T00:00:00.000Z"}