dataria.CHRON ============= .. py:module:: dataria.CHRON .. autoapi-nested-parse:: Visualization and aggregation of time-based data. This module provides functionality to generate rolling time series plots and calendar heatmaps based on a date column. Input data can be provided via a DataFrame or fetched dynamically using a SPARQL query. Outputs include CSV summaries, Matplotlib and Plotly visualizations. Functions --------- .. autoapisummary:: dataria.CHRON.date_aggregation Module Contents --------------- .. py:function:: date_aggregation(df=None, endpoint_url=None, query=None, date_var='date', plot_type='rolling', mode='count', num_var=None, window=7, csv_filename='time_aggregated_data.csv', png_filename='time_plot.png', html_filename='time_render.html') Aggregates and visualizes event data based on a date column. The function generates either a rolling time series plot or a heatmap grouped by weekday and month. Input data can be passed as a DataFrame or fetched from a SPARQL endpoint. Aggregated data and plots can be saved as CSV, PNG, and HTML files. :param df: Input data as a DataFrame. Ignored if `endpoint_url` and `query` are provided. :type df: pd.DataFrame, optional :param endpoint_url: SPARQL endpoint URL. :type endpoint_url: str, optional :param query: SPARQL query to fetch data. :type query: str, optional :param date_var: Name of the column containing date values (default: 'date'). :type date_var: str :param plot_type: Type of plot to generate – either 'rolling' or 'heatmap'. :type plot_type: str :param mode: Aggregation mode – 'count', 'sum', or 'mean'. :type mode: str :param num_var: Name of the numeric column for 'sum' or 'mean' mode. :type num_var: str, optional :param window: Window size in days for rolling aggregation. :type window: int :param csv_filename: File path to save the aggregated data (CSV). :type csv_filename: str :param png_filename: File path to save the plot (PNG). :type png_filename: str :param html_filename: File path to save the Plotly plot (HTML). :type html_filename: str :returns: None