Skip to main content

Crontab implementation in asyncio

Project description

AIOCRONTAB

Sample project to "flex" my asyncio skills.

Installation

pip install aiocrontab

Usage

import time

import aiocrontab


@aiocrontab.register("*/5 * * * *")
def print_every_five_mminutes():
    print(f"{time.ctime()}: Hello World!!!!!")

@aiocrontab.register("* * * * *")
def print_every_mminute():
    print(f"{time.ctime()}: Hello World!")


aiocrontab.run()

TODO

  • support for diff timezones
  • support for async task
  • take logger as dependency
  • Add more meaningful tests
  • fix mypy errors
  • document the codebase
  • document usage in readme
  • different namespaces for different crontab instances
  • ability to schedule task from code
  • better logging messages

If you didn't create any new Crontab instance (ie: You are using @aiocrontab.register), you can get the logger that the aiocrontab application uses using the following snippet

import logging

logger = logging.getLogger("global.aiocrontab.core")

If you created your own Crontab instance(using Crontab()), and in-case you didn't provide the logger when creating a Crontab instance, you can use the following snippet to get the logger that it uses.

import logging

logger = logging.getLogger("aiocrontab.core")

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

aiocrontab-0.1.2.tar.gz (5.2 kB view details)

Uploaded Source

Built Distribution

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

aiocrontab-0.1.2-py3-none-any.whl (5.7 kB view details)

Uploaded Python 3

File details

Details for the file aiocrontab-0.1.2.tar.gz.

File metadata

  • Download URL: aiocrontab-0.1.2.tar.gz
  • Upload date:
  • Size: 5.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.3 CPython/3.13.5 Darwin/22.1.0

File hashes

Hashes for aiocrontab-0.1.2.tar.gz
Algorithm Hash digest
SHA256 7349908cb28d43b20a38287733a12fb36cb168190cde2891c63a2661baa188a1
MD5 046333ddcb94792b3b9b0b419b38d0e5
BLAKE2b-256 c04317bac2d7ad8c913c4107e7e5276a0203cbb532bb51699dc51725dad82adf

See more details on using hashes here.

File details

Details for the file aiocrontab-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: aiocrontab-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 5.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.3 CPython/3.13.5 Darwin/22.1.0

File hashes

Hashes for aiocrontab-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 cb70514057d745b3947e73b09d12dc06052bc715ffc5cb5745c5964195ddb556
MD5 0d5bb39b47b902be67ff97d958cb43f0
BLAKE2b-256 3687a26feb98368353d1d1e4f729caedd401605bf16c826b66c025bf36145a4a

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