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.1.tar.gz (5.7 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.1-py3-none-any.whl (6.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: pycrontask-0.1.1.tar.gz
  • Upload date:
  • Size: 5.7 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.1.tar.gz
Algorithm Hash digest
SHA256 3af1d8d5d86d5b5313543adc6b53ba78d390e48c665c3d84b86b2f720a3ff040
MD5 9af048ba6b8a0345848d8bd3ccf2a46c
BLAKE2b-256 0b226f0bc4df5cab570591d4ea1f630ef3b9c33bec859174640c32ac224a8531

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pycrontask-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 6.0 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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 4f5e13798fa9f762dde32dec632448bffccf75368ee076a34bf341c219791be3
MD5 6acd54fd987c967ecb14c01a9a06e2e9
BLAKE2b-256 6d9394c44b5f01d0dc2fdbb4d4842c86a3b1fcd8f2258d2aebcfe41e3fec37c7

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