Minimalistic Python Bot Framework
Project description
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 All task
use SIGHUP
TODO
[ ] support multi-thread model
[ ] colorize logging
[ ] statistics web frontend
[ ] terminal like interface
License
MIT
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
kuroko-0.1.6.tar.gz
(4.1 kB
view details)
File details
Details for the file kuroko-0.1.6.tar.gz
.
File metadata
- Download URL: kuroko-0.1.6.tar.gz
- Upload date:
- Size: 4.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 522fa383fba516704d2627c0b83f502021e52a8f9b9be5fc72e557ace499ce67 |
|
MD5 | 0328270f613db3cd82a2fd9b4d40938e |
|
BLAKE2b-256 | 5d1b8fa105db8deee5b7c6c586dc49ae0b8375dae818bd7313ac456a971857bf |