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.0

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.0
File Actions
torchfits-1.3.0-cp315-cp315-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl CPython 3.15 CPython 3.15 Linux glibc 2.27+ x86-64, Linux glibc 2.28+ x86-64 Details for torchfits-1.3.0-cp315-cp315-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
torchfits-1.3.0-cp315-cp315-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl CPython 3.15 CPython 3.15 Linux glibc 2.28+ ARM64, Linux glibc 2.26+ ARM64 Details for torchfits-1.3.0-cp315-cp315-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl
torchfits-1.3.0-cp314-cp314-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl CPython 3.14 CPython 3.14 Linux glibc 2.28+ x86-64, Linux glibc 2.27+ x86-64 Details for torchfits-1.3.0-cp314-cp314-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
torchfits-1.3.0-cp314-cp314-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl CPython 3.14 CPython 3.14 Linux glibc 2.26+ ARM64, Linux glibc 2.28+ ARM64 Details for torchfits-1.3.0-cp314-cp314-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl
torchfits-1.3.0-cp314-cp314-macosx_11_0_arm64.whl CPython 3.14 CPython 3.14 macOS 11.0+ ARM64 Details for torchfits-1.3.0-cp314-cp314-macosx_11_0_arm64.whl
torchfits-1.3.0-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl CPython 3.13 CPython 3.13 Linux glibc 2.28+ x86-64, Linux glibc 2.27+ x86-64 Details for torchfits-1.3.0-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
torchfits-1.3.0-cp313-cp313-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl CPython 3.13 CPython 3.13 Linux glibc 2.26+ ARM64, Linux glibc 2.28+ ARM64 Details for torchfits-1.3.0-cp313-cp313-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl
torchfits-1.3.0-cp313-cp313-macosx_11_0_arm64.whl CPython 3.13 CPython 3.13 macOS 11.0+ ARM64 Details for torchfits-1.3.0-cp313-cp313-macosx_11_0_arm64.whl
torchfits-1.3.0-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.0-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
torchfits-1.3.0-cp312-cp312-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl CPython 3.12 CPython 3.12 Linux glibc 2.26+ ARM64, Linux glibc 2.28+ ARM64 Details for torchfits-1.3.0-cp312-cp312-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl
torchfits-1.3.0-cp312-cp312-macosx_11_0_arm64.whl CPython 3.12 CPython 3.12 macOS 11.0+ ARM64 Details for torchfits-1.3.0-cp312-cp312-macosx_11_0_arm64.whl
torchfits-1.3.0-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl CPython 3.11 CPython 3.11 Linux glibc 2.27+ x86-64, Linux glibc 2.28+ x86-64 Details for torchfits-1.3.0-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
torchfits-1.3.0-cp311-cp311-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl CPython 3.11 CPython 3.11 Linux glibc 2.28+ ARM64, Linux glibc 2.26+ ARM64 Details for torchfits-1.3.0-cp311-cp311-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl
torchfits-1.3.0-cp311-cp311-macosx_11_0_arm64.whl CPython 3.11 CPython 3.11 macOS 11.0+ ARM64 Details for torchfits-1.3.0-cp311-cp311-macosx_11_0_arm64.whl

Total release size: 20.6 MB

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

Download URL torchfits-1.3.0-cp315-cp315-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Size 1.6 MB
Tags CPython 3.15 Linux glibc 2.27+ x86-64 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
db3b5b89580affe786462b8284391a8914e3d3f88a246801202271a2409e9afa
BLAKE2b-256 checksum
How to use checksums
866a088692743f63b46bf391a9bc6a9e47e4e643fda4fcf43b113e2764868a0c
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 Oct 23, 2026.

Transparency log

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

Download URL torchfits-1.3.0-cp315-cp315-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl
Size 1.5 MB
Tags CPython 3.15 Linux glibc 2.26+ ARM64 Linux glibc 2.28+ ARM64
SHA-256 checksum
How to use checksums
e23023d18e657ce252422311290a93c7f6e0537079a71246174b169491436857
BLAKE2b-256 checksum
How to use checksums
4ec2c22d428d943de7fd9e2f713ffd0a0c35a7b4c18d264e391bf95cd56b18a2
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 Oct 23, 2026.

Transparency log

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

Download URL torchfits-1.3.0-cp314-cp314-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Size 1.6 MB
Tags CPython 3.14 Linux glibc 2.27+ x86-64 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
7fc017b6dd09f021d6824c75f9e22cadd21ed3951b71e8d2e58bf7791fb34fc3
BLAKE2b-256 checksum
How to use checksums
c182edb1ad5b78840de4c2cfef2bb1397eb735a1a04f37f31cc7acdf2b97a743
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 Oct 23, 2026.

Transparency log

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

Download URL torchfits-1.3.0-cp314-cp314-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl
Size 1.5 MB
Tags CPython 3.14 Linux glibc 2.26+ ARM64 Linux glibc 2.28+ ARM64
SHA-256 checksum
How to use checksums
e8b218bfe02c1cc1b53653b86047caacb2dd4249b6d8a6090d8fab21e81b0e2f
BLAKE2b-256 checksum
How to use checksums
fab50d6954791fbf1fb9ea9f8ba49a1250ccf8c622575b041c4f691deef431d3
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 Oct 23, 2026.

Transparency log

Release files / torchfits-1.3.0-cp314-cp314-macosx_11_0_arm64.whl

Download URL torchfits-1.3.0-cp314-cp314-macosx_11_0_arm64.whl
Size 1.3 MB
Tags CPython 3.14 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
0c981df7f75e735bdda8a29f1b0be37a4b03b02bb2fd44db7a2f61ce0343ad45
BLAKE2b-256 checksum
How to use checksums
e51478addf821fd0fdada8057a7b5b80135f3bdc22e2f07720ef57902e33f954
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 Oct 23, 2026.

Transparency log

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

Download URL torchfits-1.3.0-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Size 1.6 MB
Tags CPython 3.13 Linux glibc 2.27+ x86-64 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
3b43015a9fa145be8efff583b5f396925e324a45f9d08750c16e9ab3ab54ec60
BLAKE2b-256 checksum
How to use checksums
c485593564a731f358048ab046b2209fb182baa71afb8c58edaca14bc298fc42
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 Oct 23, 2026.

Transparency log

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

Download URL torchfits-1.3.0-cp313-cp313-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl
Size 1.5 MB
Tags CPython 3.13 Linux glibc 2.26+ ARM64 Linux glibc 2.28+ ARM64
SHA-256 checksum
How to use checksums
192eb1c54db064287958f97ecc22638f83bd0ba0db6c724c24f395bfbf9adb33
BLAKE2b-256 checksum
How to use checksums
77898b0587df4b3031523ff2d8beb9b754df2aee4daf533f8b8213aaa820ad3a
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 Oct 23, 2026.

Transparency log

Release files / torchfits-1.3.0-cp313-cp313-macosx_11_0_arm64.whl

Download URL torchfits-1.3.0-cp313-cp313-macosx_11_0_arm64.whl
Size 1.3 MB
Tags CPython 3.13 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
cb6344359430cb37e234df2fb9b7c39a8ed8fef52faae6ea1b02378c865507be
BLAKE2b-256 checksum
How to use checksums
3f999338284745a0134c33f131e85fb90436601fc704c094c0a3c6e13fa977b6
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 Oct 23, 2026.

Transparency log

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

Download URL torchfits-1.3.0-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Size 1.6 MB
Tags CPython 3.12 Linux glibc 2.27+ x86-64 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
9b7826d3eee6b4241f27d382a2ebf35fcc04cfcc9dc1d1a7e82b09927660596d
BLAKE2b-256 checksum
How to use checksums
20780e842d003e649dd93246ffee4b2c81d99438e461210bdfe0923edcfb1b70
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 Oct 23, 2026.

Transparency log

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

Download URL torchfits-1.3.0-cp312-cp312-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl
Size 1.5 MB
Tags CPython 3.12 Linux glibc 2.26+ ARM64 Linux glibc 2.28+ ARM64
SHA-256 checksum
How to use checksums
d80caa6e78c32dd904e4752df9cde984b19c8250be1648394fdd67fade1a79c3
BLAKE2b-256 checksum
How to use checksums
b5a51eab088691e096dbc24e7d3b06c8570129d73079e5794ad2149cdeb79c95
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 Oct 23, 2026.

Transparency log

Release files / torchfits-1.3.0-cp312-cp312-macosx_11_0_arm64.whl

Download URL torchfits-1.3.0-cp312-cp312-macosx_11_0_arm64.whl
Size 1.3 MB
Tags CPython 3.12 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
17c5bb01c5fc2c19ad84b3039c9a2e8ce07b41de945e03be9e8f83f4d2ccc090
BLAKE2b-256 checksum
How to use checksums
df1b009c5216a1df265c74add7824d6721e5f959f6bd3eafc2e6953fdbdccbc0
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 Oct 23, 2026.

Transparency log

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

Download URL torchfits-1.3.0-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Size 1.6 MB
Tags CPython 3.11 Linux glibc 2.27+ x86-64 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
e04b16be4e9f98a5b8603a0b0988ce9eb6b2f95a6099c01419bc8a88290e6e60
BLAKE2b-256 checksum
How to use checksums
6cbc13c2cf32301e212e991afb364d82a96125f768c5eab4c00aa15ae24fb452
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 Oct 23, 2026.

Transparency log

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

Download URL torchfits-1.3.0-cp311-cp311-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl
Size 1.5 MB
Tags CPython 3.11 Linux glibc 2.26+ ARM64 Linux glibc 2.28+ ARM64
SHA-256 checksum
How to use checksums
482c68b26ecdbed54c788fdaea5e7a98e10cee15bcd5a8741cb897d6ce1ce2a2
BLAKE2b-256 checksum
How to use checksums
b60c86d83dd3a86610fa577f3e812fc55e26570455992cafe5a16a21a584e6ea
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 Oct 23, 2026.

Transparency log

Release files / torchfits-1.3.0-cp311-cp311-macosx_11_0_arm64.whl

Download URL torchfits-1.3.0-cp311-cp311-macosx_11_0_arm64.whl
Size 1.3 MB
Tags CPython 3.11 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
ac47e360df9cf5c081d8d06f496bc17fc721a962ac6c2b0ca7eeefc65a41b0e1
BLAKE2b-256 checksum
How to use checksums
ea524237ddc0e04ccf5e3e9325f91f6ccc2399c6d63239797e7663a6df6e4dde
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 Oct 23, 2026.

Transparency log

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

Select from 14 files

Attestation for torchfits-1.3.0-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 Oct 23, 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.0 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