Skip to main content

watcheagle - is hot reloader for your project based on watchdog!

Project description

watcheagle: A Simple File Watcher and Process Restarter (Fork of watchcat)

watcheagle is a lightweight command-line tool that monitors a directory for file changes and automatically restarts a specified process when a modification is detected. It's designed for development environments where you want to automatically reload your application on code changes. This project is based on the original watchcat but has been simplified and optimized for ease of use.

Goal

The primary goal of watcheagle is to provide a simple, reliable, and efficient way to automatically restart a process when files in a directory change. This is useful for rapid development cycles, automatically testing code, or automatically refreshing content on file updates.

Key Features

  • Easy to Use: Simple command-line interface.
  • Automatic Process Restart: Restarts your application whenever relevant files are modified.
  • Fork of watchcat: Leaner and more straightforward, building upon the foundation of watchcat.
  • Optional Source Directory: Specify the directory to watch, defaulting to the current directory.

Installation

pip install watcheagle

Usage

Invoke watcheagle from the command line, providing the command to execute and optionally the directory to watch.

python -m watcheagle <command_to_execute> [--source <directory>]

Examples

  1. Restarting a Python script in the current directory:

    python -m watcheagle python main.py
    

    This command will execute python main.py and watch for changes in the current directory. Any file modification will trigger a restart of the main.py script.

  2. Restarting a Node.js application monitoring a specific directory:

    python -m watcheagle node app.js --source ./src
    

    This command will execute node app.js and monitor the ./src directory.

  3. Using with a shell script:

    python -m watcheagle ./build_and_run.sh --source ./code
    

    This command assumes you have a build_and_run.sh script that builds your project and then runs it. It will watch the ./code directory for changes.

  4. Monitoring current directory with react application

    python -m watcheagle yarn start --source ./
    

    This is equivalent to running yarn start, and the tool will restart yarn if a file is changed in the current directory

Optional Arguments

  • --source <directory>: Specify the directory to watch for changes. If not provided, watcheagle defaults to the current working directory.

.watchignore (Excluding Files and Directories - Original watchcat feature)

To exclude specific files or directories from being monitored, create a .watchignore file in the root directory being watched. Use fnmatch patterns. The changes may occur as implemented in watchcat original(exclude implementation).

Example .watchignore Usage

# Ignore the logs directory and its output
logs/
*.log

# Ignore temp files
temp_*

Contributing

Contributions are welcome! Feel free to fork the repository, make improvements, and submit pull requests.

License

This project is under the MIT License.

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

watcheagle-1.0.0.tar.gz (7.8 kB view details)

Uploaded Source

Built Distribution

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

watcheagle-1.0.0-py3-none-any.whl (8.1 kB view details)

Uploaded Python 3

File details

Details for the file watcheagle-1.0.0.tar.gz.

File metadata

  • Download URL: watcheagle-1.0.0.tar.gz
  • Upload date:
  • Size: 7.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.8

File hashes

Hashes for watcheagle-1.0.0.tar.gz
Algorithm Hash digest
SHA256 c0413eeb092af1b79729781f0632b657851f57ee3d52245c5bc2c50d7f88e496
MD5 c27d4a8a3c08d7c1311243c7abae5fe5
BLAKE2b-256 e5f9c8c74d217ac929f950c3556eba1bc6431fe126dfdf14244ce2889fee522c

See more details on using hashes here.

File details

Details for the file watcheagle-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: watcheagle-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 8.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.8

File hashes

Hashes for watcheagle-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d8641d5a6b1148c366cb36d9f74c7a467e154b85b8654edd0cc714ecbdc369b4
MD5 1e68a95ca1faf3dfb8e4fbe223d67d49
BLAKE2b-256 43a292db5070178ffce4d8bb486b9323f1c29bea46a2c626e17019a209e3a89b

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