spython
Command line python tool for working with singularity.
What it is and what it does
spython is a Python wrapper around the Singularity container runtime, allowing you to build, run, and manage Singularity containers from Python scripts and applications. It provides a programmatic interface to Singularity operations that would otherwise require shell commands, making it useful for automation, CI/CD pipelines, and scientific workflows that need to orchestrate containerized workloads.
The package has no external Python dependencies, making installation lightweight. It requires Singularity > 3.5.2 to be installed on the host system and will not work with Singularity 2.x. The library is actively maintained, though releases are infrequent; the last release was in September 2024.
Use it for:
- Automate Singularity container builds and execution within Python-based scientific workflows or batch processing systems.
- Build CI/CD pipelines that programmatically manage container images without shell scripting.
- Integrate container management into Python applications that need to spawn and monitor Singularity containers.
- Orchestrate multi-container experiments in high-performance computing environments from Python code.
- Wrap Singularity operations in Python libraries to provide a unified interface to containerized tools.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
spython is a Python API for programmatically managing Singularity containers, letting you build, run, and interact with container images from Python code.
Yes, if you need to programmatically manage Singularity containers from Python and have Singularity > 3.5.2 installed. The package has no Python dependencies, is actively maintained, and carries no known vulnerabilities. The main caveat is the unclear license classification—verify the LICENSE file before use in proprietary projects. The infrequent release cycle is typical for stable, mature tools.
Install
spython on PyPI
pip
pip install spythonuv
uv add spythonpoetry
poetry add spythonInstalling spython
Before you install
Installation is straightforward with no runtime dependencies. The package is actively maintained with a recent commit history, though the last release was nearly two years ago; the repository remains active and is not archived.
License in practice
The license treatment is unclear in the fact sheet; the raw LICENSE file is present but SPDX classification is not available. You should review the LICENSE file directly before adopting the package in a commercial or proprietary context.
Quickstart
pip install spython
from spython.main import Client
# Build a container from a recipe
Client.build('Singularity.def')
# Run a container
Client.run('mycontainer.sif', ['echo', 'hello'])
Requires Singularity > 3.5.2 to be installed on the system; Singularity 2.x is not supported.
Verify before relying
- Whether the package works with modern Python versions (requires_python is unspecified in the fact sheet).
- Current status of the project beyond the archived flag—whether active development is ongoing or maintenance-only.
Package facts
| License | LICENSE (unclear) |
| Python support | not specified |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | none |
| Maintenance | actively maintained — 698 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 3,029,271/month — #2,780 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: spython-0.3.14-py3-none-any.whl
Keywords: singularity, python, client, (spython)
Tags
More Software Development packages
Provides backported and experimental type hints…
permissive · top 100 on PyPI
numpyNumPy provides an N-dimensional array object…
permissive · top 100 on PyPI
fastapiFastAPI is a Python web framework for building…
permissive · top 100 on PyPI
annotated-docProvides a way to document function parameters,…
permissive · top 100 on PyPI
typerTyper builds command-line applications from…
permissive · top 1,000 on PyPI
distlibDistlib provides low-level packaging utilities…
permissive · top 1,000 on PyPI
apache-airflow-providers-singularityIntegrates Singularity container runtime with…
permissive · top 15,000 on PyPI
docker-pyA Python client library that lets you control…
permissive · top 5,000 on PyPI
dockerA Python library that lets you programmatically…
permissive · top 1,000 on PyPI
tox-dockerA tox plugin that manages Docker container…
permissive · top 15,000 on PyPI
pytest-containerA pytest plugin that automates container…
copyleft · top 15,000 on PyPI
python-magnumclientPython bindings and command-line tool for the…
permissive · top 15,000 on PyPI
slackA dependency injection container that registers…
permissive · top 15,000 on PyPI
punqPunq is a dependency injection container for…
unclear · top 15,000 on PyPI
prefect-dockerProvides Docker task execution and container…
permissive · top 5,000 on PyPI
container-inspectorAnalyzes Docker images, containers, and virtual…
permissive · top 15,000 on PyPI