Skip to main content

grph

Like grep, but for graphs.

A powerful command-line tool for exploring, analyzing, and querying graph files. Built for developers, data scientists, and anyone who works with graph data.

What is grph?

grph is a Python-based CLI tool that lets you explore and analyze graph files from your terminal. Think of it as grep for graphs - quick answers to graph questions without leaving the command line.

Core Capabilities

  • Graph Traversal - Find neighbors, paths, and reachable nodes
  • Graph Analysis - Calculate centrality, find components, get statistics
  • Filtering - Find nodes and edges by attributes
  • Export - Output to JSON, GraphML, and other formats

Quick Examples

# Get an overview of your graph
grph info network.gexf

# Find the shortest path between two nodes
grph path network.gexf server1 database

# Find the most influential nodes
grph centrality social-network.gexf --type pagerank --top 10

# What depends on this package?
grph neighbors dependencies.gexf lodash --direction in

# Export for visualization
grph export network.gexf --format json --output network.json

Features

CategoryCommands
Basicinfo, meta, nodes, edges
Traversalneighbors, path, all-paths, has-path, reachable, common-neighbors
Analysisstats, centrality, components, degree
Subgraphsego, subgraph
Exportexport (JSON, GraphML, adjacency list, edge list)

Installation

# Via pip
pip install grph-cli

# Via Homebrew (macOS)
brew tap jordanterry/grph https://github.com/jordanterry/grph
brew install grph-cli

Documentation Structure

This documentation follows the Divio documentation system:

Tutorials

Learning-oriented step-by-step lessons. Start here if you're new to grph.

How-to Guides

Problem-oriented recipes for specific tasks.

Explanation

Understanding-oriented discussions of concepts.

CLI Reference

Information-oriented technical reference for all commands.

Next Steps

New to grph? Start with the Getting Started guide, then try the London Underground tutorial.

Have a specific problem? Check the How-to Guides.

Need command details? See the CLI Reference.