noticeme
Provides python bindings for inotify and framework for building file watchers using coroutines.
Please note this only runs on Linux and a have no plans to support any other OS.
There are many, many alternatives though.
noticeme includes the noticeme command for quickly setting up a file watcher.
Using noticeme declaratively
If you just need a small file watcher you can try this out.
pip install --user noticeme # install
noticeme init # writes an initial config to .noticeme
noticeme # start watching
To see a full list of events:
noticeme events
To select which watchers we want to run we can give a list.
Say we had watchers named build:js, build:css, and test in a single config file.
In one terminal we could run:
noticeme build:js build:css
And in another:
noticeme test
Quick look at configuration
see noticeme/examples/noticeme.cfg for details
# noticeme.cfg
[should]
clear_screen = yes
[imports]
example = A .py file with a @noticeme.watcher decorator in it
[my_watcher]
description = This is an example.
paths = . **
events = written
regex = ^docs
glob = *.txt
shell = echo "my_watcher: file was added"
Using noticeme to build a file watcher programmatically
import asyncio
import noticeme
@noticeme.watcher('/path/to/directory', 'created modified')
async def my_watcher(event):
if '.py' == event.path.suffix.lower():
proc = await asyncio.create_subprocess_exec('cmd', event.path.absolute())
await proc.wait()
if __name__ == '__main__':
noticeme.run()
Requirements
- Linux >= 2.6.13
- Python >= 3.5
- cffi
- C compiler installed (if you need to run inotify_build.py)
Install
pip
pip install --user noticeme
Include directly
- Copy noticeme.py and inotify_build.py to your project directory
- Within noticeme's package directory run:
python3 inotify_build.py
- This creates a 'build' directory containing the result of ffibuilder.compile
- You should now be able to use noticeme.
- inotify_build.py will no longer be needed.
Alternatives
Version 2019.7
- set a more informative window title
Version 2019.8
- add '.noticeme' as possible config file
Version 2019.11
- add 'init' command to write example config file
Metadata
Release files for noticeme 2019.11
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| noticeme-2019.11.tar.gz | 14.6 kB | Without provenance | Details for noticeme-2019.11.tar.gz |
Release files / noticeme-2019.11.tar.gz
| Download URL | noticeme-2019.11.tar.gz |
|---|---|
| Size | 14.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
8e5b5f64bfb59a5ca41160ad1ed06ec312bea8965355391d9102ac2d0f229b4a
|
|
BLAKE2b-256 checksum How to use checksums |
cf48fb7228be038b82d92021d85eda60bcac449939d4678499561a73afd08f8a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.12.1 pkginfo/1.4.2 requests/2.19.1 setuptools/41.0.1 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.5.2
|
Security for noticeme 2019.11
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.