HackerReposA FIELD GUIDE TO OPEN SOURCE
ProSponsor the shelf♧ 0
← Back to top all-time
gorakhargosh
watchdog
Python2013–2024
gorakhargosh / watchdog

watchdog

Python library and shell utilities to monitor filesystem events.

8Distinct people
8Mentions
0Explicit recommenders
7.5KGitHub stars
REPOSITORY AT A GLANCE

What to know before exploring

What it is

Python library and shell utilities to monitor filesystem events.

GitHub

Where it is used

  • Home Assistant — The Folder watcher integration adds Watchdog file system monitoring. The integration calls watchdog.observers.Observer. Source

What people are saying

No recommendation phrase was found in the indexed comments.

No classified warning is attached to this page. Read the discussions before treating silence as approval.

Also in these discussions

No other repository is repeatedly linked in the same discussions.

This week on Hacker News

Nov 7–Nov 14 UTC · Direct repository links and separately labeled related project stories. Indexed through 11/14/2026, 3:56:07 PM UTC.

No direct repository links were found in the indexed HN discussions over the past seven days. Older discussions are available below.

Mentions over time

HN mentions by year8 dated mentions

Observed mentions: 2013-12-13 15:38:30 UTC to 2024-11-23 16:29:54 UTC.

012013-01-01 00:00:00 UTC to 2014-01-01 00:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 comments20132014-01-01 00:00:00 UTC to 2015-01-01 00:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 comments2015-01-01 00:00:00 UTC to 2016-01-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2016-01-01 00:00:00 UTC to 2017-01-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2017-01-01 00:00:00 UTC to 2018-01-01 00:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 comments2018-01-01 00:00:00 UTC to 2019-01-01 00:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 comments20182019-01-01 00:00:00 UTC to 2020-01-01 00:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 comments2020-01-01 00:00:00 UTC to 2021-01-01 00:00:00 UTC (exclusive): 1 mentions; 1 submissions, 0 comments2021-01-01 00:00:00 UTC to 2022-01-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2022-01-01 00:00:00 UTC to 2023-01-01 00:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 comments2023-01-01 00:00:00 UTC to 2024-01-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2024-01-01 00:00:00 UTC to 2025-01-01 00:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 comments2024

Counts come from the repository’s dated source evidence. Index cutoff: 2026-11-02 08:16:59 UTC.

View mention counts and date ranges
UTC ranges include their start and exclude their end. Select a period to filter the source evidence.
PeriodStart (UTC)End (exclusive, UTC)MentionsSubmissionsComments
20132013-01-01 00:00:00 UTC2014-01-01 00:00:00 UTC101
20142014-01-01 00:00:00 UTC2015-01-01 00:00:00 UTC101
20152015-01-01 00:00:00 UTC2016-01-01 00:00:00 UTC000
20162016-01-01 00:00:00 UTC2017-01-01 00:00:00 UTC000
20172017-01-01 00:00:00 UTC2018-01-01 00:00:00 UTC101
20182018-01-01 00:00:00 UTC2019-01-01 00:00:00 UTC101
20192019-01-01 00:00:00 UTC2020-01-01 00:00:00 UTC101
20202020-01-01 00:00:00 UTC2021-01-01 00:00:00 UTC110
20212021-01-01 00:00:00 UTC2022-01-01 00:00:00 UTC000
20222022-01-01 00:00:00 UTC2023-01-01 00:00:00 UTC101
20232023-01-01 00:00:00 UTC2024-01-01 00:00:00 UTC000
20242024-01-01 00:00:00 UTC2025-01-01 00:00:00 UTC101

What Hacker News says

8 sources
> A lot of developers really seem to prefer janky, undermaintained third party libraries with huge APIs over a quick home made hack to solve exactly the problem your team has Sometimes it’s not even that they’re janky and undermaintained, it’s just the huge and unnecessary API. A good example is watching for file changes. inotify has been around forever, and is easy to reason about. The Python library inotify_simple [0] just wraps that. That’s it. It works extremely well, has no dependencies of its own, and provides nothing else. I once needed this functionality for a project, and had another teammate argue we should use watchdog [1] instead, because it had more stars, and more frequent commits. It took me longer than I thought it would to explain that sometimes, projects are complete and don’t need commits, and that we didn’t need or wan
Read the rest
t any of the additional complexity provided by watchdog. Another example is UUID generation. Python doesn’t yet natively do UUIDv7 generation, but if you read their source code and the RFC for UUIDv7, it’s fairly easy to write your own implementation. This was met with “please don’t write your own UUID implementation; use a library.” Baffling. [0]: https://github.com/chrisjbillington/inotify_simple [1]: https://github.com/gorakhargosh/watchdog
In Dear sir, you have built a compiler (2022)
Also not to be confused with watchdog and it's command watchmedo, which is what I thought this was when I first read the headline. I don't know what the differences are, but I use watchdog to restart my local celery workers when I make changes. It's scripted out so I don't ever use the command directly. https://pypi.org/project/watchdog/ https://github.com/gorakhargosh/watchdog EDIT: Now I'm wondering how often I miss out on something because I confuse it for something I already use. Maybe there is room for a "things I use" or "things I know about" browser plugin.
In Watchman: Execute a command when something changes
A well-written Python app using the respective platform's native events through say, watchdog[1] performs perfectly fine for huge numbers of files[t]. The language used isn't at all the problem with Dropbox's performance which has been a problem for as long as they've had a desktop app. If there's one specific bottleneck (ex: hashing files) then that's a prime candidate for Cython[2] or the plain CPython C-API. Even when you have dropbox restricted to a small folder with _no IO events at all_ it's still constantly working, which is the real problem and entirely an optimization/design problem. [1]: https://github.com/gorakhargosh/watchdog [2]: https://cython.org/ [3]: https://docs.python.org/3/c-api/index.html [t]: ... except when forced to use kqueue or polling
In The new Dropbox
entr is is what I eventually settled on after years of searching the perfect utility to build/run tests after file changes. After using gulp, grunt, watching_testrunner (which I eventually inherited maintainership of), watchman, watchdog (https://github.com/gorakhargosh/watchdog), sniffer (https://github.com/jeffh/sniffer) entr is cross-platform on OS X, linux and BSD. watching_testrunner has no BSD support watchman is way too big and not domain specific enough to my needs sniffer worked quite well but it required having a scent.py file everywhere entr keeps it all in a neat, unix like package you can pipe files to. I keep some example usage in my book, The Tao of tmux at https://leanpub.com/the-tao-of-tmux/read#leanpub-auto-file-w.... In this section I demonstrate my workflow with entr(1) in a Makefile. The code I use in the example shou
Read the rest
ld work across OS X / BSD / Linux (note the utilities like find(1) may behave a bit differently across unix-like systems). I use the Makefile w/ entr(1) in development on my projects like tmuxp at https://github.com/tony/tmuxp/blob/master/Makefile. tmuxp is BSD-licensed so you're free to work off that if you'd like to try it on your own project.
In Entr(1) – Run tests whenever files change
Pretty neat! As a suggestion, I would replace also the delimiters "()\{\}[]" with the corresponding left/right versions [1] so LaTeX adjusts automatically the size in the output and I don't have to deal with less readable code missing \left or \right errors. As another tip to make LaTeX typesetting easier, I'd recommend using a custom keyboard distribution to input symbols easily, (e.g., alt + d for δ instead of \delta). In TeX.sx Jon Wickerson published [2] a layout for the british keyboard and the corresponding package to make LaTeX understand the unicode symbols. If you happen to have a spanish keyboard, I made an adaptation of that code [3]. And another thing: if you plan on using pretex a lot, it may be useful to parse the file on save (maybe before compilation). inotify-tools [4] or watchdog (OS X) [5] can help you, it's easy to cre
Read the rest
In Show HN: PreTeX, a LaTeX preprocessor to make math typesetting easier

MAKE YOURSELF AT HOME

A few shortcuts

/
Search the collection
?
Open this guide
Esc
Close dialogs and navigation

Your saved repositories and interests stay in this browser.