--- id: fitsio version: "1.4.2" license: GPL-2.0-or-later license_treatment: copyleft maintenance: active --- # fitsio — A full featured python library to read from and write to FITS files. License: copyleft · Maintenance: active · Downloads: 87.0K/mo ## What it is and what it does fitsio is a Python wrapper around cfitsio that provides direct, efficient access to FITS files—the standard data format in astronomy. It reads and writes image arrays, binary tables, and ASCII tables into NumPy arrays, with support for partial reads (subsets of rows and columns) without loading entire files into memory. The library handles variable-length columns, compressed images, multiple HDU extensions, header keyword manipulation, and row filtering. The package bundles its own cfitsio library, so no external system dependency is required. It supports slice notation similar to NumPy arrays and memmap, making it natural for Python users familiar with NumPy. Active maintenance and broad wheel availability (Python 3.10–3.13 on macOS, Linux, Windows) keep install friction moderate despite the C extension. Use it for: - Load astronomical survey data (images, catalogs) from FITS files into NumPy for analysis without reading entire files into memory. - Extract specific columns and row ranges from large FITS binary tables for statistical or machine-learning pipelines. - Write processed astronomical data back to FITS format with proper headers and metadata for archival or sharing with collaborators. - Iterate over rows in a FITS table with buffering for efficient streaming processing of large catalogs. - Read and modify FITS header keywords (e.g., WCS, photometric calibration metadata) for data reduction workflows. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. fitsio reads and writes FITS (Flexible Image Data Format) files, the standard format for astronomical data, into and from NumPy arrays with support for image, binary table, and ASCII table extensions. Yes, if you work with FITS files in astronomy or related fields. The package is actively maintained, has no known vulnerabilities, and provides efficient partial-read access that astropy.io.fits does not. The GPL-2.0-or-later license is a blocker only if your project is proprietary and cannot adopt copyleft terms. For academic and open-source astronomy work, it is a solid, well-established choice. ## Install pip install fitsio uv add fitsio poetry add fitsio ## Installing fitsio Before you install: Medium install friction due to C extension compilation, but pre-built wheels are available for current Python versions (3.10–3.13) across macOS, Linux, and Windows. Active maintenance with a recent release (29 days old) and a bundled cfitsio library eliminates external dependency conflicts. License in practice: Licensed under GPL-2.0-or-later (copyleft). Any derivative work or modification must be distributed under the same or compatible GPL license; proprietary closed-source projects cannot use this package without legal review. Quickstart: import fitsio import numpy as np # Read all data from first HDU data = fitsio.read('data.fits') # Read subset of rows and columns data = fitsio.read('data.fits', rows=[35, 1001], columns=['x', 'y'], ext=2) # Write a new FITS file with a binary table data = np.zeros(10, dtype=[('id', 'i8'), ('ra', 'f8'), ('dec', 'f8')]) fitsio.write('output.fits', data) Requires Python >= 3.10; C extension compilation needed (pre-built wheels available for common platforms). Verify before relying: - Performance characteristics for very large FITS files (memory usage, read/write speed). - Completeness of support for all FITS compression formats (RICE, GZIP, PLIO, HCOMPRESS) in current version. - Compatibility with FITS files produced by other major astronomy software (e.g., CFITSIO, astropy.io.fits). ## Package facts - License: GPL-2.0-or-later (copyleft) - Python support: supports_current - Install friction: medium - Maintenance: active - Downloads: 87.0K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags FITS file read write, astronomical data format, FITS image table, cfitsio python wrapper, binary table extension, FITS header keywords, astronomy data I/O, astronomy, fits-format, scientific-data [View on SkillFed](https://skillfed.io/packages/fitsio) · [View on PyPI](https://pypi.org/project/fitsio/)