Skip to content

Installation

This guide is based on Kloppy's installation guide.

Before you can use Glass Onion, you'll need to get it installed. This guide will guide you to a minimal installation that'll work while you walk through the user guide.

Install Python

Being a Python library, Glass Onion requires Python. Currently, Glass Onion supports Python version 3.11+. Get the latest version of Python at python.org or with your operating system's package manager.

You can verify that Python is installed by typing python from your shell; you should see something like:

Python 3.x.y
[GCC 4.x] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>>

Install Glass Onion

You've got three options to install Glass Onion.

Installing an official release with uv

This is the recommended way to install Glass Onion. Simply run this simple command in your terminal of choice:

$ uv add glass_onion

You might have to install uv first. See installation instructions here.

Installing an official release with pip

Simply run this simple command in your terminal of choice:

$ python -m pip install glass_onion

You might have to install pip first. The easiest method is to use the standalone pip installer.

Installing the development version

Glass Onion is actively developed on GitHub, where the code is always available. You can easily install the development version with:

$ pip install git+https://github.com/USSoccerFederation/glass_onion.git

However, to be able to make modifications in the code, you should either clone the public repository:

$ git clone git://github.com/USSoccerFederation/glass_onion.git

Or, download the zipball:

$ curl -OL https://github.com/USSoccerFederation/glass_onion/archive/master.zip

Once you have a copy of the source, you can embed it in your own Python package, or install it into your site-packages easily:

$ cd glass_onion
$ python -m pip install -e .

Verifying

To verify that Glass Onion can be seen by Python, type python from your shell. Then at the Python prompt, try to import it:

>>> import glass_onion
>>> print(glass_onion.__version__)