class pyfits.Card(keyword=None, value=None, comment=None, **kwargs)

Bases: pyfits.verify._Verify

classmethod fromstring(image)

Construct a Card object from a (raw) string. It will pad the string if it is not the length of a card image (80 columns). If the card image is longer than 80 columns, assume it contains CONTINUE card(s).

classmethod normalize_keyword(keyword)

classmethod to convert a keyword value that may contain a field-specifier to uppercase. The effect is to raise the key to uppercase and leave the field specifier in its original case.


key : or str

A keyword value or a keyword.field-specifier value

run_option(option='warn', err_text='', fix_text='Fixed.', fix=None, fixable=True)

Execute the verification with selected option.


Verify all values in the instance.


option : str

Output verification option. Must be one of "fix", "silentfix", "ignore", "warn", or "exception". May also be any combination of "fix" or "silentfix" with "+ignore", +warn, or +exception" (e.g. ``"fix+warn"). See Verification options for more info.


Get the comment attribute from the card image if not already set.


The field-specifier of record-valued keyword cards; always None on normal cards.


The card “image”, that is, the 80 byte character string that represents this card in an actual FITS header.


True if the card is completely blank–that is, it has no keyword, value, or comment. It appears in the header as 80 spaces.

Returns False otherwise.


Returns the keyword name parsed from the card image.

length = 80

The length of a Card image; should always be 80 for valid FITS files.


On record-valued keyword cards this is the name of the standard <= 8 character FITS keyword that this RVKC is stored in. Otherwise it is the card’s normal keyword.


On record-valued keyword cards this is the raw string value in the <field-specifier>: <value> format stored in the card in order to represent a RVKC. Otherwise it is the card’s normal value.


The value associated with the keyword stored in this card.