{"id":13733032,"url":"https://github.com/brentp/slurmpy","last_synced_at":"2025-04-03T02:09:30.455Z","repository":{"id":53130624,"uuid":"36086888","full_name":"brentp/slurmpy","owner":"brentp","description":"submit jobs to slurm with quick-and-dirty python ","archived":false,"fork":false,"pushed_at":"2023-01-03T22:49:42.000Z","size":15,"stargazers_count":95,"open_issues_count":7,"forks_count":34,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-03-24T08:09:26.686Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/brentp.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-05-22T17:49:14.000Z","updated_at":"2024-12-09T21:34:36.000Z","dependencies_parsed_at":"2023-02-01T12:16:59.366Z","dependency_job_id":null,"html_url":"https://github.com/brentp/slurmpy","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brentp%2Fslurmpy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brentp%2Fslurmpy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brentp%2Fslurmpy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brentp%2Fslurmpy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/brentp","download_url":"https://codeload.github.com/brentp/slurmpy/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246922247,"owners_count":20855345,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-03T03:00:36.910Z","updated_at":"2025-04-03T02:09:30.430Z","avatar_url":"https://github.com/brentp.png","language":"Python","funding_links":[],"categories":["SLURM wrappers and libraries"],"sub_categories":[],"readme":"quick and dirty lib for submitting jobs to slurm via python2/python3.\n\n```Python\nfrom slurmpy import Slurm\n\ns = Slurm(\"job-name\", {\"account\": \"my-account\", \"partition\": \"my-parition\"})\ns.run(\"\"\"\ndo\nlots\nof\nstuff\n\"\"\")\n\n```\n\nThe above will submit the job to `sbatch` automatically write the script to `scripts/`\nand automatically write logs/{name}.err and logs/{name}.out. It will have today's\ndate in the log and script names.\n\nThe script to run() can also contain `$variables` which are filled with the cmd_kwarg dict.\nE.g. `echo $name` could be filled with `cmd_kwargs={'name': 'sally'}`\n\nA command can be tested (not sent to queue) by setting the `_cmd` are to `run` as e.g. \"ls\".\nThe default is `sbatch` which submits jobs to slurm.\n\nDependencies\n============\n\nEach time `slurmpy.Slurm().run()` is called, it returns the job-id of the submitted job. One or more\nof these can be provided as arguments to a subsequent job:\n```\ns = Slurm()\ns.run(..., depends_on=[job_id])\n# or for multiple dependencies\ns.run(..., depends_on=[job_id_1, job_id_2, job_id_3])\n\n```\nto indicate that this job should not run until the the job with `job_id` (or ids `job_id_1-3`) has finished successfully.\n\nAdditionally, SLURM allows you to define how a job depends on previous jobs e.g. should it run \nonly on success or always etc. For this `slurmpy.Slurm().run()` provides an additional argument `depends_how`:\n\n```\ns = Slurmp()\ns.run(..., depends_on=[job_id], depends_how='afterany')\n```\ncurrently supported are the following options with \"afterok\" as default: \n\"after\", \"afterany\", \"afterburstbuffer\", \"aftercorr\", \"afternotok\", \"afterok\", \"expand\"\nMore details can be found here: https://slurm.schedmd.com/sbatch.html in the `--dependency` section.\n\nInstall\n=======\n\n```Shell\npip install slurmpy --user\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbrentp%2Fslurmpy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbrentp%2Fslurmpy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbrentp%2Fslurmpy/lists"}