{"id":24213,"library":"patchwork","title":"Patchwork","description":"Patchwork is a deployment and system administration library, powered by Fabric. It provides a set of functions for common operations like file transfer, directory management, and package management. Current version 1.0.1, released last in 2014; library is in maintenance mode (no updates since).","status":"maintenance","version":"1.0.1","language":"python","source_language":"en","source_url":"https://github.com/fabric/patchwork","tags":["deployment","sysadmin","fabric","ssh","file-transfer"],"install":[{"cmd":"pip install patchwork","lang":"bash","label":"Install via pip"}],"dependencies":[{"reason":"Core dependency; patchwork uses Fabric's Connection for remote execution","package":"fabric","optional":false}],"imports":[{"note":"rsync is in patchwork.transfers submodule, not top-level.","wrong":"from patchwork import rsync","symbol":"patchwork.transfers","correct":"from patchwork.transfers import rsync, download, upload"},{"note":"","wrong":"","symbol":"patchwork.files","correct":"from patchwork.files import exists, is_link, read_link"}],"quickstart":{"code":"from fabric import Connection\nfrom patchwork.transfers import rsync\n\nc = Connection('user@host')\nrsync(c, '/local/path/', '/remote/path/')","lang":"python","description":"Example using Fabric Connection and patchwork's rsync function."},"warnings":[{"fix":"Use from fabric import Connection then Connection('host'). Refer to patchwork docs.","message":"patchwork functions expect a `fabric.connection.Connection` object, not an old-style `env.host_string`. Using the deprecated API will fail.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Pin fabric<3 in your requirements.","message":"patchwork has not been updated since 2014 and does not support Fabric 3 (which is incompatible). It works with Fabric 2.x only.","severity":"deprecated","affected_versions":"all"},{"fix":"Use `fabric.runners.Sudo` or set `c.sudo()` before calling patchwork functions.","message":"The `patchwork.files` functions like `exists` and `is_link` often require sudo on remote hosts; failing to wrap in sudo will give Permission denied.","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Run `pip install patchwork` in the same Python environment.","cause":"patchwork not installed or installed in wrong environment.","error":"ModuleNotFoundError: No module named 'patchwork'"},{"fix":"Use `from patchwork.transfers import rsync` instead.","cause":"Trying to import rsync directly from patchwork instead of submodule.","error":"AttributeError: module 'patchwork' has no attribute 'rsync'"},{"fix":"Pass a Fabric Connection as first argument, e.g., rsync(conn, '/src/', '/dst/').","cause":"Calling rsync without a connection object (old-style usage).","error":"TypeError: rsync() missing 1 required positional argument: 'c'"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}