Skip to main content

logo

Wrapper around APScheduler for managing scheduled tasks


Installation

pip install gadfastcron

Usage

import contextlib

from fastapi import FastAPI

from gadfastcron import Cron
from gadfastcron import jobstores, triggers

def func():
    print('test')

cron = Cron(
    jobstores.Sqlalchemy(dsn).store,
    (func, triggers.cron.everyday()), 
)

@contextlib.asynccontextmanager
async def lifespan(_: FastAPI):
    cron.start()
    yield
    cron.shutdown()


app = FastAPI(lifespan=lifespan)

Metadata

Release files for gadfastcron 0.0.1

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

Source distribution (sdist)

Source distribution for gadfastcron 0.0.1
File Size Uploaded
gadfastcron-0.0.1.tar.gz 4.7 kB Details

Built distribution (wheel)

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

Total release size: 11.3 kB

Release files / gadfastcron-0.0.1.tar.gz

Download URL gadfastcron-0.0.1.tar.gz
Size 4.7 kB
Tags Source
SHA-256 checksum
How to use checksums
71c7650daf56a1575c9b9e3502a7516d8a1363d517ed595ba15581f03bcbbd1e
BLAKE2b-256 checksum
How to use checksums
538bd598ac6c235dea5e9d027721e06ba10272ac823eb15870934ff0579401d9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.0.0 CPython/3.12.3

Release files / gadfastcron-0.0.1-py3-none-any.whl

Download URL gadfastcron-0.0.1-py3-none-any.whl
Size 6.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
40e43a524f9b0033c56cd82e687c45f03cd9cfc8aca4fff375a96fc18cecbb9b
BLAKE2b-256 checksum
How to use checksums
d266a2e7a76768bec38ac7d2d87d8c7e8a65efe4bd7c1b762840832f0795546e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.0.0 CPython/3.12.3

Release history Release notifications | RSS feed

This release

0.0.1 This release

2 release files

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