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()  # optional

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.5a0.tar.gz (4.3 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.5a0-py3-none-any.whl (4.5 kB view details)

Uploaded Python 3

File details

Details for the file nbplugins-watch-0.0.5a0.tar.gz.

File metadata

  • Download URL: nbplugins-watch-0.0.5a0.tar.gz
  • Upload date:
  • Size: 4.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.0 requests-toolbelt/0.8.0 tqdm/4.43.0 CPython/3.6.7

File hashes

Hashes for nbplugins-watch-0.0.5a0.tar.gz
Algorithm Hash digest
SHA256 8e3a1f6a616228974d13bbac5734c336e7e576842cecfc81f3dda91912b9ba2d
MD5 3355842b32f8f6a0c06c8584fb6bc5a2
BLAKE2b-256 cf93a8322c1c564a4245c5ff90c5f891bf80ed500586aa3f07cfed80361d786a

See more details on using hashes here.

File details

Details for the file nbplugins_watch-0.0.5a0-py3-none-any.whl.

File metadata

  • Download URL: nbplugins_watch-0.0.5a0-py3-none-any.whl
  • Upload date:
  • Size: 4.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.0 requests-toolbelt/0.8.0 tqdm/4.43.0 CPython/3.6.7

File hashes

Hashes for nbplugins_watch-0.0.5a0-py3-none-any.whl
Algorithm Hash digest
SHA256 169107682925c382def9d663ef972833a9be4a1ff77acde669c58209e59089d8
MD5 a2266baaea2b19b9ba9cf0197e39f154
BLAKE2b-256 c0608b8db7795cf12965261f33f813f21de78cbd04198fb73738b704ab1d2b70

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