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.1-py3-none-any.whl.

File metadata

File hashes

Hashes for airflow_custom_timetable_plugin-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 124d1e769cf87c3c7497e6bee5acddea4d3889e71463d0a8395b1e9e027e4004
MD5 56fa390a1ecc38d29aa7e52499ec9915
BLAKE2b-256 61e8060212b89f53dea3952368b31570a109c7d5090ca9a0a4ca4b3fa6ffdae8

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