A modern, easy-to-use package to automatically restart a Python application when file changes are detected!
pip install -U py-mon
pymon app.pyZero-config reloads for Python files by default.
- Works for Python files or any shell command (
-x "npm run dev"). - Simple patterns for watch/ignore; sane defaults.
- Clean/quiet mode available when you don’t want prompts.
-w / --watch <pattern>: what to watch (default*.py).-i / --ignore <pattern>: what to ignore.-x / --exec: run a shell command instead ofpython <file>.-d / --debug: print changed paths.-c / --clean: no logs, no stdin commands.
When running pymon, you can use these commands:
- Type
rsto manually restart the process - Type
stopto terminate pymon
Put a .pymonrc or pymon.json in your project root to keep team settings consistent:
{
"watch": ["*.py", "config/*.yaml"],
"ignore": ["*__pycache__*", "*.log"],
"debug": false,
"clean": false,
"exec": false,
"delay": 250
}Command line arguments will always override config file settings.
Anyway that's basically it! Thanks for everything, I would appreciate it if you could leave a follow or star this repository ❣️ If you have any feature requests, read below!
This package is open source so anyone with adequate Python experience can contribute to this project!
If you find any issues with the package or in the code, please create an issue and report it here!
If you want to contribute to this package, fork the repository, clone it, make your changes and then proceed to create a pull request here
Run the test suite locally with pytest:
pip install -e ".[dev]"
pytest