PyFITS provides an interface to FITS formatted files in the Python scripting language and PyRAF, the Python-based interface to IRAF. It is useful both for interactive data analysis and for writing analysis scripts in Python using FITS files as either input or output. PyFITS is a development project of the Science Software Branch at the Space Telescope Science Institute.
PyFITS and all necessary modules are included with the stsci_python distribution and associated updates to it (though what is included there may not be the very latest version). PyFITS does not require PyRAF however. It may be used independently so long as numpy is installed.
The manual provides a tutorial on how to use PyFITS with FITS images and FITS tables, along with an extensive description of all the methods (currently) available for working with FITS files. This manual, however, is only a DRAFT document and is very much a work-in-progress. An HTML version of the manual, including API documentation, is also available.
The current version of PyFITS is v3.1.2 (April 22 2013).
PyFITS 2.3.1 and later is distributed under a BSD license. Unfortunately, PyFITS version 2.0 (January 30 2009) through version 2.3 (May 11 2010) contained some code in the Compressed Image HDU extension module that was covered under a GNU General Public License. Prior to PyFITS version 2.0 and beginning again with PyFITS version 2.3.1 (June 3 2010) PyFITS is covered under a BSD license.