py-file-change is a tool that execute specific command when any file changes in the directory.
Project description
py-file-change
py-file-change is a tool that execute specific command when any file changes in the directory.
Usage
Start cmd/terminal and run following command.
$ python -m py-file-change config.json
Config file
py-file-change requires a configuration file to continue/start the process.
Create a configuration file in root directory or current working directory where you execute the py-file-change
Configuration file must be JSON file and should content required data.
Name | Type | Default value | Description |
---|---|---|---|
cmd | required | - | command to execute |
watch | optional | . | directory to watch |
exclude_ends | optional | [] | ending files will be excluded |
do_print | optional | false | print created, changed, deleted files |
use_kill | optional | false | uses kill method instead terminate method |
Below is the configuration file example that will used to execute command python app.py
, watch current directory(.
) , if the name of file changed is ending with .json
process won't terminate
{
"cmd" : "python app.py",
"watch" : ".",
"exclude_ends" : [
".json"
],
"do_print" : false,
"use_kill" : false
}
py-file-change will take more CPU and Memory when you use it to detect changes in directory that contains large number of files.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file py-file-change-0.0.1.tar.gz
.
File metadata
- Download URL: py-file-change-0.0.1.tar.gz
- Upload date:
- Size: 4.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.10.1 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.10.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 50d627e94fa995d1900083b03da6879542e811e304578dd1cdef6ce61a9b852c |
|
MD5 | cdfd4c545407bc056e7806792911faeb |
|
BLAKE2b-256 | 36c106fb987a0da74e7c0728dc9869535dacc831abb41b94e2857970e6c1407e |
File details
Details for the file py_file_change-0.0.1-py3-none-any.whl
.
File metadata
- Download URL: py_file_change-0.0.1-py3-none-any.whl
- Upload date:
- Size: 4.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.10.1 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.10.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ee0b42f2f3a5f08848a417cd9cab37579104b4c50a69cd29776d05049a33c2f6 |
|
MD5 | 09adc5137aa45bc63c12b8c9846564fe |
|
BLAKE2b-256 | 5e1d4751ddbd645e88c08bc026f8b9e6072f2fe25d559ed11747cd4c91aeb4fc |