This Python library provides tools to generate heatmaps from various data sources (Excel, CSV, and plaintext files). These heatmaps visualize the frequency of events at different times across days of the week, adjusted for specified UTC offsets.
To install the library from source, follow these steps:
-
Clone the repository or download the source code:
git clone https://github.com/colincowie/Timestamp-HeatMap.git cd Timestamp-HeatMap
-
Install the package:
pip install .
This will install the library along with its dependencies.
You can import the necessary functions from the library like this:
from heatmap_pattern_of_life import heatmap_from_excel, heatmap_from_plaintext, heatmap_from_csv
demo.py showcases how to use this library
- Purpose: Generate a heatmap from an Excel sheet.
- Parameters:
file_path
: Path to the Excel file.sheet_name
: Name of the sheet within the Excel file.timestamp_column
: Column name containing timestamps.title
: Title for the heatmap.user_utc_offset
: UTC offset for time adjustment (default is 0).
- Purpose: Generate a heatmap from a plaintext file where each line contains a timestamp.
- Parameters:
file_path
: Path to the plaintext file.title
: Title for the heatmap.timestamp_format
: Format of the timestamps (default is '%Y-%m-%d %H:%M:%S').user_utc_offset
: UTC offset for time adjustment (default is 0).
heatmap_from_csv(file_path, timestamp_column, title, timestamp_format='%Y-%m-%d %H:%M:%S', user_utc_offset=0)
- Purpose: Generate a heatmap from a CSV file.
- Parameters:
file_path
: Path to the CSV file.timestamp_column
: Column name containing timestamps.title
: Title for the heatmap.timestamp_format
: Format of the timestamps (default is '%Y-%m-%d %H:%M:%S').user_utc_offset
: UTC offset for time adjustment (default is 0).