Python script to analyze EZproxy SPU logs [Forked]
Code4Lib article: https://journal.code4lib.org/articles/13918
Windows via Archive
- Unlike previous forks, you cannot easily run the script in an IDE like Anaconda, as I use command line arguements to simplify automation.
- Check for python 3, install if needed.
- Open Command Prompt, Powershell, or Powershell core and type
python3 -V, if it returns a version number, it's already installed - You can download and install python 3 from the python website
- Open Command Prompt, Powershell, or Powershell core and type
- Create a program directory for the script. This has to be in a directory the user running it has write access to, so anything under
C:\Users\{username}\should work. For this guide, I'm going to assume a directory was created atC:\Users\{username}\ezp-stats\. - Download the latest archive from the releases page.
- Extract the script and related files into the directory we just created.
- Install the required dependancies
- Open Command Prompt, Powershell, or Powershell core as an administrator (install may fail when running as standard user) and navigate to the directory we created, E.g.
cd C:\Users\{username}\ezp-stats\ - Run the following command:
pip install -r requirements.txtas Administrator. This command will download the required dependencies via the Python Package Installer. Make sure you are currently in the directory with the requirements.txt file or this command will fail. I've had numpy wheels fail to compile when using 3.10, but we do not use that dependancy, so this is fine, however this will abort the pip requirements install and you will need to manually install the required libraries.
- Open Command Prompt, Powershell, or Powershell core as an administrator (install may fail when running as standard user) and navigate to the directory we created, E.g.
Linux via Archive
- Check for python 3, install if needed.
- Open a Terminal and type
python3 -V, if it returns a version number, it's already installed - Most linux versions have Python installed by default, if it is not installed, you can install it via your distributions package manager.
- Open a Terminal and type
- Create a program directory for the script. This has to be in a directory the user running it has write access to, so anything under
/home/{username}/should work in most distributions. For this guide, I'm going to assume a directory was created at/home/{username}/ezp-stats/ - Download the latest archive from the releases page.
- Extract the script and related files into the directory we just created.
- Install the required dependancies
- Open a Terminal and navigate to the directory we created, E.g.
cd /home/{username}/ezp-stats/ - Run the following command:
pip install -r requirements.txtThis command will download the required dependencies via the Python Package Installer. Make sure you are currently in the directory with the requirements.txt file or this command will fail.
- Open a Terminal and navigate to the directory we created, E.g.
Not finished, check back later