Skip to main content

🔁 Automatically restart application when file changes are detected; made for development

Project description

py-mon

A modern, easy-to-use package to automatically restart a Python application when file changes are detected!

Quickstart (10s)

pip install -U py-mon
pymon app.py

Zero-config reloads for Python files by default.

Why py-mon?

  • 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.

Core flags

  • -w / --watch <pattern>: what to watch (default *.py).
  • -i / --ignore <pattern>: what to ignore.
  • -x / --exec: run a shell command instead of python <file>.
  • -d / --debug: print changed paths.
  • -c / --clean: no logs, no stdin commands.

Command Input

When running pymon, you can use these commands:

  • Type rs to manually restart the process
  • Type stop to terminate pymon

Optional Config File

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!

Contributing

This package is open source so anyone with adequate Python experience can contribute to this project!

Report Issues

If you find any issues with the package or in the code, please create an issue and report it here!

Fix/Edit Content

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

Tests

Run the test suite locally with pytest:

pip install -e ".[dev]"
pytest

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

py_mon-2.2.0.tar.gz (9.7 kB view details)

Uploaded Source

Built Distribution

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

py_mon-2.2.0-py3-none-any.whl (11.7 kB view details)

Uploaded Python 3

File details

Details for the file py_mon-2.2.0.tar.gz.

File metadata

  • Download URL: py_mon-2.2.0.tar.gz
  • Upload date:
  • Size: 9.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.6

File hashes

Hashes for py_mon-2.2.0.tar.gz
Algorithm Hash digest
SHA256 95f9ec2eb883728170d6a8ddf85a46bb0d3b508b61b993d84d06c72d5813a70e
MD5 9f66f6c2b90f5719f485a300749d9f5e
BLAKE2b-256 ac6f8b02ba9dd121b0f0b7cbf91b82a82c13c12266209545581b45c018da5ccf

See more details on using hashes here.

File details

Details for the file py_mon-2.2.0-py3-none-any.whl.

File metadata

  • Download URL: py_mon-2.2.0-py3-none-any.whl
  • Upload date:
  • Size: 11.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.6

File hashes

Hashes for py_mon-2.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 bde207825736128cf238429e7b0537b2ee57e39736b3d311a0b10b86dc514106
MD5 dff1859fff8d0af1c4f362c7d91289fe
BLAKE2b-256 d53265649b15490a0629653fba7fd1a713a58be9b0bd077fb46994c03453d8b7

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