{"id":23247,"library":"annexremote","title":"AnnexRemote","description":"A Python library to implement git-annex external special remotes. It provides a base class that handles the protocol between git-annex and the remote, making it easy to develop custom remotes. Current version: 1.6.6. Release cadence: irregular, latest release August 2024.","status":"active","version":"1.6.6","language":"python","source_language":"en","source_url":"https://github.com/Lykos153/AnnexRemote","tags":["git-annex","special-remote","external-remote"],"install":[{"cmd":"pip install annexremote","lang":"bash","label":"Default install"}],"dependencies":[],"imports":[{"note":"","wrong":null,"symbol":"AnnexRemote","correct":"from annexremote import AnnexRemote"},{"note":"RemoteError is exported directly from annexremote since v1.4.","wrong":"from annexremote.exception import RemoteError","symbol":"RemoteError","correct":"from annexremote import RemoteError"}],"quickstart":{"code":"import os\nfrom annexremote import AnnexRemote\n\nclass MyRemote(AnnexRemote):\n    def initremote(self, kwargs):\n        pass\n    def prepare(self, kwargs):\n        pass\n    def transfer_store(self, key, path, progress_callback=None):\n        pass\n    def transfer_retrieve(self, key, path, progress_callback=None):\n        pass\n    def checkpresent(self, key):\n        return False\n    def remove(self, key):\n        pass\n\nremote = MyRemote()\nremote.listen()","lang":"python","description":"Minimal custom remote that listens for git-annex commands."},"warnings":[{"fix":"Upgrade to Python 3 or pin annexremote<1.6.0","message":"Python 2 support dropped in v1.6.0. If you are using Python 2, pin to annexremote<1.6.0.","severity":"breaking","affected_versions":">=1.6.0"},{"fix":"Always call `.listen()` on the remote object to start communicating with git-annex.","message":"Initializing the remote with `remote = MyRemote()` does not automatically set up the protocol; you must call `remote.listen()` after instantiation.","severity":"gotcha","affected_versions":"all"},{"fix":"Use `progress_callback(bytes_transferred)` where bytes_transferred is the cumulative bytes processed so far.","message":"In `transfer_store` and `transfer_retrieve`, the `progress_callback` should be called with the number of bytes transferred, not the total size. Common mistake: calling `progress_callback(total)` instead of incremental bytes.","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 annexremote","cause":"annexremote is not installed or not in the Python environment.","error":"ModuleNotFoundError: No module named 'annexremote'"},{"fix":"Ensure your class inherits from annexremote.AnnexRemote and does not override __init__ without calling super().__init__().","cause":"The custom remote class does not inherit from AnnexRemote or does not call `super().__init__()`.","error":"AttributeError: 'MyRemote' object has no attribute 'listen'"},{"fix":"Use: from annexremote import RemoteError","cause":"Incorrect import path; RemoteError is exported from annexremote directly.","error":"ImportError: cannot import name 'RemoteError' from 'annexremote.exception'"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}