watchdog API reference
60 public APIs from watchdog (gorakhargosh/watchdog) — 23 classes, 11 functions, 26 methods. Signatures extracted by static analysis of the actual source.
Repository: gorakhargosh/watchdog
| Kind | Count |
|---|---|
| Classes | 23 |
| Functions | 11 |
| Methods | 26 |
API list
class
src.watchdog.events.LoggingEventHandlerLogs all the events captured.
class
src.watchdog.observers.api.BaseObserverBase observer.
method
src.watchdog.observers.api.BaseObserver.add_handler_for_watch(event_handler:FileSystemEventHandler, watch:ObservedWatch) -> NoneAdds a handler for the given watch.
method
src.watchdog.observers.api.BaseObserver.emitters() -> set[EventEmitter]Returns event emitter created by this observer.
method
src.watchdog.observers.api.BaseObserver.remove_handler_for_watch(event_handler:FileSystemEventHandler, watch:ObservedWatch) -> NoneRemoves a handler for the given watch.
method
src.watchdog.observers.api.BaseObserver.unschedule(watch:ObservedWatch) -> NoneUnschedules a watch.
method
src.watchdog.observers.api.EventDispatcher.timeout() -> floatTimeout value to construct emitters with.
method
src.watchdog.observers.api.EventEmitter.queue_event(event:FileSystemEvent) -> NoneQueues a single event.
method
src.watchdog.observers.api.EventEmitter.timeout() -> floatBlocking timeout for reading events.
method
src.watchdog.observers.api.EventEmitter.watch() -> ObservedWatchThe watch associated with this emitter.
class
src.watchdog.observers.api.ObservedWatchAn scheduled watch.
method
src.watchdog.observers.api.ObservedWatch.follow_symlink() -> boolDetermines whether symlink are followed.
method
src.watchdog.observers.api.ObservedWatch.path() -> strThe path that this watch monitors.
class
src.watchdog.observers.fsevents.FSEventsEmittermacOS FSEvents Emitter class.
class
src.watchdog.observers.fsevents2.FSEventsEmitterFSEvents based event emitter.
class
src.watchdog.observers.fsevents2.FSEventsQueueLow level FSEvents client.
class
src.watchdog.observers.inotify.InotifyEmitterinotify(7)-based event emitter.
class
src.watchdog.observers.inotify.InotifyFullEmitterinotify(7)-based event emitter.
class
src.watchdog.observers.inotify.InotifyWatchGroupLinux inotify(7) API wrapper class.
method
src.watchdog.observers.inotify.InotifyWatchGroup.deactivate() -> NoneRemoves all associated watches.
method
src.watchdog.observers.inotify.InotifyWatchGroup.is_active() -> boolReturns True if there are any callbacks active
class
src.watchdog.observers.inotify_c.InotifyEventInotify event struct wrapper.
class
src.watchdog.observers.inotify_c.InotifyFDLinux inotify(7) API wrapper class.
method
src.watchdog.observers.inotify_c.InotifyFD.read_events(*event_buffer_size:int=DEFAULT_EVENT_BUFFER_SIZE) -> list[InotifyEvent]Reads events from inotify and yields them.
method
src.watchdog.observers.inotify_c.InotifyFD.remove_callbacks(callbacks:list[tuple[WatchDescriptor, CallbackId]]) -> NoneRemoves callbacks from WatchDescriptors.
method
src.watchdog.observers.inotify_c.InotifyFD.run() -> NoneRead events from `inotify` and handle them.
class
src.watchdog.observers.inotify_c.WatchRepresents an inotify watch
class
src.watchdog.observers.inotify_move_event_grouper.PathedInotifyEventAn InotifyEvent and its full source path
class
src.watchdog.observers.kqueue.KeventDescriptorSetThread-safe kevent descriptor collection.
method
src.watchdog.observers.kqueue.KeventDescriptorSet.clear() -> NoneClears the collection and closes all open descriptors.
method
src.watchdog.observers.kqueue.KeventDescriptorSet.kevents() -> list[select.kevent]List of kevents monitored.
class
src.watchdog.observers.kqueue.KqueueEmitterkqueue(2)-based event emitter.
method
src.watchdog.observers.kqueue.KqueueEmitter.queue_event(event:FileSystemEvent) -> NoneHandles queueing a single event object.
func
src.watchdog.observers.kqueue.is_deleted(kev:select.kevent) -> boolDetermines whether the given kevent represents deletion.
func
src.watchdog.observers.kqueue.is_modified(kev:select.kevent) -> boolDetermines whether the given kevent represents modification.
func
src.watchdog.observers.kqueue.is_renamed(kev:select.kevent) -> boolDetermines whether the given kevent represents movement.
class
src.watchdog.tricks.LoggerTrickA simple trick that does only logs events.
class
src.watchdog.tricks.ShellCommandTrickExecutes shell commands in response to matched events.
class
src.watchdog.tricks.TrickYour tricks should subclass this class.
class
src.watchdog.utils.BaseThreadConvenience class for creating stoppable threads.
method
src.watchdog.utils.BaseThread.on_thread_start() -> NoneOverride this method instead of :meth:`start()`.
method
src.watchdog.utils.BaseThread.on_thread_stop() -> NoneOverride this method instead of :meth:`stop()`.
method
src.watchdog.utils.BaseThread.should_keep_running() -> boolDetermines whether the thread should continue running.
method
src.watchdog.utils.BaseThread.stop() -> NoneSignals the thread to stop.
class
src.watchdog.utils.dirsnapshot.DirectorySnapshotA snapshot of stat information of files in a directory.
method
src.watchdog.utils.dirsnapshot.DirectorySnapshot.inode(path:bytes | str) -> tuple[int, int]Returns an id for path.
method
src.watchdog.utils.dirsnapshot.DirectorySnapshot.path(uid:tuple[int, int]) -> bytes | str | NoneReturns path for id.
method
src.watchdog.utils.dirsnapshot.DirectorySnapshot.paths() -> set[bytes | str]Set of file/directory paths in the snapshot.
class
src.watchdog.utils.dirsnapshot.EmptyDirectorySnapshotClass to implement an empty snapshot.
method
src.watchdog.utils.dirsnapshot.EmptyDirectorySnapshot.path(_:Any) -> NoneMock up method to return the path of the received inode.
func
src.watchdog.utils.echo.echo(fn:Callable, write:Callable[[str], int | None]=sys.stdout.write) -> CallableEcho calls to a function.
func
src.watchdog.utils.echo.format_arg_value(arg_val:tuple[str, tuple[Any, ...]]) -> strReturn a string representing a (name, value) pair.
class
src.watchdog.utils.event_debouncer.EventDebouncerBackground thread for debouncing event handling.
func
src.watchdog.utils.load_module(module_name:str) -> ModuleTypeImports a module given its name and returns a handle to it.
class
src.watchdog.watchmedo.HelpFormatterA nicer help formatter.
func
src.watchdog.watchmedo.add_to_sys_path(pathnames:list[str], *index:int=0) -> NoneAdds specified paths at specified index into the sys.path list.
func
src.watchdog.watchmedo.load_config(tricks_file_pathname:str) -> dictLoads the YAML configuration from the specified file.
func
src.watchdog.watchmedo.log(args:Namespace) -> NoneCommand to log file system events to the console.
func
src.watchdog.watchmedo.main() -> intEntry-point function.
func
src.watchdog.watchmedo.tricks_from(args:Namespace) -> NoneCommand to execute tricks from a tricks configuration file.
About this data
These signatures were extracted from the public source of gorakhargosh/watchdog
using Python's ast module. Argument names, default values,
type annotations and return types are taken verbatim from the code.
Implementation bodies are never stored. See
how it works for details.