Skip to main content

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")

TODO

  • 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.2.tar.gz (3.6 kB view details)

Uploaded Source

File details

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

File metadata

  • Download URL: kuroko-0.1.2.tar.gz
  • Upload date:
  • Size: 3.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for kuroko-0.1.2.tar.gz
Algorithm Hash digest
SHA256 49b73768bc0482589491db48d0cf540f54aec2555114b9991617865a9dc41d9d
MD5 07725d03b8cefbd54cb9c39f61989245
BLAKE2b-256 e211acb1f535a3adde44e635a1c834c3b44e51c8c68f444d8f7fd0dd833a0b4d

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page