Skip to main content

async_task_scheduler

async_task_scheduler is a Python module that allows you to schedule asynchronous tasks using various scheduling strategies such as cron-like schedules, one-time execution, and more.

Installation

To install the module, simply install it using pip:

pip install async_task_scheduler

Usage

Creating a Scheduler

First, create an instance of the Scheduler class:

from async_task_scheduler import Scheduler

scheduler = Scheduler()

Adding Tasks

You can add tasks to the scheduler using various decorators:

Always

Runs the task every minute.

@scheduler.always
async def every_minute():
    print("This will be called every minute")

Cron

Runs the task based on a cron-like schedule.

@scheduler.cron("*/2 * * * 5")
async def custom_cron_schedule():
    print("This will be called every two minutes on Fridays")

Hourly

Runs the task at the start of every hour.

@scheduler.hourly
async def every_hour():
    print("This will be called every hour")

Daily

Runs the task at the start of every day.

@scheduler.daily
async def every_day():
    print("This will be called every day")

Weekly

Runs the task at the start of every week.

@scheduler.weekly
async def every_week():
    print("This will be called every week")

Monthly

Runs the task at the start of every month.

@scheduler.monthly
async def every_month():
    print("This will be called every month")

At Start

Runs the task once when the scheduler starts.

@scheduler.at_start
async def start_task():
    print("This will be called once when the scheduler starts")

At Specific Time

Runs the task at a specific datetime.

@scheduler.at(datetime(2025, 3, 10, 18, 29))
async def future_task():
    print("This will be called at 6:29 PM on March 10, 2025")

Running the Scheduler

To run the scheduler, await the run method or call it using asyncio.run:

await scheduler.run()

or

import asyncio

asyncio.run(scheduler.run())

The scheduler will run indefinitely until the program is stopped.

Example

See the end of the source file for a complete example.

License

This project is licensed under the MIT License.

Metadata

Release files for async_task_scheduler 0.1.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for async_task_scheduler 0.1.2
File Size Uploaded Provenance Actions
async_task_scheduler-0.1.2.tar.gz 3.8 kB Without provenance Details for async_task_scheduler-0.1.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for async_task_scheduler 0.1.2
File Interpreter ABI Platform Actions
async_task_scheduler-0.1.2-py3-none-any.whl Python 3 none any Details for async_task_scheduler-0.1.2-py3-none-any.whl

Total release size: 8.5 kB

Release files / async_task_scheduler-0.1.2.tar.gz

Download URL async_task_scheduler-0.1.2.tar.gz
Size 3.8 kB
Tags Source
SHA-256 checksum
How to use checksums
82903228b980fdb83cdce015a892b3561daf39da3d72f124673ae890e3f29d0a
BLAKE2b-256 checksum
How to use checksums
8d01fe218519d84d5055d5bfa014d161e975c935ed8ec6c377456ec59b48f97a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.11.1 {"installer":{"name":"uv","version":"0.11.1","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Linux Mint","version":"22.3","id":"zena","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / async_task_scheduler-0.1.2-py3-none-any.whl

Download URL async_task_scheduler-0.1.2-py3-none-any.whl
Size 4.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
93d8e9f1f861d2f264d56580712fc2f8e75151c19e32459d8a298029bdb7b44b
BLAKE2b-256 checksum
How to use checksums
382995039b2d6ad3a18a497b1edf2cb075fdd1caefb85e431b7f33bf98bd0e25
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.11.1 {"installer":{"name":"uv","version":"0.11.1","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Linux Mint","version":"22.3","id":"zena","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Security for async_task_scheduler 0.1.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page