{"library":"snakemake-interface-storage-plugins","title":"Snakemake Storage Plugin Interface","type":"library","description":"This package provides a stable and consistent interface for developers to build custom storage plugins that integrate with Snakemake. It defines the abstract base classes and helper functions necessary for Snakemake to interact with various storage backends. The current version is 4.4.1, with a release cadence of roughly every 1-3 months, primarily focusing on new features, bug fixes, and compatibility with Snakemake core.","language":"python","status":"active","last_verified":"Sun May 17","install":{"commands":["pip install snakemake-interface-storage-plugins"],"cli":null},"imports":["from snakemake_interface_storage_plugins.storage_provider import StorageProviderBase","from snakemake_interface_storage_plugins.storage_object import StorageObject","from snakemake_interface_storage_plugins.settings import StorageProviderSettingsBase","from snakemake_interface_storage_plugins.registry import StoragePlugin"],"auth":{"required":false,"env_vars":[]},"links":{"homepage":null,"github":"https://github.com/snakemake/snakemake-interface-storage-plugins","docs":null,"changelog":null,"pypi":"https://pypi.org/project/snakemake-interface-storage-plugins/","npm":null,"openapi_spec":null,"status_page":null,"smithery":null},"quickstart":{"code":"from snakemake_interface_storage_plugins.storage_object import StorageObject\nfrom snakemake_interface_storage_plugins.storage_provider import StorageProviderBase\nfrom snakemake_interface_storage_plugins.registry import StoragePlugin\nfrom typing import Optional\n\n# 1. Define your custom StorageObject, implementing required methods\nclass MyMinimalStorageObject(StorageObject):\n    def exists(self) -> bool:\n        # Placeholder: In a real plugin, check if the remote object exists.\n        return True\n\n    def mtime(self) -> float: return 0.0 # Last modified time\n    def size(self) -> int: return 0      # Size in bytes\n    def download_obj(self) -> None: pass # Download object to local path\n    def upload_obj(self) -> None: pass   # Upload local object to remote\n    def list_local_files(self) -> list[str]: return [] # List files in local path\n    def cleanup(self) -> None: pass      # Cleanup temporary files\n\n# 2. Define your custom StorageProvider\nclass MyMinimalStorageProvider(StorageProviderBase):\n    def get_storage_object(self, url: str) -> StorageObject:\n        # Return an instance of your custom StorageObject for the given URL.\n        # 'query' and 'protocol' are typically parsed from the URL.\n        return MyMinimalStorageObject(query=None, protocol=self.name, path=url)\n\n    def example_path(self, protocol: Optional[str] = None) -> str:\n        # Provide an example path for your protocol (e.g., for documentation).\n        return f\"{self.name}://path/to/file.txt\"\n\n    @property\n    def name(self) -> str:\n        # The unique name for your storage protocol (e.g., 's3', 'gcs', 'my-minimal').\n        return \"my-minimal\"\n\n# 3. Register your plugin with Snakemake\n# This makes your plugin discoverable by Snakemake when it parses Snakefiles.\nStoragePlugin(\n    name=\"my-minimal\",\n    storage_provider=MyMinimalStorageProvider,\n    # settings_cls=None # Optionally register a custom settings class\n)\n\nprint(\"Minimal Snakemake storage plugin 'my-minimal' defined and registered.\")\n# To make this plugin active for Snakemake, save this code in a Python file\n# (e.g., my_storage_plugin.py) and ensure it's on your PYTHONPATH or installed\n# as part of a Snakemake extension package.","lang":"python","description":"This quickstart demonstrates the core components required to implement a minimal Snakemake storage plugin. You need to define a `StorageObject` (representing a file/directory on your custom storage) and a `StorageProviderBase` (which provides `StorageObject` instances). Finally, register your plugin using `StoragePlugin` to make it discoverable by Snakemake.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":{"tag":null,"tag_description":null,"last_tested":"2026-05-17","installed_version":"1.1.2","pypi_latest":"4.4.1","is_stale":true,"summary":{"python_range":"3.10–3.9","success_rate":100,"avg_install_s":2.2,"avg_import_s":0.25,"wheel_type":"wheel"},"results":[{"runtime":"python:3.10-alpine","python_version":"3.10","os_libc":"alpine (musl)","variant":"snakemake-interface-storage-plugins","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":null,"import_time_s":0.12,"mem_mb":5.4,"disk_size":"20.4M"},{"runtime":"python:3.10-slim","python_version":"3.10","os_libc":"slim (glibc)","variant":"snakemake-interface-storage-plugins","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":2.3,"import_time_s":0.09,"mem_mb":5.4,"disk_size":"21M"},{"runtime":"python:3.11-alpine","python_version":"3.11","os_libc":"alpine (musl)","variant":"snakemake-interface-storage-plugins","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":null,"import_time_s":0.22,"mem_mb":6.8,"disk_size":"22.5M"},{"runtime":"python:3.11-slim","python_version":"3.11","os_libc":"slim (glibc)","variant":"snakemake-interface-storage-plugins","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":2.3,"import_time_s":0.19,"mem_mb":6.8,"disk_size":"23M"},{"runtime":"python:3.12-alpine","python_version":"3.12","os_libc":"alpine (musl)","variant":"snakemake-interface-storage-plugins","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":null,"import_time_s":0.43,"mem_mb":9.1,"disk_size":"14.3M"},{"runtime":"python:3.12-slim","python_version":"3.12","os_libc":"slim (glibc)","variant":"snakemake-interface-storage-plugins","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":2,"import_time_s":0.39,"mem_mb":9.1,"disk_size":"15M"},{"runtime":"python:3.13-alpine","python_version":"3.13","os_libc":"alpine (musl)","variant":"snakemake-interface-storage-plugins","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":null,"import_time_s":0.46,"mem_mb":9.4,"disk_size":"14.1M"},{"runtime":"python:3.13-slim","python_version":"3.13","os_libc":"slim (glibc)","variant":"snakemake-interface-storage-plugins","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":2,"import_time_s":0.38,"mem_mb":9.4,"disk_size":"15M"},{"runtime":"python:3.9-alpine","python_version":"3.9","os_libc":"alpine (musl)","variant":"snakemake-interface-storage-plugins","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":null,"import_time_s":0.13,"mem_mb":5.3,"disk_size":"18.8M"},{"runtime":"python:3.9-slim","python_version":"3.9","os_libc":"slim (glibc)","variant":"snakemake-interface-storage-plugins","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":2.6,"import_time_s":0.11,"mem_mb":5.3,"disk_size":"19M"}]}}