{"library":"snakemake","title":"Snakemake Workflow Management System","type":"library","description":"Snakemake is a Python-based workflow management system designed to create reproducible and scalable data analyses. It enables writing workflows in a Python-like DSL called Snakefile, allowing for automatic parallelization, dependency tracking, and execution on various platforms. The current version is 9.19.0, with frequent patch releases and major feature updates typically every few months.","language":"python","status":"active","last_verified":"Mon May 18","install":{"commands":["pip install snakemake"],"cli":{"name":"snakemake","version":"9.21.0"}},"imports":["from snakemake.api import SnakemakeApi"],"auth":{"required":false,"env_vars":[]},"links":{"homepage":"https://snakemake.github.io","github":"https://github.com/snakemake/snakemake","docs":"https://snakemake.readthedocs.io","changelog":null,"pypi":"https://pypi.org/project/snakemake/","npm":null,"openapi_spec":null,"status_page":null,"smithery":null},"quickstart":{"code":"import os\n\n# Create a dummy Snakefile for demonstration\nsnakefile_content = \"\"\"\nrule all:\n    input: \"results/final.txt\"\n\nrule prepare_data:\n    output: \"data/input.txt\"\n    shell: \"mkdir -p data && echo 'Hello, Snakemake!' > {output}\"\n\nrule process_data:\n    input: \"data/input.txt\"\n    output: \"results/processed.txt\"\n    shell: \"mkdir -p results && cat {input} | tr 'A-Z' 'a-z' > {output}\"\n\nrule analyze_results:\n    input: \"results/processed.txt\"\n    output: \"results/final.txt\"\n    shell: \"echo 'Analysis complete for: ' $(cat {input}) > {output}\"\n\"\"\"\n\nwith open(\"Snakefile\", \"w\") as f:\n    f.write(snakefile_content)\n\nprint(\"Snakefile created. Running workflow...\")\n\n# To run this, you would typically use the command line:\n# snakemake -c 1\n# Or for programmatic execution (more complex, but possible):\n# from snakemake.api import SnakemakeApi\n# snakemake_runner = SnakemakeApi(\n#    snakefile='Snakefile',\n#    target_files=['results/final.txt'],\n#    cores=1\n# )\n# success = snakemake_runner.execute()\n# print(f\"Workflow execution {'succeeded' if success else 'failed'}\")\n\n# Clean up example files (optional)\n# import shutil\n# if os.path.exists(\"data\"): shutil.rmtree(\"data\")\n# if os.path.exists(\"results\"): shutil.rmtree(\"results\")\n# if os.path.exists(\"Snakefile\"): os.remove(\"Snakefile\")\n","lang":"python","description":"Create a `Snakefile` (the workflow definition) and then execute it using the `snakemake` command-line tool. The example generates a simple file processing workflow and shows how the workflow rules are defined. To run the workflow, execute `snakemake -c 1` in your terminal in the same directory as the Snakefile.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":{"tag":null,"tag_description":null,"last_tested":"2026-05-18","installed_version":"9.21.0","pypi_latest":"9.21.0","is_stale":false,"summary":{"python_range":"3.10–3.9","success_rate":60,"avg_install_s":10.9,"avg_import_s":2,"wheel_type":"sdist"},"results":[{"runtime":"python:3.10-alpine","python_version":"3.10","os_libc":"alpine (musl)","variant":"snakemake","exit_code":1,"wheel_type":null,"failure_reason":"build_error","import_side_effects":null,"install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":null},{"runtime":"python:3.10-slim","python_version":"3.10","os_libc":"slim (glibc)","variant":"snakemake","exit_code":1,"wheel_type":null,"failure_reason":"build_error","import_side_effects":null,"install_time_s":12.2,"import_time_s":null,"mem_mb":null,"disk_size":null},{"runtime":"python:3.11-alpine","python_version":"3.11","os_libc":"alpine (musl)","variant":"snakemake","exit_code":0,"wheel_type":"sdist","failure_reason":null,"import_side_effects":"noisy","install_time_s":null,"import_time_s":2.13,"mem_mb":38.2,"disk_size":"130.7M"},{"runtime":"python:3.11-slim","python_version":"3.11","os_libc":"slim (glibc)","variant":"snakemake","exit_code":0,"wheel_type":"sdist","failure_reason":null,"import_side_effects":"clean","install_time_s":11.4,"import_time_s":1.96,"mem_mb":38.2,"disk_size":"129M"},{"runtime":"python:3.12-alpine","python_version":"3.12","os_libc":"alpine (musl)","variant":"snakemake","exit_code":0,"wheel_type":"sdist","failure_reason":null,"import_side_effects":"noisy","install_time_s":null,"import_time_s":2.09,"mem_mb":37.7,"disk_size":"119.0M"},{"runtime":"python:3.12-slim","python_version":"3.12","os_libc":"slim (glibc)","variant":"snakemake","exit_code":0,"wheel_type":"sdist","failure_reason":null,"import_side_effects":"clean","install_time_s":10.5,"import_time_s":2.04,"mem_mb":37.7,"disk_size":"117M"},{"runtime":"python:3.13-alpine","python_version":"3.13","os_libc":"alpine (musl)","variant":"snakemake","exit_code":0,"wheel_type":"sdist","failure_reason":null,"import_side_effects":"noisy","install_time_s":null,"import_time_s":1.88,"mem_mb":39,"disk_size":"118.6M"},{"runtime":"python:3.13-slim","python_version":"3.13","os_libc":"slim (glibc)","variant":"snakemake","exit_code":0,"wheel_type":"sdist","failure_reason":null,"import_side_effects":"clean","install_time_s":10.7,"import_time_s":1.9,"mem_mb":39,"disk_size":"117M"},{"runtime":"python:3.9-alpine","python_version":"3.9","os_libc":"alpine (musl)","variant":"snakemake","exit_code":1,"wheel_type":null,"failure_reason":"build_error","import_side_effects":null,"install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":null},{"runtime":"python:3.9-slim","python_version":"3.9","os_libc":"slim (glibc)","variant":"snakemake","exit_code":1,"wheel_type":null,"failure_reason":"build_error","import_side_effects":null,"install_time_s":13.6,"import_time_s":null,"mem_mb":null,"disk_size":null}]}}