diff --git a/documentation/docs/assets/log_file_format.png b/documentation/docs/assets/log_file_format.png new file mode 100644 index 0000000..ef742c8 Binary files /dev/null and b/documentation/docs/assets/log_file_format.png differ diff --git a/documentation/docs/assets/log_file_parser.png b/documentation/docs/assets/log_file_parser.png new file mode 100644 index 0000000..461c386 Binary files /dev/null and b/documentation/docs/assets/log_file_parser.png differ diff --git a/filedownloadstat/stat_types/trends_stat.py b/filedownloadstat/stat_types/trends_stat.py new file mode 100644 index 0000000..4942c38 --- /dev/null +++ b/filedownloadstat/stat_types/trends_stat.py @@ -0,0 +1,20 @@ +import plotly.express as px + + +class TrendsStat: + + @staticmethod + def download_over_treands(daily_data): + """ + Understand download trends over days, months, or years. + """ + # Create the line chart with 'date' on the x-axis and 'count' on the y-axis + fig = px.line( + daily_data, + x='date', # X-axis: Date + y='count', # Y-axis: Count of downloads + color='method', # Group by 'method' to create separate lines + title='File Downloads Over Time', # Chart title + labels={"date": "Date", "count": "Downloads", "method": "Method"} # Axis labels + ) + fig.write_html("download_over_treands.html") \ No newline at end of file diff --git a/filedownloadstat/stattypes/user_stat.py b/filedownloadstat/stat_types/user_stat.py similarity index 100% rename from filedownloadstat/stattypes/user_stat.py rename to filedownloadstat/stat_types/user_stat.py diff --git a/filedownloadstat/stattypes/trends_stat.py b/filedownloadstat/stattypes/trends_stat.py deleted file mode 100644 index 27d0df1..0000000 --- a/filedownloadstat/stattypes/trends_stat.py +++ /dev/null @@ -1,37 +0,0 @@ -import plotly.express as px - - -class TrendsStat: - - @staticmethod - def download_over_treands(daily_data): - """ - Understand download trends over days, months, or years. - """ - # Create the line chart with 'date' on the x-axis and 'count' on the y-axis - fig = px.line( - daily_data, - x='date', # X-axis: Date - y='count', # Y-axis: Count of downloads - color='method', # Group by 'method' to create separate lines - title='File Downloads Over Time', # Chart title - labels={"date": "Date", "count": "Downloads", "method": "Method"} # Axis labels - ) - fig.write_html("download_over_treands.html") - - # @staticmethod - # def downloads_by_month(monthly_data): - # """ - # Aggregate downloads by year or month. - # """ - # # Create the bar chart grouped by month and year - # fig = px.bar( - # monthly_data, - # x='month', # X-axis: Month - # y='count', # Y-axis: Count of downloads - # color='year', # Color bars by year - # barmode='group', # Group bars by year - # title='Monthly Downloads Grouped by Year', # Chart title - # labels={"month": "Month", "count": "Downloads", "year": "Year"} # Axis labels - # ) - # fig.write_html("downloads_by_month.html") \ No newline at end of file diff --git a/tests/test_log_parser.py b/tests/test_log_parser.py index 5561173..e3a98db 100644 --- a/tests/test_log_parser.py +++ b/tests/test_log_parser.py @@ -13,7 +13,7 @@ def setUpClass(cls): with open(yaml_path, "r") as file: cls.config = yaml.safe_load(file) - # Initialize LogParser with YAML config + # Initialize LogFileParser with YAML config cls.parser = LogParser("", resource_list=cls.config["resource_identifiers"], completeness_list=cls.config["completeness"],