Python wrappers and input builders for ATSAS command-line tools.
Project description
pyatsas
pyatsas provides lightweight Python wrappers around ATSAS command-line tools
and small helpers for preparing the input files used by dialog-driven ATSAS
programs.
This package is an independent Python wrapper for ATSAS command-line tools.
ATSAS itself is not distributed with this package and must be installed
separately. pyatsas does not reimplement ATSAS algorithms; it focuses on
making ATSAS calls reproducible from Python code, notebooks, and automated
workflows.
What Is Included
- Command wrappers for ATSAS programs such as
autorg,crysol,dammin,dammif,gnom,bunch,coral,ranch,gajoe,monsa,bodies,ffmaker, and related utilities. - Input builders for interactive ATSAS tools, including MONSA, RANCH/GAJOE, BUNCH, and CORAL.
- Small data-reading helpers for common SAXS output files.
- Unit tests that mock ATSAS execution, so the default test suite can run without ATSAS installed.
ATSAS Dependency
pyatsas does not bundle ATSAS. Importing pyatsas does not require ATSAS, but
calling a wrapper requires the corresponding ATSAS executable to be available in
the process environment.
Wrappers call executables by name, for example autorg, crysol, or coral.
This means the ATSAS binary directory must be on PATH. If an executable is
missing, pyatsas raises AtsasExecutableNotFoundError with the missing program
name and a short troubleshooting message.
Useful ATSAS links:
- ATSAS download and license information: https://www.biosaxs.com/download
- ATSAS software overview: https://biosaxs.com/software.html
- EMBL Hamburg ATSAS page for older academic ATSAS 3.x information: https://www.embl-hamburg.de/biosaxs/download.html
Academic users should follow the registration and licensing instructions on the ATSAS download page. Commercial users should follow the BIOSAXS licensing instructions.
Troubleshooting Missing Executables
Check that ATSAS works from the same shell or environment where Python runs:
autorg --help
On Windows, add the ATSAS installation directory containing the .exe files to
PATH, then restart the terminal, IDE, notebook kernel, or Python session.
You can also check availability from Python:
from pyatsas import require_atsas_executable
require_atsas_executable("autorg")
Installation
For development from a local checkout:
python -m pip install -e .
The Python package depends on numpy and pandas. ATSAS itself must be
installed separately.
Basic Usage
Run a command-style ATSAS wrapper:
from pyatsas import autorg
result = autorg("sample.dat")
print(result["result"])
Build an answer script for an interactive program:
from pyatsas import build_coral_answers_text, write_coral_script_file
script = build_coral_answers_text(
project_name="model",
description="CORAL run from Python",
config_token="config",
use_config=True,
datafile="sample.dat",
)
write_coral_script_file("coral.stdin", text=script)
Run an interactive wrapper by passing a prepared script:
from pyatsas import coral
result = coral(script_path="coral.stdin", cwd="run")
print(result["stdout"])
More examples are collected in
pyatsas/IO_BUILDERS_USAGE.md.
Tests
The default test suite does not require ATSAS:
pytest
ATSAS integration tests are marked with atsas and are skipped by default. Run
them explicitly only in an environment where ATSAS executables are available on
PATH:
pytest -m atsas
Development Notes
- Wrapper functions generally return a dictionary with the tool name, command, return code, stdout, stderr, outputs, and working directory.
- Non-zero ATSAS exits raise
subprocess.CalledProcessError. - Missing input files raise
FileNotFoundError. - Missing ATSAS executables raise
AtsasExecutableNotFoundError. - Dialog/input builders return plain text so generated scripts can be inspected, tested, and version-controlled.
License
pyatsas is distributed under the MIT License. ATSAS is a separate software
package with its own license and must be obtained from the official ATSAS
distribution channels.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pyatsas-0.1.0.tar.gz.
File metadata
- Download URL: pyatsas-0.1.0.tar.gz
- Upload date:
- Size: 40.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
36b551493f83a5e11c4d01427e348d625f09d4337fe0cee07f002f178e9d50ad
|
|
| MD5 |
f85171b243ffeb352108eebf7709541d
|
|
| BLAKE2b-256 |
7870ebdb33e043cc1b37cdbda4d2dbe361662f982ca53f25b1aa79b418ff206f
|
File details
Details for the file pyatsas-0.1.0-py3-none-any.whl.
File metadata
- Download URL: pyatsas-0.1.0-py3-none-any.whl
- Upload date:
- Size: 64.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0de6fcb03706152b011666b3f3c02f5adf67d2162f163c047196deae3512f69c
|
|
| MD5 |
1c5595a8ba0e2be9b18cc64b949c756d
|
|
| BLAKE2b-256 |
99c9e122965c624f9755b672dc19954c64d0a401ffb0ecdb8cc217f604ec437e
|