Skip to main content

The package busm means bring up Samuel. It's allusion comes from Holy Bible 1 Samuel 28:11. It help you find abnormal situations in a background process.

There are several function decorators and logging handlers inside. These tools can send message of abnormal situations through Email, Telegram or Line Notify.

套件 busm 是 "召喚撒母耳" 的意思,典故出自聖經撒母耳記上 28 章第 11 節,其實就是觀落陰的意思。 這套件可以幫你找出背景作業的異常狀況。

裡面有一些 function decorators 和 logging handlers, 用這些工具可以把異常狀況透過 Email, Telegram, Line Notify 這些方式送出去。

Quick Start

First, install the package.

pip install busm

Then add decorators before functions you'd like to monitor.

import busm

@busm.through_smtp
def foo_email():
    print('It sucks!')

@busm.through_telegram
def foo_telegram():
    print('Segmentation fault.')

@busm.through_line
def foo_line():
    print('Stack overflow.')

if __name__ == '__main__':
    foo_email()
    foo_telegram()
    foo_line()

Run your python code.

python foo.py

You must see the following message, and a config file will be generated in HOME directory.

-----------------------------------------------------------------
  Please change fundog config file (~/.busm.json) to enable.
-----------------------------------------------------------------

Edit this config file ~/.busm.json to fit for you.

{
  "smtp": {
    "host": "smtp.gmail.com",
    "port": 587,
    "user": "someone",
    "pass": "********",
    "from_name": "Foo",
    "from_email": "someone@gmail.com",
    "to_name": "Master",
    "to_email": "someone@gmail.com"
  },
  "telegram": {
    "token": "123456789:-----------------------------------",
    "master": "123456789"
  },
  "line-notify": {
    "token": ""
  }
}

Run your python code again.

python foo.py

Tada! You can preview screenshots here.

Metadata

Release files for busm 0.9.5

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distribution (wheel)

Table of built distributions (wheels) for busm 0.9.5
File Interpreter ABI Platform Actions
busm-0.9.5-py3-none-any.whl Python 3 none any Details for busm-0.9.5-py3-none-any.whl

Release files / busm-0.9.5-py3-none-any.whl

Download URL busm-0.9.5-py3-none-any.whl
Size 7.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d7cebc03bf693c35df83f4ddee27b3062be3f16efc531d171341c82bbbe39bd8
BLAKE2b-256 checksum
How to use checksums
95e93ca168a1050af72b3f0c04621dcba60c8cebf5896d1e502e2f47b3f3c01f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.46.1 CPython/3.8.2

Security for busm 0.9.5

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.

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