Skip to main content

watch and (re)load plugins from a directory

Project description

nonebot-plugins-watch

Python3.7 package Codecov PyPI version

hot plug and remove nonebot plugins

Installation

pip install nbplugins-watch

Validate installation

python -c "import nbplugins_watch; print(nbplugins_watch.__version__)"
0.0.1

Usage

Make a directory somewhere and place an empty __init__.py in it.

Monitor the directory in your nonebot runner file, e.g. in my_nonebot.py:

import nonebot

nonebot.load_builtin_plugins()  # optioinal

plugin_dir_path = r"path_to_plugin_dir"  # absolute or relative path
from nbplugins_watch import nbplugins_watch
nbplugins_watch(plugin_dir_path)

nonebot.run()

Create a file, say fancy_plugin.py, in the directory above. Edit and test and/or remove the file fancy_plugin.py to your heart's content.

Note: if a plugin file contains syntax errors (as opposed to logic errors), you'll have to restart nonebot, in other words, nbplugins_watch will cease to work after an uncaught error.

Acknowledgments

  • Thanks to everyone whose code was used

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

nbplugins-watch-0.0.4.tar.gz (3.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

nbplugins_watch-0.0.4-py3-none-any.whl (4.1 kB view details)

Uploaded Python 3

File details

Details for the file nbplugins-watch-0.0.4.tar.gz.

File metadata

  • Download URL: nbplugins-watch-0.0.4.tar.gz
  • Upload date:
  • Size: 3.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.0.5 CPython/3.7.2 Windows/10

File hashes

Hashes for nbplugins-watch-0.0.4.tar.gz
Algorithm Hash digest
SHA256 42660d2977700b64f0d8d52811a54ecbf421ec67822233fd1e95d774363a7ffe
MD5 c80629f1f244e14527c68e984e0d5bd8
BLAKE2b-256 34d0c8ec2ef2f33ffbc73dd0731b6e1c54003f918d102ce9cab691a40a0c91b2

See more details on using hashes here.

File details

Details for the file nbplugins_watch-0.0.4-py3-none-any.whl.

File metadata

  • Download URL: nbplugins_watch-0.0.4-py3-none-any.whl
  • Upload date:
  • Size: 4.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.0.5 CPython/3.7.2 Windows/10

File hashes

Hashes for nbplugins_watch-0.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 48eb267d3ff9150bac224f5257fcd7abac18e73f4ae93a01f0877099fd5c1a14
MD5 0714cff8d1c52219c8d5039482f423ae
BLAKE2b-256 a8f0d4fba65b91a898e8360445cfbcb47389725d8e101590fe1a41a87215c406

See more details on using hashes here.

Supported by

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