Metadata-Version: 2.1
Name: pyslurmutils
Version: 0.2.0
Summary: SLURM utilities for Python
Home-page: https://gitlab.esrf.fr/workflow/pyslurmutils/
Author: ESRF
Author-email: wout.de_nolf@esrf.fr
License: MIT
Project-URL: Source, https://gitlab.esrf.fr/workflow/pyslurmutils/
Project-URL: Documentation, https://pyslurmutils.readthedocs.io/
Project-URL: Tracker, https://gitlab.esrf.fr/workflow/pyslurmutils/issues/
Classifier: Intended Audience :: Science/Research
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Requires-Python: >=3.7
Description-Content-Type: text/markdown
License-File: LICENSE.md
Requires-Dist: requests
Requires-Dist: tblib
Requires-Dist: tabulate
Requires-Dist: importlib_resources; python_version < "3.9"
Requires-Dist: importlib_metadata; python_version < "3.8"
Provides-Extra: test
Requires-Dist: pytest>=7; extra == "test"
Provides-Extra: dev
Requires-Dist: pytest>=7; extra == "dev"
Requires-Dist: black>=22; extra == "dev"
Requires-Dist: flake8>=4; extra == "dev"
Provides-Extra: doc
Requires-Dist: pytest>=7; extra == "doc"
Requires-Dist: sphinx>=4.5; extra == "doc"
Requires-Dist: sphinx-autodoc-typehints>=1.16; extra == "doc"
Requires-Dist: pydata-sphinx-theme<0.15; extra == "doc"

# pyslurmutils

SLURM utilities for scheduling jobs from Python.

The main purpose of this library is to provide a `concurrent.futures.Executor`
implementation for SLURM which can be used on any machine, not necessarily a SLURM client.

```bash
pip install pyslurmutils
```

```python
from pyslurmutils.concurrent.futures import SlurmRestExecutor

with SlurmRestExecutor(
    url=url,                        # SLURM REST URL
    user_name=user_name,            # SLURM user name
    token=token,                    # SLURM access token
    log_directory="/path/to/log",   # for log files (optional)
    data_directory="/path/to/data", # TCP communication when not provided
    pre_script="module load ewoks", # load environment (optional)
    parameters={"time_limit": 120}  # SLURM job parameters (optional)
    python_cmd="python",            # python command (python3 by default)
) as executor:
    future = executor.submit(sum, [1, 1])
    assert future.result() == 2
```

## Documentation

https://pyslurmutils.readthedocs.io/
