This project visualizes passing networks in soccer matches for individual teams by processing match event data and generating network diagrams that highlight player connections and passing patterns throughout a season. All data is from StatsBomb.
PassingNetworks/
├── Data/
├── Examples/
│ └── workflow.ipynb # Example walkthrough notebook
├── Utils/
│ ├── dataCollection.py # Fetches and preprocesses match data
│ ├── dataProcessing.py # Processes data for visualizations
│ └── visualization.py # Generates passing network visualizations
├── .gitignore
└── README.md
Requirements: Python 3.8+
-
Clone the repository:
git clone https://github.com/your-username/PassingNetworks.git cd PassingNetworks -
Install dependencies:
pip install -r requirements.txt
-
Populate the
Data/directory by running functions in the data collection script:python Utils/dataCollection.py
The easiest way to get started is with the example notebook:
jupyter notebook Examples/workflow.ipynb- Data Collection — Fetches and collects match event data including passes, shots, positions, and player metadata from StatsBomb API
- Data Processing — Gathers information to help with player visualization
- Visualization — Renders passing networks with nodes representing players and edges representing passing frequency over the course of a season
Below is an example of a passing network generated from an entire season, around 36 matches. However, this repo can be used for individual match analysis as well. For all graphs, a minimum passing threshold can be set to filter out players.
This repository can also generate passing heatmaps that visualize where a player tends to distribute the ball most frequently, offering insights into their positioning, decision making, and overall influence on the game. These heatmaps can also help identify patterns such as preferred passing zones and areas of high activity.

