Skip to main content

Python background jobs with a decorator — no Redis, no Celery

Project description

crontask

Python background jobs with a decorator — no Redis, no Celery.

pip install pycrontask
from contextlib import asynccontextmanager
from fastapi import FastAPI
import crontask

ct = crontask.init(
    api_key="...",
    database_url="postgresql://...",
    base_url="https://api.crontask.dev",
)

@ct.job(schedule="0 9 * * *")
async def send_daily_report():
    await do_the_work()

@asynccontextmanager
async def lifespan(app: FastAPI):
    await ct.start()
    yield

app = FastAPI(lifespan=lifespan)

Works with async def and regular def functions. Failure alerts by email. Dashboard at crontask.dev.

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

pycrontask-0.1.0.tar.gz (5.6 kB view details)

Uploaded Source

Built Distribution

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

pycrontask-0.1.0-py3-none-any.whl (5.9 kB view details)

Uploaded Python 3

File details

Details for the file pycrontask-0.1.0.tar.gz.

File metadata

  • Download URL: pycrontask-0.1.0.tar.gz
  • Upload date:
  • Size: 5.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.18 {"installer":{"name":"uv","version":"0.11.18","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for pycrontask-0.1.0.tar.gz
Algorithm Hash digest
SHA256 abc582ac4e4753392eccb9a76f81f0e8f83310d3659804ebf5b6645c164a171d
MD5 bf95f5f184148e660526dc947b52cf0d
BLAKE2b-256 902aa0e7051b77c2f635cc41d46a552e311056f04f000a02bbd4cfd3f209be06

See more details on using hashes here.

File details

Details for the file pycrontask-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: pycrontask-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 5.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.18 {"installer":{"name":"uv","version":"0.11.18","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for pycrontask-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f64c850b2ab5e6e8befbe82818b325721268ae0061a669f50be8000b2c07eac9
MD5 d9cd72827d8ec8d4d47993900df4e5dc
BLAKE2b-256 c92f5ad291ca832e328eb066993eab135f7e9f6c13ffad6ff8eeca1f2c961d38

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