Skip to main content

Wrapper around APScheduler for managing scheduled tasks.

Project description

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)

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

gadfastcron-0.0.1.tar.gz (4.7 kB view details)

Uploaded Source

Built Distribution

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

gadfastcron-0.0.1-py3-none-any.whl (6.6 kB view details)

Uploaded Python 3

File details

Details for the file gadfastcron-0.0.1.tar.gz.

File metadata

  • Download URL: gadfastcron-0.0.1.tar.gz
  • Upload date:
  • Size: 4.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.12.3

File hashes

Hashes for gadfastcron-0.0.1.tar.gz
Algorithm Hash digest
SHA256 71c7650daf56a1575c9b9e3502a7516d8a1363d517ed595ba15581f03bcbbd1e
MD5 5cd203d569a4280f27d083353e19e23f
BLAKE2b-256 538bd598ac6c235dea5e9d027721e06ba10272ac823eb15870934ff0579401d9

See more details on using hashes here.

File details

Details for the file gadfastcron-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: gadfastcron-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 6.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.12.3

File hashes

Hashes for gadfastcron-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 40e43a524f9b0033c56cd82e687c45f03cd9cfc8aca4fff375a96fc18cecbb9b
MD5 e256b36bc245249d1b1b4f806ce3d336
BLAKE2b-256 d266a2e7a76768bec38ac7d2d87d8c7e8a65efe4bd7c1b762840832f0795546e

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