spacepy.pycdf.AttrList — SpacePy v0.1.5 Manual

### Navigation

- index
- modules |
- modules |
- next |
- previous |
- homepage|
- search|
- documentation »
- pycdf - Python interface to CDF files »

# spacepy.pycdf.AttrList

class `spacepy.pycdf.` `AttrList`(cdf_file, special_entry=None)

  Object representing a list of attributes.

  Warning

  This class should not be used directly, but only via its subclasses, `gAttrList` and `zAttrList`. Methods listed here are safe to use from the subclasses.

  `clone`(master[, name, new_name]) | Clones another attribute list, or one attribute from it, into this list.
  `copy`() | Create a copy of this attribute list
  `from_dict`(in_dict) | Fill this list of attributes from a dictionary
  `new`(name[, data, type]) | Create a new Attr in this AttrList
  `rename`(old_name, new_name) | Rename an attribute in this list

  `clone`(master, name=None, new_name=None)

    Clones another attribute list, or one attribute from it, into this list.

    Parameters: | master : AttrList the attribute list to copy from. This can be any dict-like object.
    Other Parameters:
    | name : str (optional) name of attribute to clone (default: clone entire list) new_name : str (optional) name of the new attribute, default `name`

  `copy`()

    Create a copy of this attribute list

    Returns: | out : dict copy of the entries for all attributes in this list

  `from_dict`(in_dict)

    Fill this list of attributes from a dictionary

    Deprecated since version 0.1.5: Use `clone()` instead; it supports cloning from dictionaries.

    Parameters: | in_dict : dict Attribute list is populated entirely from this dictionary; all existing attributes are deleted.

  `new`(name, data=None, type=None)

    Create a new Attr in this AttrList

    Parameters: | name : str name of the new Attribute
    Other Parameters:
    | data : data to put into the first entry in the new Attribute type : CDF type of the first entry from `const`. Only used if data are specified.
    Raises: | KeyError : if the name already exists in this list

  `rename`(old_name, new_name)

    Rename an attribute in this list

    Renaming a zAttribute renames it for all zVariables in this CDF!

    Parameters: | old_name : str the current name of the attribute new_name : str the new name of the attribute

### Navigation

- index
- modules |
- modules |
- next |
- previous |
- homepage|
- search|
- documentation »
- pycdf - Python interface to CDF files »