Metadata-Version: 2.4
Name: direl-ts-tool-kit
Version: 0.4.4
Summary: A toolbox for time series analysis and visualization.
Home-page: https://gitlab.com/direl/direl_tool_kit
Author: Diego Restrepo-Leal
Author-email: diegorestrepoleal@gmail.com
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Intended Audience :: Science/Research
Classifier: Topic :: Scientific/Engineering :: Visualization
Requires-Python: >=3.8
Description-Content-Type: text/markdown
License-File: LICENCE
Requires-Dist: pandas>=1.0.0
Requires-Dist: numpy>=1.18.0
Requires-Dist: matplotlib>=3.0.0
Requires-Dist: openpyxl
Dynamic: author
Dynamic: author-email
Dynamic: classifier
Dynamic: description
Dynamic: description-content-type
Dynamic: home-page
Dynamic: license-file
Dynamic: requires-dist
Dynamic: requires-python
Dynamic: summary

# direl-ts-tool-kit: A Toolbox for Time Series Analysis and Visualization
A lightweight Python library developed to streamline common tasks in time series processing, including data preparation,
visualization with a consistent aesthetic style, and handling irregular indices.

## Key features and functions

The library provides the following key functionalities, primarily centered around data preparation and plotting.

### Data preparation and index management

| Function                                          | Description                                                                                                                                                                                                       |
|---------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| parse_datetime_index(df_raw, date_column, format) | Converts a specified column (defaults to "date") from a raw DataFrame into a proper DatetimeIndex. It handles specific format strings to ensure correct date parsing, and returns the cleaned, indexed DataFrame. |
| generate_dates(df_ts, freq)                       | Creates a complete and regular pd.DatetimeIndex spanning from the first to the last date found in the input DataFrame's index. This is primarily used to define a target index for reindexing operations.         |
| reindex_and_aggregate(df_ts, column_name)         | Aligns an irregularly indexed time series DataFrame to a regular frequency. It aggregates data within each time step (e.g., calculates the mean) and fills any resulting time gaps with NaN values.               |

### Visualization and styling

| Function                               | Description                                                                                                                                                                                                                                   |
|----------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| plot_time_series(df_ts, variable, ...) | Generates a customizable time series plot using Matplotlib. It automatically handles x-axis localization based on time_unit (Year, Month, etc.), applies a consistent aesthetic style, and supports automatic formatting of the Y-axis label. |
| paper_colors (Dictionary)              | A global dictionary containing a predefined palette of high-contrast, professional color codes (hex values). These color keys (e.g., "BLUE_LINES", "ORANGE_BARS") are used to ensure visual consistency across all generated plots.           |
