Skip to main content

fitscube-rs

Docs docs.rs PyPI crates.io

Documentation for the Python API, CLI and algorithms is at fitscube-rs.readthedocs.io. The Rust API is at docs.rs/fitscube-rs.

A Rust port of the fitscube Python package. It stacks single-frequency or single-time FITS images into a cube, extracts planes from a cube, and compresses cubes with gzip or FITS tile compression (as fpack does). The frequency or time axis comes from the image headers. Per-channel beams go into a CASA BEAMS table.

Note: this is an experiment in LLM-assisted coding with Claude. Do not trust this software as far as you can throw it.

Installation

Python library

pip install fitscube-rs

fitscube_rs.compat has the same API as the Python fitscube package, so code written against fitscube switches by changing its imports. It returns astropy Quantities, so it needs the compat extra:

pip install 'fitscube-rs[compat]'

CLI binary

Requires Rust 1.88+.

cargo install fitscube-rs

Usage

Development

Install in editable mode:

uv pip install -e .

After changing the Python-facing Rust API in src/python.rs, rebuild with the stubgen feature (the default build omits _generate_stubs) and regenerate the type stubs:

uv run maturin develop --features stubgen
uv run --no-sync python -c "from fitscube_rs._fitscube_rs import _generate_stubs; _generate_stubs()"

This rewrites fitscube_rs/_fitscube_rs/__init__.pyi from the Rust signatures and docstrings. Commit it with the API change.

Running tests

Python tests need the compiled extension and the test extra, which includes fitscube for the parity tests. uv sync builds the extension into .venv. uvx pytest does not work, because it runs without the extension.

uv sync --extra test --reinstall-package fitscube-rs   # rebuild after Rust changes
uv run --no-sync pytest

Rust tests run with cargo test:

cargo test

Pre-commit hooks

prek runs the hooks in .pre-commit-config.yaml, the same checks as CI: ruff, ty, cargo fmt and cargo clippy.

uv sync --extra dev   # installs prek + ty into the venv
uvx prek install      # install the git hook (runs on every commit)
uvx prek run --all-files   # run all hooks manually

License

fitscube-rs is released under the BSD 3-Clause License.

It is a port of the fitscube Python package by Alec Thomson (BSD 3-Clause). The tests compare its output with that package. See NOTICE.md for full attributions.

Metadata

Release files for fitscube-rs 2.3.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 fitscube-rs 2.3.0
File Size Uploaded Provenance Actions
fitscube_rs-2.3.0.tar.gz 252.8 kB With provenance Details for fitscube_rs-2.3.0.tar.gz

Built distributions (wheels)

Table of built distributions (wheels) for fitscube-rs 2.3.0
File Interpreter ABI Platform Actions
fitscube_rs-2.3.0-cp310-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl CPython 3.10 abi3 Linux glibc 2.17+ x86-64 Details for fitscube_rs-2.3.0-cp310-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
fitscube_rs-2.3.0-cp310-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl CPython 3.10 abi3 Linux glibc 2.17+ ARM64 Details for fitscube_rs-2.3.0-cp310-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl
fitscube_rs-2.3.0-cp310-abi3-macosx_11_0_arm64.whl CPython 3.10 abi3 macOS 11.0+ ARM64 Details for fitscube_rs-2.3.0-cp310-abi3-macosx_11_0_arm64.whl

Total release size: 4.5 MB

Release files / fitscube_rs-2.3.0.tar.gz

Download URL fitscube_rs-2.3.0.tar.gz
Size 252.8 kB
Tags Source
SHA-256 checksum
How to use checksums
54e9ce538f71b3ee053e9504cc08599ff5208d0d065d774f678c6359a698ef2b
BLAKE2b-256 checksum
How to use checksums
3456d4ae60d79bc58cf1b3e7838d6002b0639112db2df4275d5a1627414b654b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 21, 2026.

Transparency log

Release files / fitscube_rs-2.3.0-cp310-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl

Download URL fitscube_rs-2.3.0-cp310-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Size 1.5 MB
Tags CPython 3.10 Linux glibc 2.17+ x86-64 abi3
SHA-256 checksum
How to use checksums
4f4d648eab39860f40851328037f4d3ec0cceb7c913469f917a53303cb081c80
BLAKE2b-256 checksum
How to use checksums
a2bd19201cb17cd3b72b79435f46ce94fb3e338011f2cbd5f7058c1e096f523e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 21, 2026.

Transparency log

Release files / fitscube_rs-2.3.0-cp310-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl

Download URL fitscube_rs-2.3.0-cp310-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl
Size 1.4 MB
Tags CPython 3.10 Linux glibc 2.17+ ARM64 abi3
SHA-256 checksum
How to use checksums
c343753daa912fcf4af46c355dbc2afbe38df679167ed3e4e1e83d04bfd1e62a
BLAKE2b-256 checksum
How to use checksums
8bbe877930581b1875a5413c3def803d6bd33e70830d4c7c86967f8f0a55fc63
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 21, 2026.

Transparency log

Release files / fitscube_rs-2.3.0-cp310-abi3-macosx_11_0_arm64.whl

Download URL fitscube_rs-2.3.0-cp310-abi3-macosx_11_0_arm64.whl
Size 1.3 MB
Tags CPython 3.10 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
9be9fbd2a6604a44ec1a4f385197355731a2cad4ee6f9a69e87cfbe3f2f6cfa0
BLAKE2b-256 checksum
How to use checksums
c2db2fe85e17d7192a0ae9e8ed162c291cd75af9d8fb8dd4e9e23cc35de7df22
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 21, 2026.

Transparency log

Security for fitscube-rs 2.3.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.

Full provenance

All 4 files in this release have been uploaded with provenance metadata.

Select from 4 files

Attestation for fitscube_rs-2.3.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 21, 2026.

Transparency log

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