networkx
Skill by sickn33
NetworkX is a Python package for creating, manipulating, and analyzing complex networks and graphs. This skill guides an AI assistant through graph building, algorithms, generators, file I/O, and visualization.
Install networkx
Built from the published package, never by AI.
git clone --depth 1 https://github.com/sickn33/agentic-awesome-skills /tmp/agentic-awesome-skills && mkdir -p ~/.claude/skills && cp -r /tmp/agentic-awesome-skills/skills/networkx ~/.claude/skills/networkxRun in your terminal. Claude Code loads skills from ~/.claude/skills automatically.
git clone --depth 1 https://github.com/sickn33/agentic-awesome-skills /tmp/agentic-awesome-skills && mkdir -p ~/.gemini/antigravity-cli/skills && cp -r /tmp/agentic-awesome-skills/skills/networkx ~/.gemini/antigravity-cli/skills/networkxAntigravity CLI loads skills from ~/.gemini/antigravity-cli/skills, or .agents/skills for one project.
Skills can run scripts on your machine. Some need an API key: check the README.
About
NetworkX is a Python package for creating, manipulating, and analyzing complex networks and graphs. The skill gives an AI assistant guidance for four graph types: Graph, DiGraph, MultiGraph and MultiDiGraph. It covers adding nodes and edges with attributes, running algorithms such as shortest paths, PageRank, centrality, connectivity checks and community detection, and generating classic and random networks. It also covers reading and writing edge lists, GraphML, GML, JSON, pandas DataFrames and matrix formats, and drawing networks with matplotlib.
The skill points to reference files for graph basics, algorithms, generators, I/O and visualization. It advises setting random seeds for reproducibility and warns against unpickling untrusted files. It is meant for people working with network data such as social, biological, transportation, citation or knowledge graphs.
Written from the project's SKILL.md and checked against it.
What it can do
- Graph creationBuild graphs with nodes, edges and attributes from data.
- Graph algorithmsRun shortest paths, centrality, PageRank, community detection and connectivity checks.
- Graph generatorsCreate classic, random and structured networks such as Erdős-Rényi and Barabási-Albert graphs.
- Reading and writingRead and write edge lists, GraphML, GML and JSON formats.
- Pandas integrationConvert graphs to and from pandas DataFrames of edge lists.
- Matrix conversionConvert graphs to and from NumPy and SciPy sparse adjacency matrices.
- VisualizationDraw networks with matplotlib and several layout algorithms.
What you need
- Python
- NetworkX installed, for example with uv pip install networkx
- Optional dependencies via networkx[default]
- matplotlib for visualization
Try asking
- Find the shortest path between two nodes in my network
- Compute PageRank and betweenness centrality for this graph
- Generate a Barabási-Albert scale-free network with 100 nodes
Good to know
- Never unpickle untrusted or externally supplied files, since pickle can execute arbitrary code.
- GraphML, GEXF and compressed files need trusted inputs and size limits.
- Interactive HTML output can expose private labels or data.
- Expensive cycle, clique and isomorphism enumeration and dense matrices should be bounded.
Security check
ANo download-and-run commands, hidden instructions or signs of sending keys out were found.
Checked automatically: skills/networkx/SKILL.md. This looks for known risky patterns and is not a full audit. How grades work
Inside the skill
-
SKILL.md13 KB -
UPSTREAM-LICENSE.txt1 KB -
UPSTREAM-NOTICE.md2 KB -
references/algorithms.md9 KB -
references/generators.md8 KB
Show all 8 files
-
references/graph-basics.md6 KB -
references/io.md9 KB -
references/visualization.md12 KB
Alternatives to networkx
All alternatives →Guides an assistant through the Kaggle CLI, covering competitions, datasets, notebooks, models, benchmarks, authentication and quota. It is for people who use the kaggle command-line tool.
Generates Python code that uses BigQuery DataFrames (BigFrames) for data processing, analysis and machine learning on BigQuery. It is meant for Python data tasks, and the source says to use bigquery-basics for SQL-first workflows.
Discovers connected data sources and proposes loading options when a workspace lacks the data a question needs. Suited to users who want to connect database, warehouse or cloud sources from the chat.
Guides developers through enabling the Data Manager API, setting up Application Default Credentials, and installing its client libraries. Built for developers who are getting started with the API and need local environment and access setup.
Guides authoring and validating Apache Airflow DAGs for Managed Service for Apache Airflow (MSAA), formerly Cloud Composer. Built for developers who create or extend Airflow DAGs in these environments.
Extracts structured JSON data from over 40 websites, including Amazon, LinkedIn, Instagram, TikTok, Facebook and YouTube. Built on Bright Data's Web Data APIs, it returns product details, profiles, reviews, posts and comments from a URL.
Compare with kaggle-cli, bigquery-bigframes or data-loading
networkx: common questions
What graph types does NetworkX support?
The skill lists four types: Graph for undirected single edges, DiGraph for directed edges, MultiGraph for undirected multi-edges, and MultiDiGraph for directed multi-edges.
Is it safe to load graph files from other sources?
The skill says not to unpickle untrusted or externally supplied files, because pickle can execute arbitrary code. GraphML and GEXF inputs should also come from trusted sources.
How do I get reproducible random graphs and layouts?
Set a seed, such as seed=42, in random generators and force-directed layouts. The skill notes that the same seed needs matching NetworkX versions and parameters.
How do I install networkx?
Run the command above to copy the skill into ~/.claude/skills/. Claude Code picks it up automatically.
Is networkx free?
The code is published under the MIT licence. The service it connects to may have its own pricing.
Is networkx safe to use?
It scores 92 of 100. Grades: maintenance A, licence A, quality A. Security check: grade A, no risky patterns found in the files checked. Review the code before you install. How grades work.
What are alternatives to networkx?
Similar skills: kaggle-cli, bigquery-bigframes, data-loading, data-manager-api-setup.
