Python script to analyze EZproxy SPU logs [Forked]
Code4Lib article: https://journal.code4lib.org/articles/13918
Generally speaking, this script requires the following Python libraries to run:
- Pandas
- Matplotlib The full list of dependencies are listed below.
I recommend installing Anaconda (https://www.anaconda.com/distribution/) to run the code and manage libraries
Previous month (usually just 1 log file) Run the EZProxy-PrevMonth script to capture the data from the previous month (the script formats filenames and HTML based on the previous month)
Full-year (or several log files) Run the EZProxy-FY script to capture data for a larger period of time. This one doesn't create a By Day chart/table.
Pandas
- setuptools
- NumPy
- python-dateutil
- pytz
- numexpr
- bottleneck
Matplotlib
- Python
- FreeType
- libpng
- NumPy
- setuptools
- cycler
- dateutil
- kiwisolver
- pyparsing
Setup Python
- Install Anaconda and ensure that all the libraries/dependencies listed above are included
- Download files from Google Drive or Github
- Create a folder in root C:\ called Statistics
- Unpack files and move into root of C:\Statistics
- Inside C:\Statistics, create another folder ezproxy_logs.
Running the script
- Copy any number of logs you want to analyze into C:\Statistics\ezproxy_logs
- Open the Python file you want to run in Spyder (the Python environment for Anaconda)
- Press the PLAY button and the script will go through the logs.
- When completed, you'll see the generated charts load in the bottom right console window.
Opening results
- Navigate to C:\Statistics and find the folder the script generated with unpacked log stats.
- You can delete the [date].csv file generated if you don't want to keep the translated log data.
- Opening the [date].html file will display the generated charts and table results. The chart graphics are stored in the Charts folder.