--- id: types-networkx version: "3.6.1.20260728" license: Apache-2.0 license_treatment: permissive maintenance: active --- # types-networkx — Typing stubs for networkx License: permissive · Maintenance: active · Downloads: 1.7M/mo ## What it is and what it does types-networkx is a type stub package that provides type annotations for the networkx graph library. It allows static type checkers like mypy, pyright, and ty to understand and validate code that uses networkx, catching type errors before runtime. The stubs are maintained as part of the typeshed project and track networkx version 3.6.1. This package has no runtime behavior—it exists purely to inform type checkers about networkx's API. It depends only on numpy and installs as a single wheel with low friction. The stubs have been tested against mypy 2.3.0, pyright 1.1.411, and ty 0.0.59, and the package is actively maintained with recent updates. Use it for: - Enable mypy or pyright type checking in projects that use networkx for graph algorithms and analysis. - Catch type errors in networkx code during development before they reach production. - Provide IDE autocomplete and type hints for networkx functions and classes. - Validate that graph construction and manipulation code conforms to expected types. - Support continuous integration pipelines that enforce strict type checking on networkx-based code. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Provides type stubs for networkx to enable static type checking of networkx code with mypy, pyright, and other type checkers. Yes, if you use networkx and want static type checking. Install it alongside networkx to enable type checkers to validate your graph code. No downside if you don't use type checking—it has no runtime cost and no dependencies beyond numpy. Actively maintained, permissive license, and no known vulnerabilities. ## Install pip install types-networkx uv add types-networkx poetry add types-networkx ## Installing types-networkx Before you install: Low friction installation with a single wheel distribution. Actively maintained as part of typeshed, with recent releases and no known vulnerabilities. License in practice: Apache-2.0 permissive license allows use in most projects without significant restrictions. Quickstart: pip install types-networkx import networkx as nx from typing import TYPE_CHECKING if TYPE_CHECKING: import types_networkx G: nx.Graph = nx.Graph() G.add_edge(1, 2) Requires Python 3.10 or later; networkx itself must be installed separately for runtime use. Verify before relying: - Whether installing this package automatically enables type checking without additional mypy/pyright configuration. - How frequently the stubs are updated relative to networkx releases. ## Package facts - License: Apache-2.0 (permissive) - Python support: supports_current - Install friction: low - Maintenance: active - Downloads: 1.7M/month (top 5,000 on PyPI) - Known vulnerabilities: none known ## Tags networkx type stubs, type checking networkx, networkx typing annotations, mypy networkx support, static type checking graphs, networkx type hints, pyright networkx, type-stubs, static-analysis [View on SkillFed](https://skillfed.io/packages/types-networkx) · [View on PyPI](https://pypi.org/project/types-networkx/)