async-siril
Async Siril is an asyncio based python wrapper around Siril 1.4.0 used for processing astronomy data for astrophotography and science. The library provides a pythonic interface to the Siril command line interface and all of it's commands. Scripts, processes, and workflows can be built with modern async python.
Features
- async/await based using asyncio
- code generated Siril commands from free-astro/siril-doc
- logging with structlog
- example CLI commands built for calibration, registration & stacking workflows examples
- some helpers for common logic (see
async_siril.helpers) - minimal dependencies (
asyncio,structlog,psutil) - Linux, Mac, & Windows support
- Docker support (see Dockerfile.siril)
- 93% test coverage
Requirements
- Siril installed on your system (https://www.siril.org/)
- Python 3.12 or higher
- uv or pip
Installation
uv add async-siril
# OR
pip install async-siril
Usage
Here is a simple example of how to create a master bias using the library:
import asyncio
import pathlib
from async_siril import SirilCli
from async_siril.command import setext, set32bits, convert, stack
from async_siril.command_types import fits_extension
async def main():
current_dir = pathlib.Path(__file__).parent
async with SirilCli(directory=current_dir) as siril:
await siril.command(setext(fits_extension.FITS_EXT_FIT))
await siril.command(set32bits())
await siril.command(convert("bias"))
await siril.command(stack("bias", out="bias_master"))
if __name__ == "__main__":
asyncio.run(main())
For advanced use cases you can run the Siril commands directly as strings.
from async_siril import SirilCli
async def main():
async with SirilCli() as siril:
await siril.command("setext fits")
await siril.command("set32bits")
await siril.command("convert bias")
await siril.command("stack bias bias_master")
if __name__ == "__main__":
asyncio.run(main())
By default, any command that fails will throw an exception and shut things down. If you want to catch these types of errors and try again or handle a different way you can use the failable_command method.
from async_siril import SirilCli
async def main():
async with SirilCli() as siril:
await siril.command("setext fits")
await siril.command("set32bits")
await siril.command("convert bias")
result = await siril.failable_command("stack bias bias_master")
if not result:
print("Stack failed, make a change and try again")
if __name__ == "__main__":
asyncio.run(main())
Docker (example only)
You can use the example Dockerfile.siril to build a docker image with Siril installed. This is useful for running the examples or for running Siril commands in a container.
docker build -f Dockerfile.siril -t async-siril:latest .
Once built you can test the interface with this (runs uv run ./examples/test_siril.py):
docker run --rm -it --name siril-test async-siril:latest
Roadmap
Please see ROADMAP.md for more details.
Contributing
PRs are welcome & appreciated! See the contributing guide to get started.
FAQ
Why not use pysiril?
pysiril is a great library for interacting with Siril. However, it is not asyncio based and does not provide a pythonic interface to the Siril command line interface.
Siril just added python scripting, how is this different?
The new python scripting added to Siril is a great improvement for in-app scripts. However, sometimes you just need a simple interface for headless operations of Siril.
Acknowledgements
Siril is a fantastic piece of software and I am grateful to the free-astro team for their hard work. Special thanks to Vincent for answering questions and providing support.
License
async-siril is licensed under:
- BSD-3-Clause license (LICENSE or https://opensource.org/licenses/BSD-3-Clause)
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in async-siril by you, as defined in the BSD-3-Clause license, shall be dually licensed as above, without any additional terms or conditions.
Metadata
Release files for async-siril 0.4.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| async_siril-0.4.0.tar.gz | 120.1 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| async_siril-0.4.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 182.3 kB
Release files / async_siril-0.4.0.tar.gz
| Download URL | async_siril-0.4.0.tar.gz |
|---|---|
| Size | 120.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
7a55c48f4f1abe9b99d430d3789028a6a5ae065fe1d27940be7c91fd3423442a
|
|
BLAKE2b-256 checksum How to use checksums |
5a18f5f30a589fb342d1dc15d7e60257521988c979d6a9ca1980ca86ce8107b9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.9.15 {"installer":{"name":"uv","version":"0.9.15","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|
Release files / async_siril-0.4.0-py3-none-any.whl
| Download URL | async_siril-0.4.0-py3-none-any.whl |
|---|---|
| Size | 62.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
19708e26e272ed755eff0dd6d968930b4d679f94e52e96cd18036dbc7cccf072
|
|
BLAKE2b-256 checksum How to use checksums |
ceb8a5b7eaf30409a34fa72c11c9a4242b9d568e9405619826d7081aa9d49d54
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.9.15 {"installer":{"name":"uv","version":"0.9.15","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|