Skip to main content

SbatchPy

PyPI Version PyPI Downloads

A python package that allows easy sbatch job script creation and submissions on hpc clusters, directly from python.

Installation

# to install latest PyPI release
pip install sbatchpy

# to install latest GitHub commit
pip install --upgrade git+https://github.com/killiansheriff/sbatchpy

Usage

An example on how to run a python script called my_script.py taking 2 arguments var1 and var2 as inputs, and using the base environement is provided below. A complete example with outputs can be found here.

from sbatchpy import run

config = {
    "mem": "1gb",
    "time": "00:01:00",
    "account": "myaccount",
    "cpus-per-task": "5",
    "partition": "shared",
    "ntasks-per-node": "1",
    "nodes": "1",
}

for var1, var2 in zip([1, 2, 3], ["A", "B", "C"]):

    config["job-name"] = f"myjob_{var1}var1_{var2}var2.sh"
    config["output"] = f"out/myjob_{var1}var1_{var2}var2.out"
    run(
        config,
        code=f"source activate base \n python my_script.py {var1} {var2}",
    )

By default, sbatchpy will check that config["output"]'s directory folder exists. If it doesn't, you will be notified and the job will not run.

Additionally, each sbatch submission script is saved inside the f"{os.getcwd()}/.job" folder. Another saving folder can be chosen by passing job_directory=my_saving_directory_path to the run function which is responsible of creating the submission script and running it using sbatch job_directory/config["job-name"].

Metadata

Release files for sbatchpy 1.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for sbatchpy 1.0.0
File Size Uploaded Provenance Actions
sbatchpy-1.0.0.tar.gz 2.8 kB Without provenance Details for sbatchpy-1.0.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for sbatchpy 1.0.0
File Interpreter ABI Platform Actions
sbatchpy-1.0.0-py3-none-any.whl Python 3 none any Details for sbatchpy-1.0.0-py3-none-any.whl

Total release size: 5.8 kB

Release files / sbatchpy-1.0.0.tar.gz

Download URL sbatchpy-1.0.0.tar.gz
Size 2.8 kB
Tags Source
SHA-256 checksum
How to use checksums
54a4ebaabd90ec7e7a93441c5124cbe9a5d8ebafb7b77ac488f9193facf3645a
BLAKE2b-256 checksum
How to use checksums
1791b7f0e1e6d2364f6adf7a55373c8a6027cb114ff78666bcf81cd9c300f277
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.9.17

Release files / sbatchpy-1.0.0-py3-none-any.whl

Download URL sbatchpy-1.0.0-py3-none-any.whl
Size 3.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
da7424c0dd9f1d1086c57c7e89621f1792ede29c12ae61a41429b3f945afa321
BLAKE2b-256 checksum
How to use checksums
3e0bc4ff3b250c98a6875c2ac3b7bf30af9e7ec102b2395588b9162a86237a0f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.9.17

Security for sbatchpy 1.0.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page