This release is a pre-release and may not be stable for production use.
torchfits
FITS I/O for PyTorch: read and write FITS as tensors and tables — cutouts, predicate filters, and a shell CLI (C++ engine, vendored CFITSIO).
Prebuilt binary wheels for Python 3.10–3.14 across PyTorch 2.11, 2.12, and 2.13 on Linux (x86_64, aarch64) and macOS (Apple Silicon arm64) with vendored CFITSIO.
Docs: stable · edge (main tip)
Install
pip install torchfits
Prebuilt wheels automatically enable GPU acceleration (CUDA on Linux, MPS on macOS) when available, or fall back to CPU. For CPU-only installs, custom CUDA builds, or existing PyTorch 2.11/2.12 environments, see the Installation guide.
At a glance
| Task | API |
|---|---|
| Image → tensor | torchfits.read_tensor("img.fits", device="cuda") |
| Write a tensor | torchfits.write("out.fits", tensor) |
| Filter a catalog | torchfits.table.read(..., where="MAG < 20") |
| Columns as tensors | torchfits.table.read_torch(..., where=...) |
| Open a MEF | with torchfits.open("mef.fits") as hdul: … |
| Train | FitsImageDataset + make_loader(..., num_workers=4) |
| Shell | torchfits info / header / convert / cutout / … |
Quick start
import torchfits
tensor = torchfits.read_tensor("image.fits", hdu=0, device="cpu")
table = torchfits.table.read(
"catalog.fits",
columns=["RA", "DEC", "MAG_G"],
where="MAG_G < 20.0",
)
torchfits info science.fits
torchfits convert catalog.fits out.parquet --hdu 1
torchfits cutout 'science.fits[100:256,100:256]' cutout.fits
Learn more
| Documentation | Quick start, Python workflows, API, CLI |
| Python workflows | Which API for images, tables, cutouts, training |
| Examples | Runnable scripts + transform plots |
| Benchmarks | Methodology and scorecards |
| Changelog | Release notes |
Develop
Pixi-first (do not use bare python for project work):
git clone https://github.com/astroai/torchfits.git
cd torchfits
pixi install
pixi run preflight-push # fast gate while editing
pixi run test # full unit suite
pixi run ci-local # pre-push parity
Agent conventions: AGENTS.md. Release process: docs/release.md.
License
Release files for torchfits 1.1.0b1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distributions (wheels)
Total release size: 16.6 MB
Release files / torchfits-1.1.0b1-cp314-cp314-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
| Download URL | torchfits-1.1.0b1-cp314-cp314-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl |
|---|---|
| Size | 1.2 MB |
| Tags | CPython 3.14 Linux glibc 2.27+ x86-64 Linux glibc 2.28+ x86-64 |
|
SHA-256 checksum How to use checksums |
8ad6f3041bcb0b0b88a060c3278281ea457b73c57f2fc50acf27a6857e3dc4b6
|
|
BLAKE2b-256 checksum How to use checksums |
b221e48c427c85bbd75a9e2f4add2225ce979a69771ba8d4ad5753eb10e3cc37
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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 Aug 23, 2026.
Transparency logRelease files / torchfits-1.1.0b1-cp314-cp314-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl
| Download URL | torchfits-1.1.0b1-cp314-cp314-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl |
|---|---|
| Size | 1.1 MB |
| Tags | CPython 3.14 Linux glibc 2.26+ ARM64 Linux glibc 2.28+ ARM64 |
|
SHA-256 checksum How to use checksums |
44dd125f8a120f7b4b28fb561f8c5ab4f04a2c5cc53bd05716f242098b0da648
|
|
BLAKE2b-256 checksum How to use checksums |
21767dfe66c096f582d2e99059ced102527fcb3b6aa909aad8dffc91806b512c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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 Aug 23, 2026.
Transparency logRelease files / torchfits-1.1.0b1-cp314-cp314-macosx_11_0_arm64.whl
| Download URL | torchfits-1.1.0b1-cp314-cp314-macosx_11_0_arm64.whl |
|---|---|
| Size | 1.0 MB |
| Tags | CPython 3.14 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
6a8eac31c3e53c6ca6b210eee15c55518ad02910ef9bcad6ede8b3e2bd4174e8
|
|
BLAKE2b-256 checksum How to use checksums |
5b01a0a4027eff1a2db697d444aca18ea28342d71295f3a5971db8848ddc618a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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 Aug 23, 2026.
Transparency logRelease files / torchfits-1.1.0b1-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
| Download URL | torchfits-1.1.0b1-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl |
|---|---|
| Size | 1.2 MB |
| Tags | CPython 3.13 Linux glibc 2.27+ x86-64 Linux glibc 2.28+ x86-64 |
|
SHA-256 checksum How to use checksums |
c521cc44bc06b215ea4bd8891e6e5ee028ada842cbb9829a07875d44e8e5b361
|
|
BLAKE2b-256 checksum How to use checksums |
ad11a4131fe352e5eb18a0aac519d0c9c0eba3f44544642a74663efe15525b18
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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 Aug 23, 2026.
Transparency logRelease files / torchfits-1.1.0b1-cp313-cp313-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl
| Download URL | torchfits-1.1.0b1-cp313-cp313-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl |
|---|---|
| Size | 1.1 MB |
| Tags | CPython 3.13 Linux glibc 2.26+ ARM64 Linux glibc 2.28+ ARM64 |
|
SHA-256 checksum How to use checksums |
3e62784395ae3a5498df237e9f240ea26b3ab31329f6e039206b1067748c0284
|
|
BLAKE2b-256 checksum How to use checksums |
330c50ce0b2a1697f74c752df2a8e6b8260b8166d1e3af63f13162154eca3f2c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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 Aug 23, 2026.
Transparency logRelease files / torchfits-1.1.0b1-cp313-cp313-macosx_11_0_arm64.whl
| Download URL | torchfits-1.1.0b1-cp313-cp313-macosx_11_0_arm64.whl |
|---|---|
| Size | 1.0 MB |
| Tags | CPython 3.13 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
add4d0d0f906d3f583c7c6908ff1d15a70220c724ee2e44b0c5c516df1c71d19
|
|
BLAKE2b-256 checksum How to use checksums |
7f22c79adaeee07f30b4f42cfb848604b69503403865df456cbeccaad2f38e5a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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 Aug 23, 2026.
Transparency logRelease files / torchfits-1.1.0b1-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
| Download URL | torchfits-1.1.0b1-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl |
|---|---|
| Size | 1.2 MB |
| Tags | CPython 3.12 Linux glibc 2.27+ x86-64 Linux glibc 2.28+ x86-64 |
|
SHA-256 checksum How to use checksums |
f6033c2db39ac70be559147bc5c0f54e2715dd86447d9af301429d85f77731a5
|
|
BLAKE2b-256 checksum How to use checksums |
50a693d35a65e397f37f47ae1433195ade50de28637758542efa4798edef3bac
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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 Aug 23, 2026.
Transparency logRelease files / torchfits-1.1.0b1-cp312-cp312-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl
| Download URL | torchfits-1.1.0b1-cp312-cp312-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl |
|---|---|
| Size | 1.1 MB |
| Tags | CPython 3.12 Linux glibc 2.26+ ARM64 Linux glibc 2.28+ ARM64 |
|
SHA-256 checksum How to use checksums |
dc357911fad82cf95a276c07c9ddbc26e8cab26c03bda819824e70933f7dbc91
|
|
BLAKE2b-256 checksum How to use checksums |
0d6b2536762004d591a8af918aed301dc4ef676deb9cd14abe5298ed12fdbbed
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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 Aug 23, 2026.
Transparency logRelease files / torchfits-1.1.0b1-cp312-cp312-macosx_11_0_arm64.whl
| Download URL | torchfits-1.1.0b1-cp312-cp312-macosx_11_0_arm64.whl |
|---|---|
| Size | 1.0 MB |
| Tags | CPython 3.12 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
379158328afb0bc47d53538032506434ad42996f4b0ccfdb8d12fd6c8f58c07c
|
|
BLAKE2b-256 checksum How to use checksums |
5e3e6b11a25024a6243523382b7aaea8579397e8153c522905b9097a625b3f8d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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 Aug 23, 2026.
Transparency logRelease files / torchfits-1.1.0b1-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
| Download URL | torchfits-1.1.0b1-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl |
|---|---|
| Size | 1.2 MB |
| Tags | CPython 3.11 Linux glibc 2.27+ x86-64 Linux glibc 2.28+ x86-64 |
|
SHA-256 checksum How to use checksums |
06d4fb639fc0a4eece261abbf14516157574acc939cde986fee7185299d7e5c6
|
|
BLAKE2b-256 checksum How to use checksums |
cde0867edef90d6a21e90d5c76177f9a2cc80bc917d234d43e2299d1a12d993e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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 Aug 23, 2026.
Transparency logRelease files / torchfits-1.1.0b1-cp311-cp311-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl
| Download URL | torchfits-1.1.0b1-cp311-cp311-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl |
|---|---|
| Size | 1.1 MB |
| Tags | CPython 3.11 Linux glibc 2.26+ ARM64 Linux glibc 2.28+ ARM64 |
|
SHA-256 checksum How to use checksums |
fbd5f8d59cfb46018e7ee2230ffd559315c22d017b165c8e2a01016e2e3395d3
|
|
BLAKE2b-256 checksum How to use checksums |
565573a098b9e49881d5c387da035aadc98db9b6032aef5431804d507e518604
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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 Aug 23, 2026.
Transparency logRelease files / torchfits-1.1.0b1-cp311-cp311-macosx_11_0_arm64.whl
| Download URL | torchfits-1.1.0b1-cp311-cp311-macosx_11_0_arm64.whl |
|---|---|
| Size | 1.0 MB |
| Tags | CPython 3.11 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
9dc28eee3f5c3586128ad95626f2622b7247044486ec8b03fb330a8b65a435f4
|
|
BLAKE2b-256 checksum How to use checksums |
b3959cb4397ae220368e537433e278b9c8dda1e1ca6bb10c53bc5147e18e42df
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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 Aug 23, 2026.
Transparency logRelease files / torchfits-1.1.0b1-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
| Download URL | torchfits-1.1.0b1-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl |
|---|---|
| Size | 1.2 MB |
| Tags | CPython 3.10 Linux glibc 2.27+ x86-64 Linux glibc 2.28+ x86-64 |
|
SHA-256 checksum How to use checksums |
c99a5d0f7f3e65d82b86d7de1528f4e3b39c15abb31c7962d8961455c9402eb0
|
|
BLAKE2b-256 checksum How to use checksums |
d3f0154ba6b8c47ac6479163ceb1b2a9240ee15d01d426b1e4255c7ed8476d47
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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 Aug 23, 2026.
Transparency logRelease files / torchfits-1.1.0b1-cp310-cp310-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl
| Download URL | torchfits-1.1.0b1-cp310-cp310-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl |
|---|---|
| Size | 1.1 MB |
| Tags | CPython 3.10 Linux glibc 2.26+ ARM64 Linux glibc 2.28+ ARM64 |
|
SHA-256 checksum How to use checksums |
d4efe0dfcac2fceaae91150a51554974623a8377dac23c13d7dd6396c5fb666e
|
|
BLAKE2b-256 checksum How to use checksums |
fc46d1f662d5e28a9fd1c3412e2a4b3f42410ff3aaac09ed135cdb72c369ca6e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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 Aug 23, 2026.
Transparency logRelease files / torchfits-1.1.0b1-cp310-cp310-macosx_11_0_arm64.whl
| Download URL | torchfits-1.1.0b1-cp310-cp310-macosx_11_0_arm64.whl |
|---|---|
| Size | 1.0 MB |
| Tags | CPython 3.10 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
5d3cb3b7d4da0a380b604a07d26e1564e585f72c600014bef7b567967976f1a2
|
|
BLAKE2b-256 checksum How to use checksums |
eefdc812137b8c97af90f65fbd5b3c729eb9b638220a021d2e30db36c7c45eec
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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 Aug 23, 2026.
Transparency log