A Python package for football tracking visualization and analytics.
ligafooty is a Python package designed for football tracking data visualization, player movement analysis, and calculating possession-based statistics. It provides easy-to-use functions for plotting football pitch events, animations, and team performance insights. It is a direct twin copy of the @socceranimate library from Data-Futbal which is written in R. This one has some additional features such as defensive line, team possesion status etc. @mplsoccer library is used for pitch visualisation.
- 📦 Packaged with tracking data support using
kloppy
- 📈 Added support for plotting and analyzing PFF Data
- 🧹 Improved structure for easier import and use
- 🐛 Fixed minor bugs from internal testing
Currently data from the provider Metrica Sports and PFF is supported.
Get Metrica Data from this @link
Get PFF Data from this @link
You can directly run the demo_.ipynb jupyter notebook after package installation
- ✅ Player tracking & movement analysis
- ✅ Ball possession detection
- ✅ Animations of player positions
- ✅ Convex hull, Voronoi, and Delaunay triangulation visualizations
- ✅ Customizable pitch themes & team colors
Install ligafooty from pypi:
pip install ligafooty
Directly from github
pip install git+https://github.com/ligandro/ligafooty.git
- Home team always attacks from right to left while Away from left to right
- Default pitch Opta 100 by 100
- To save as video you need to have ffpmeg writer on your system
- There will be multiple frames without ball in play. Theres only about 35-40% of frames where the ball is in play
ligafooty requires the following packages:
pip install numpy pandas matplotlib mplsoccer highlight_text scipy pillow kloppy
Other data sources
Personal project currently. Limited data availibility so no use of this project for real world analysis as of now. Will try to ingest other data sources and then maybe contributions may be possible.
This project is licensed under the MIT License.
For any questions or feature requests, feel free to reach out:
📧 Linkedin : @Linkedin 🐦 Twitter: @Ligandro22