Skip to main content

torchfits

PyPI GitHub release Documentation CI Python 3.11+ License: MIT

Read and write FITS files as PyTorch tensors and Arrow tables. Cutouts, where= filters, and a shell CLI are included. CFITSIO is in the wheel. Arrow columns are zero-copy views over the decoded buffers, and header or Arrow reads do not import PyTorch.

Prebuilt wheels for Python 3.11–3.15 on Linux and 3.11–3.14 on macOS, with PyTorch 2.14.x: Linux (x86_64, aarch64) and macOS Apple Silicon.

Docs: stable · edge (main tip)

Install

pip install torchfits

Prebuilt wheels decode FITS on the host, then device="cuda" / "mps" copies the tensor onto the GPU when those runtimes are available. For CPU-only installs, custom CUDA builds, or other PyTorch versions, 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=...)
Header without PyTorch torchfits.read_header("img.fits")
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
Evaluation Where parity and benchmark notes live
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 --locked
pixi run preflight-push   # fast gate while editing
pixi run test             # full unit suite
pixi run current-source-gate  # locked environment + complete local gate

Agent conventions: AGENTS.md. Release process: docs/release.md.

License

MIT

Metadata

Release files for torchfits 1.3.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distributions (wheels)

Table of built distributions (wheels) for torchfits 1.3.2
File Actions
torchfits-1.3.2-cp315-cp315-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl CPython 3.15 CPython 3.15 Linux glibc 2.28+ x86-64, Linux glibc 2.27+ x86-64 Details for torchfits-1.3.2-cp315-cp315-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
torchfits-1.3.2-cp315-cp315-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl CPython 3.15 CPython 3.15 Linux glibc 2.26+ ARM64, Linux glibc 2.28+ ARM64 Details for torchfits-1.3.2-cp315-cp315-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl
torchfits-1.3.2-cp314-cp314-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl CPython 3.14 CPython 3.14 Linux glibc 2.27+ x86-64, Linux glibc 2.28+ x86-64 Details for torchfits-1.3.2-cp314-cp314-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
torchfits-1.3.2-cp314-cp314-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl CPython 3.14 CPython 3.14 Linux glibc 2.28+ ARM64, Linux glibc 2.26+ ARM64 Details for torchfits-1.3.2-cp314-cp314-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl
torchfits-1.3.2-cp314-cp314-macosx_14_0_arm64.whl CPython 3.14 CPython 3.14 macOS 14.0+ ARM64 Details for torchfits-1.3.2-cp314-cp314-macosx_14_0_arm64.whl
torchfits-1.3.2-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl CPython 3.13 CPython 3.13 Linux glibc 2.27+ x86-64, Linux glibc 2.28+ x86-64 Details for torchfits-1.3.2-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
torchfits-1.3.2-cp313-cp313-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl CPython 3.13 CPython 3.13 Linux glibc 2.28+ ARM64, Linux glibc 2.26+ ARM64 Details for torchfits-1.3.2-cp313-cp313-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl
torchfits-1.3.2-cp313-cp313-macosx_14_0_arm64.whl CPython 3.13 CPython 3.13 macOS 14.0+ ARM64 Details for torchfits-1.3.2-cp313-cp313-macosx_14_0_arm64.whl
torchfits-1.3.2-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl CPython 3.12 CPython 3.12 Linux glibc 2.28+ x86-64, Linux glibc 2.27+ x86-64 Details for torchfits-1.3.2-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
torchfits-1.3.2-cp312-cp312-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl CPython 3.12 CPython 3.12 Linux glibc 2.28+ ARM64, Linux glibc 2.26+ ARM64 Details for torchfits-1.3.2-cp312-cp312-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl
torchfits-1.3.2-cp312-cp312-macosx_14_0_arm64.whl CPython 3.12 CPython 3.12 macOS 14.0+ ARM64 Details for torchfits-1.3.2-cp312-cp312-macosx_14_0_arm64.whl
torchfits-1.3.2-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl CPython 3.11 CPython 3.11 Linux glibc 2.28+ x86-64, Linux glibc 2.27+ x86-64 Details for torchfits-1.3.2-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
torchfits-1.3.2-cp311-cp311-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl CPython 3.11 CPython 3.11 Linux glibc 2.26+ ARM64, Linux glibc 2.28+ ARM64 Details for torchfits-1.3.2-cp311-cp311-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl
torchfits-1.3.2-cp311-cp311-macosx_14_0_arm64.whl CPython 3.11 CPython 3.11 macOS 14.0+ ARM64 Details for torchfits-1.3.2-cp311-cp311-macosx_14_0_arm64.whl

Total release size: 21.7 MB

Release files / torchfits-1.3.2-cp315-cp315-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl

Download URL torchfits-1.3.2-cp315-cp315-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Size 1.7 MB
Tags CPython 3.15 Linux glibc 2.27+ x86-64 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
ca0928693552c1fa17d557e88c3b56f114730faf259fd3ba23dc33fde4051015
BLAKE2b-256 checksum
How to use checksums
0d9ccc50709d911e8d9528d3d5dd4c48474551be41924bdb9aabf13d68adb008
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 3, 2026.

Transparency log

Release files / torchfits-1.3.2-cp315-cp315-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl

Download URL torchfits-1.3.2-cp315-cp315-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl
Size 1.6 MB
Tags CPython 3.15 Linux glibc 2.26+ ARM64 Linux glibc 2.28+ ARM64
SHA-256 checksum
How to use checksums
a4fc91bcc16a18091990e69dfb2c6a143bda2ab5f8ed1f0eae5e98f1d9fdaa80
BLAKE2b-256 checksum
How to use checksums
9876713bfc3a88774ab19aad661f7dfe5e072134b3411bfff79ae4aad6e39686
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 3, 2026.

Transparency log

Release files / torchfits-1.3.2-cp314-cp314-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl

Download URL torchfits-1.3.2-cp314-cp314-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Size 1.7 MB
Tags CPython 3.14 Linux glibc 2.27+ x86-64 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
41f3406f89e6c4fff8fc51f40cc9f4a4d7141088bae3274bf88b40f3cec1234c
BLAKE2b-256 checksum
How to use checksums
96700891aa232ff5bbac9cd1ec12a92e6be47c969d5fefd533268ac1bf33f2de
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 3, 2026.

Transparency log

Release files / torchfits-1.3.2-cp314-cp314-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl

Download URL torchfits-1.3.2-cp314-cp314-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl
Size 1.6 MB
Tags CPython 3.14 Linux glibc 2.26+ ARM64 Linux glibc 2.28+ ARM64
SHA-256 checksum
How to use checksums
fb7705e41fee3df1b48866bc199da9a0ccd4c900247d492881694fc144b94afc
BLAKE2b-256 checksum
How to use checksums
beb1392393fe980779d0ba8afb585286ad3473929cbcef4013ea6870ea034b43
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 3, 2026.

Transparency log

Release files / torchfits-1.3.2-cp314-cp314-macosx_14_0_arm64.whl

Download URL torchfits-1.3.2-cp314-cp314-macosx_14_0_arm64.whl
Size 1.4 MB
Tags CPython 3.14 macOS 14.0+ ARM64
SHA-256 checksum
How to use checksums
9fcf13f086506e8c86189eb5fab97fe68450ffb0c3c93ba12f6d1192ab44a321
BLAKE2b-256 checksum
How to use checksums
6c3a5eb36cd9221cf56e834f91822f02075b40b5dbf28c156542e5bfd0c54f6e
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 3, 2026.

Transparency log

Release files / torchfits-1.3.2-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl

Download URL torchfits-1.3.2-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Size 1.7 MB
Tags CPython 3.13 Linux glibc 2.27+ x86-64 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
6975db70a3776252335ad78a6b0b7885bdc69d97169669c3ef7a7cfb007de266
BLAKE2b-256 checksum
How to use checksums
fe91b215107a25d6f5df8737221c990dbf99ab0a879cd35994114ad4bed16280
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 3, 2026.

Transparency log

Release files / torchfits-1.3.2-cp313-cp313-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl

Download URL torchfits-1.3.2-cp313-cp313-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl
Size 1.6 MB
Tags CPython 3.13 Linux glibc 2.26+ ARM64 Linux glibc 2.28+ ARM64
SHA-256 checksum
How to use checksums
616a3b23e6921404dde58d6801a3120b9811b6f409bdd8e8e9e79ff89a2b3d09
BLAKE2b-256 checksum
How to use checksums
2a104e4b279518c53ecf809f1932f5a26252edf17a053b56eff5f30419310733
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 3, 2026.

Transparency log

Release files / torchfits-1.3.2-cp313-cp313-macosx_14_0_arm64.whl

Download URL torchfits-1.3.2-cp313-cp313-macosx_14_0_arm64.whl
Size 1.4 MB
Tags CPython 3.13 macOS 14.0+ ARM64
SHA-256 checksum
How to use checksums
4272c7453fb4846d18759569b8d66e9a1e2d6c124ac3eb9a07254dfbe1d955a0
BLAKE2b-256 checksum
How to use checksums
dad8cc190a6f25ba09f9d37f623bdf3d02b99d5e979830b9160f13fc24c24a10
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 3, 2026.

Transparency log

Release files / torchfits-1.3.2-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl

Download URL torchfits-1.3.2-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Size 1.7 MB
Tags CPython 3.12 Linux glibc 2.27+ x86-64 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
c37445f5f718b2aa9f17de1d09a3438ed343bb7be47e8272d4b467a40be266b7
BLAKE2b-256 checksum
How to use checksums
b0e5ca61f721e5571f9ec4259c60d60ca5f3bd58338b826462bfd440303876ff
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 3, 2026.

Transparency log

Release files / torchfits-1.3.2-cp312-cp312-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl

Download URL torchfits-1.3.2-cp312-cp312-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl
Size 1.6 MB
Tags CPython 3.12 Linux glibc 2.26+ ARM64 Linux glibc 2.28+ ARM64
SHA-256 checksum
How to use checksums
6adb9759b7df795084a6f222c6e1b0c9872e8b77da97fea93b6c645c98799390
BLAKE2b-256 checksum
How to use checksums
e4201f3413e680181b61e35058f3804a4ef4e5bc4f2d3157e2bee7b32fa8ea91
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 3, 2026.

Transparency log

Release files / torchfits-1.3.2-cp312-cp312-macosx_14_0_arm64.whl

Download URL torchfits-1.3.2-cp312-cp312-macosx_14_0_arm64.whl
Size 1.4 MB
Tags CPython 3.12 macOS 14.0+ ARM64
SHA-256 checksum
How to use checksums
5a31ae38240072aeffab514d63f8af0165d620eda5ddc80a9f8680846dd9d0fc
BLAKE2b-256 checksum
How to use checksums
3e139348db1639eb0b41bfdab3eee20f1d0c6504012b03e72132dda3e1c05c1d
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 3, 2026.

Transparency log

Release files / torchfits-1.3.2-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl

Download URL torchfits-1.3.2-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Size 1.7 MB
Tags CPython 3.11 Linux glibc 2.27+ x86-64 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
f13d32d3400aa805b6550e62a61b5072308ef3deb59ed70db4e237bf1ff0c57f
BLAKE2b-256 checksum
How to use checksums
a92a509355f26227b9b387f707a4313562c5ef629349cfd266bb5368a60ba13a
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 3, 2026.

Transparency log

Release files / torchfits-1.3.2-cp311-cp311-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl

Download URL torchfits-1.3.2-cp311-cp311-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl
Size 1.6 MB
Tags CPython 3.11 Linux glibc 2.26+ ARM64 Linux glibc 2.28+ ARM64
SHA-256 checksum
How to use checksums
37a233aa08270a4558c40aba429f8b64e1a13ba1d1240d7a16f15a77642ea6f9
BLAKE2b-256 checksum
How to use checksums
0dd67332b3750c8bb1bb01d15fbb785dcda1b31435b519eae8c9a610661c421f
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 3, 2026.

Transparency log

Release files / torchfits-1.3.2-cp311-cp311-macosx_14_0_arm64.whl

Download URL torchfits-1.3.2-cp311-cp311-macosx_14_0_arm64.whl
Size 1.4 MB
Tags CPython 3.11 macOS 14.0+ ARM64
SHA-256 checksum
How to use checksums
d2dea498a398673bbc6530b6cb3db71c0414b464824b1799cf5bee0d12bd7b51
BLAKE2b-256 checksum
How to use checksums
f3e0cd945e1dce5fca2f755a81cf01d37025e804bca420373f2630f7521fa2b2
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 3, 2026.

Transparency log

Security for torchfits 1.3.2

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 14 files in this release have been uploaded with provenance metadata.

Select from 14 files

Attestation for torchfits-1.3.2-cp315-cp315-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl

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 3, 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.

Release history Release notifications | RSS feed

This release

1.3.2 This release

14 release files Full provenance

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