Kuroko
Minimalistic Python Task Executor Framework
Requirements
Installation
pip install kuroko
Usage
examples
5sec interval task execution
import kuroko
class MyBot(kuroko.Bot):
@kuroko.timer(5)
def echo_pong(self):
print("pong")
bot = MyBot()
bot.start()
crontab like task execution
class MyBot(kuroko.Bot):
@kuroko.crontab('*/5 * * * *')
def echo_pong(self):
print("pong")
watchdog thin wrapper
class MyBot(kuroko.Bot):
@kuroko.watch
def echo_pong(self, event):
print("pong", event)
@kuroko.watch(patterns=['*.py'])
def echo_ping(self, event):
print("ping", event)
logging
class MyBot(kuroko.Bot):
@kuroko.crontab('*/5 * * * *')
def echo_pong(self):
self.log.info("app logging")
Restart & Stop task
send a SIGUSR1 when you want to restart the all tasks, send a SIGHUP when you want to stop the all tasks.
TODO
[ ] support multi-thread model
[ ] colorize logging
[ ] statistics web frontend
[ ] terminal like interface
License
MIT
Metadata
Release files for kuroko 0.1.7
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| kuroko-0.1.7.tar.gz | 4.2 kB | Without provenance | Details for kuroko-0.1.7.tar.gz |
Release files / kuroko-0.1.7.tar.gz
| Download URL | kuroko-0.1.7.tar.gz |
|---|---|
| Size | 4.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
bed5e0d3f651315e62597951a6d7f6a96ba17676c4f48640b00c250806fa4897
|
|
BLAKE2b-256 checksum How to use checksums |
872db71592e4451bf8a427b2bde878f5d5e2d932c5997eaafe15bfcac5046e70
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for kuroko 0.1.7
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.