Package: mendeley-watchdog
Mendeley WatchdogMendeley Watchdog is a command line utility that continuously watches the last
modification time of a given files and writes the content to a specified file.WARNINGThe contents of the specified destination file are not checked
checked before they are overwritten. Therefore the contents of
the destination file will always be overwritten after the first
"check". All manual changes to the destination file will always
be overwritten when a change to the source file was detected.WARNINGThe file contents are read and written in binary mode, as of
right now this behavior can not be changed. This may be changed
in future versions of this software.The motivation for this software arose from the need to be able to save BibTeX
files that are managed byMendeley Desktopto LaTeX project
directories. While Mendeley does support creating BibTeX files on a per-project
basis it does not allow setting specific directories to which the individual
files are saved. They are all written to the same directory. This softwareThe first (an so far only) entry point for the software fulfills that need by
making it possible to mirror one of these files to any writable destination.
Since I write LaTeX using Visual Studio Code I wanted to be able to run the
monitoring process whenever the workspace folder for a project is open. Luckily
VS Code makes it possible to configure arbitrary tasks for a given workspace.
Themendeley-watchdogentry point was designed with this use-case in mind, an
exemplary task could look like this:{
    "label": "Mirror hhn-it-systems",
    "type": "shell",
    "command": "mendeley-watchdog",
    "runOptions": {"runOn": "folderOpen"},
    "problemMatcher": ["$eslint-compact"],
    "args": [
        "--mendeley-bibtex",
        "'R:\\Mendeley Library\\.bib'",
        "hhn-it-systems.bib",
        "resources/references.bib"
    ]
}The above task launchesmendeley-watchdogas soon as the containing
workspace folder is opened. The task continuously mirrors the fileR:\Mendeley Library.bib\hhn-it-systems.bibasreferences.bibto the
workspace subdirectoryresources. Refer to thedocumentationfor a
more detailed explanation of the entry point and task.InstallationThe above-mentioned VS Code task assumes the entry point is on PATH. An easy
way to achieve this is installing viapipxwhich isolates the
package in its own virtual environment exposes their entry points on PATH.pipx install mendeley-watchdogAlternatively install usingpip install mendeley-watchdogDocumentationThe detaileddocumentation for mendeley-watchdogcan be found on
GitHub. Be aware that the above link points to the master branch. If you're
reading this on PyPI that means it might be outdated. In that case use theDocumentationURL from the sidebar which should point towards the latest
release docs.Further DevelopmentDepending on usefulness (and reception) additional functionality may be added.
Ideas include:enable mirroring any single file (not just bib files)allow mirroring a single watched file to multiple destinationsenable mirroring a map of files and destinationsFeel free toopen an issueif you encountered bugs or have other
ideas that aren't yet listed in thebacklog.