Skip to main content

Graia Scheduler

一个基于 asyncio, 设计简洁, 代码简单的计划任务库, 使用 loop.create_task 创建计划任务;
同时使用生成器特性与 croniter 的定时设计, 轻盈而强大.

Install

pip install graia-scheduler

# or use pdm
pdm add graia-scheduler

使用

0.1以前的版本:

import asyncio
from graia.broadcast import Broadcast
from graia.scheduler import GraiaScheduler
from graia.scheduler.timers import crontabify

loop = asyncio.new_event_loop()

bcc = Broadcast(loop=loop)
scheduler = GraiaScheduler(loop, bcc)


@scheduler.schedule(crontabify("* * * * * *"))
def something_scheduled():
    print("print every second.")

loop.run_forever()

0.1及后续的版本:

import asyncio
from graia.broadcast import Broadcast
from graia.scheduler import GraiaScheduler
from graia.scheduler.timers import crontabify

loop = asyncio.new_event_loop()

bcc = Broadcast(loop=loop)
scheduler = GraiaScheduler(loop, bcc)


@scheduler.schedule(crontabify("* * * * * *"))
def something_scheduled():
    print("print every second.")


loop.run_until_complete(scheduler.run())

因为基于 BroadcastControl, 你可以享受使用 Dispatcher, Interrupt, Decorator 的开发体验.

Metadata

Release files for graia-scheduler 0.3.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 graia-scheduler 0.3.1
File Size Uploaded
graia_scheduler-0.3.1.tar.gz 7.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for graia-scheduler 0.3.1
File Interpreter ABI Platform
graia_scheduler-0.3.1-py3-none-any.whl Python 3 none any Details

Total release size: 17.6 kB

Release files / graia_scheduler-0.3.1.tar.gz

Download URL graia_scheduler-0.3.1.tar.gz
Size 7.3 kB
Tags Source
SHA-256 checksum
How to use checksums
00474242858ff0d829891e1401ac155c950f6572219e0abdc384f9c62ada0bcb
BLAKE2b-256 checksum
How to use checksums
11078e9233a2f44e4632d2ea59f797eae33681d1e961ea24ab22bd609753b5a2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.12.0

Release files / graia_scheduler-0.3.1-py3-none-any.whl

Download URL graia_scheduler-0.3.1-py3-none-any.whl
Size 10.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a6783eef1a81a9815a16814eaf36c5c689065f1be2d06005f7044d68e761e71a
BLAKE2b-256 checksum
How to use checksums
429d586758c33692b10a6c252de5c5709e5ae003e299b8681435c9e027b9b0ff
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.12.0

Release history Release notifications | RSS feed

This release

0.3.1 This release

2 release files

0.3.0

2 release files

0.2.0

2 release files

0.1.5

2 release files

0.1.4

2 release files

0.0.10

2 release files

0.0.8

2 release files

0.0.7

2 release files

0.0.6

2 release files

0.0.5

2 release files

0.0.4

2 release files

0.0.3

2 release files

0.0.2

2 release files

0.0.1

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