Skip to main content

Cosmograph is a library for scheduling asynchronous tasks using the `apscheduler` library. It provides decorators to easily schedule tasks at specific times, intervals, or dates.

Project description

Cosmograph - Async Task Scheduler

Cosmograph is a library for scheduling asynchronous tasks using the apscheduler library. It provides decorators to easily schedule tasks at specific times, intervals, or dates.

Installation

pip install apscheduler

Quick Start

from scheduler import Cosmograph, time_schedule, interval_schedule, date_schedule, on_shutdown

Use Cosmograph and scheduling methods as needed

Features

Schedule tasks at specific times using cron-like syntax. Schedule tasks at regular intervals. Schedule tasks to run at a specific date and time. Gracefully shut down the scheduler when the application is shutting down.

Usage

Time Schedule

@time_schedule(hour=12, minute=30)
async def my_scheduled_task():
    print("Task executed at 12:30 PM.")

Interval Schedule

@interval_schedule(minutes=15)
async def my_repeating_task():
    print("Task executed every 15 minutes.")

Date Schedule

@date_schedule(run_date="2023-01-01 00:00:00")
async def my_one_time_task():
    print("Task executed once at the specified date and time.")

Graceful Shutdown

# Perform this during application shutdown
on_shutdown()

Contribution

Feel free to contribute by opening issues or creating pull requests. We welcome your feedback and contributions!

License

This project is licensed under the MIT License AGPLv3 - see the LICENSE file for details.

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

python_cosmograph-0.1.1.tar.gz (2.2 kB view details)

Uploaded Source

Built Distribution

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

python_cosmograph-0.1.1-py3-none-any.whl (3.0 kB view details)

Uploaded Python 3

File details

Details for the file python_cosmograph-0.1.1.tar.gz.

File metadata

  • Download URL: python_cosmograph-0.1.1.tar.gz
  • Upload date:
  • Size: 2.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.7.1 CPython/3.11.6 Windows/10

File hashes

Hashes for python_cosmograph-0.1.1.tar.gz
Algorithm Hash digest
SHA256 05c62eec47c2f920988f7ee8cdbf0153dab037ffe30635a5b82e1640c9651531
MD5 94dd87db750797fc80bd42fd7aecf255
BLAKE2b-256 fd5cdb1c2353302a9eeeed00627607ef1bd779e1097f94a627b8a29ffc5e2cb2

See more details on using hashes here.

File details

Details for the file python_cosmograph-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: python_cosmograph-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 3.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.7.1 CPython/3.11.6 Windows/10

File hashes

Hashes for python_cosmograph-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 197cfc69026f98f5f82d4497a420947eb1dcc4738fc45675290101872eb9764e
MD5 ba089b7a2061a8ec62d7a102f8d30b2e
BLAKE2b-256 bf3f1b1e94cdceb2cf6192ac6b53a915f3a6be2589ad9f24bd5d126ef5448745

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