Skip to main content

Universal Apache Airflow plugin with custom timetable support

Project description

Airflow Custom Timetable Plugin

Universal custom timetable plugin for Apache Airflow with support for multiple schedule formats.

Tests PyPI

Installation

pip install airflow-custom-timetable-plugin

From git

pip install git+https://github.com/0xMihalich/airflow-custom-timetable-plugin.git

Supported Schedule Formats

Format Example Description
hh:mm "08:00" Daily at specified time
dd hh:mm "15 08:00" Monthly on specified day and time
mm.dd hh:mm "01.01 00:00" Yearly on specified month, day and time

Usage

from airflow import DAG
from airflow_custom_timetable_plugin import ExactTimetable

with DAG(
    dag_id="my_dag",
    schedule=ExactTimetable(
        schedules=[
            "08:00",         # Every day at 08:00
            "20:00",         # Every day at 20:00
            "1 12:00",       # 1st day of every month at 12:00
            "01.01 00:00",   # January 1st at 00:00
        ]
    ),
    start_date=datetime(2024, 1, 1),
    catchup=False,
    tags=["example"],
) as dag:
    ...

Examples

Daily schedules only

schedule = ExactTimetable(
    schedules=["02:00", "06:00", "10:00", "14:00", "18:00", "22:00"]
)

Mixed schedules

schedule = ExactTimetable(
    schedules=[
        "08:00",         # Daily at 8 AM
        "1 10:00",       # 1st of each month at 10 AM
        "15 14:00",      # 15th of each month at 2 PM
        "12.31 23:59",   # December 31st at 23:59
    ]
)

How It Works

The plugin parses schedule strings into structured entries and computes the next valid run time by finding the earliest future match across all configured schedules.

For the first automated run, the data interval starts and ends at the same time. For subsequent runs, the interval starts from the end of the previous interval, ensuring continuous data coverage.

Requirements

  • Python >= 3.10
  • apache-airflow >= 2.4.3
  • pendulum >= 3.0.0

License

See the LICENSE file for details.

Author

0xMihalich bayanmobile87@gmail.com

Project details


Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

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

File details

Details for the file airflow_custom_timetable_plugin-0.1.2-py3-none-any.whl.

File metadata

File hashes

Hashes for airflow_custom_timetable_plugin-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 870043414354b20dff5cd2da74af2962274a05f4b7b62a35b0907b7ea7c499ba
MD5 01bd9bffbb27024c575be4440604279a
BLAKE2b-256 8a2b5353b9945f40bfda4fb6a20e974d07a5a015095fd38af338ff29ecaa5a91

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