Skip to main content

A toolbox for time series analysis and visualization.

Project description

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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

direl_ts_tool_kit-0.4.4.tar.gz (7.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

direl_ts_tool_kit-0.4.4-py3-none-any.whl (8.1 kB view details)

Uploaded Python 3

File details

Details for the file direl_ts_tool_kit-0.4.4.tar.gz.

File metadata

  • Download URL: direl_ts_tool_kit-0.4.4.tar.gz
  • Upload date:
  • Size: 7.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.2

File hashes

Hashes for direl_ts_tool_kit-0.4.4.tar.gz
Algorithm Hash digest
SHA256 acc9a85f13f50df70619ae9c84d76f1b7711150339127d9a736cea5e1158925c
MD5 17e8bb0bbce163cfb9087d1b44670686
BLAKE2b-256 686c2b693d3f749d2bc0a38acb561cf47b525905f3277dcbcd8607af255ff440

See more details on using hashes here.

File details

Details for the file direl_ts_tool_kit-0.4.4-py3-none-any.whl.

File metadata

File hashes

Hashes for direl_ts_tool_kit-0.4.4-py3-none-any.whl
Algorithm Hash digest
SHA256 87b01b0c62a8bba80944d3f3e103bafc8fc4588a311288583933c52c13a91d10
MD5 939e21cfa00fc64a053c22dcd2e83389
BLAKE2b-256 39c546dd7b9cc48366e398c96b12c5b7948a2c126adbc9a929795d19e7adde1d

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page