This repository contains two Python scripts for analyzing event data and visualizing it using Streamlit.
test.py
: This script processes event data files and generates an output CSV file containing the analyzed data.app.py
: This script is a Streamlit web application that allows users to upload the output CSV file generated bytest.py
and visualize the analyzed data.
To get started, clone the repository to your local machine:
git clone <repository-url>
cd <repository-directory>
Before running test.py
, you need to specify the input file path where the event data files are located and the output file path where you want to store the generated CSV file within the code itself. Open test.py
in a text editor and locate the following lines:
# Input directory path where event data files are located
input_directory = "/path/to/userevents"
# Output directory path where output CSV file will be stored
output_directory = "/path/to/output"
Replace "/path/to/userevents"
with the actual directory path where the event data files are stored, and "/path/to/output"
with the desired directory path where you want to store the output CSV file.
After setting the input and output directory paths, you can run test.py
using the following command:
python test.py
To run app.py
, follow these steps:
-
Make sure you have the required dependencies installed. You can install them using
pip
:pip install -r requirements.txt
-
Navigate to the directory containing
app.py
in your terminal:cd <repository-directory>
-
Run the Streamlit app with the following command:
streamlit run app.py
-
The Streamlit app will start running, and you can access it in your web browser at
http://localhost:8501
. -
Alternatively, you can also upload the output CSV file directly on the Streamlit app hosted here.
Once the Streamlit app is running, follow these steps to use it:
-
Upload the output CSV file generated by
test.py
using the file uploader in the Streamlit app. -
Once the file is uploaded, you can view and analyze the data using the various visualization options provided in the app interface.