HOME
ABOUT
DOCUMENTATION
GET HELP
HOME
ABOUT
DOCUMENTATION
GET HELP
Quick search

HOME

ABOUT

  • Our Mission
  • SWPy Team

DOCUMENTATION

  • Examples
  • User’s Guide
  • Code Reference

GET HELP

  • Get Help
  • Docs »
  • Code Reference »
  • Header
  • ← get_file_list
  • Get Help →

Header ¶

class swpy.swds.dataset.utilities. Header ¶

Bases: dict

This class manages the file's header based on a dictionary. Addtionally, it includes basic dictionary functions, while allowing management of header items through additional methods.

Methods Summary

__repr__ ()

Returns the string representation of the object.

__str__ ()

Returns the string representation of the object.

__getitem__ (key)

Returns the value corresponding to the given key.

__setitem__ (key, value)

Sets the value for the given key.

__delitem__ (key)

Deletes the item corresponding to the given key.

__iter__ ()

Returns an iterator for the keys of the header.

__len__ ()

Returns the number of items in the header.

__contains__ (key)

Checks if the given key is present in the header.

keys ()

Returns all the keys in the header.

values ()

Returns all the values in the header.

items ()

Returns all the key-value pairs in the header.

get (key)

Returns the value corresponding to the given key.

set (key, value)

Sets the value into the given key.

delete (key)

Deletes the item corresponding to the given key.

delete_all ()

Deletes all the item of the header.

delete_all_except (key)

Deletes all items except for the given key.

delete_all_except_these (key)

Deletes all items that are not included in the given list of keys.

Methods Documentation

__repr__ ( self ) ¶

Returns the string representation of the object.

Returns
  • The 'string representation' that shows the 'Header' object.


__str__ ( self ) ¶

Returns the string representation of the object.

Returns
  • The 'string representation' that shows the 'Header' object.


__getitem__ ( self, key ) ¶

Returns the value corresponding to the given key.

Parameters
  • key ( str) - The dictionary key of the header object.

Returns
  • The 'dictionary values' of the header object.


__setitem__ ( self, key, value ) ¶

Sets the value for the given key.

Parameters
  • key ( str) - The dictionary key of the header object.

  • value (all type) - The dictionary value of the header object.


__delitem__ ( self, key ) ¶

Deletes the item corresponding to the given key.

Parameters
  • key ( str) - The dictionary key of the header object.


__iter__ ( self ) ¶

Returns an iterator for the keys of the header.

Returns
  • iterator - An iterator for the keys of the header.


__len__ ( self ) ¶

Returns the number of items in the header.

Returns
  • the number of items in the header.


__contains__ ( self, key ) ¶

Checks if the given key is present in the header.

Parameters
  • key ( str) - The dictionary key of the header object.

Returns
  • bool ( str) - If the key is present,'True', otherwise 'False'.


keys ( self ) ¶

Returns all the keys in the header.

Returns
  • All the keys in the 'header'.


values ( self ) ¶

Returns all the values in the header.

Returns
  • All the values in the 'header'.


items ( self ) ¶

Returns all the key-value pairs in the header.

Returns
  • All the key-value pairs in the 'header'.


get ( self, key ) ¶

Returns the value corresponding to the given key.

Returns
  • The 'values' corresponding to the given key.


set ( self, key, value ) ¶

Sets the value into the given key.

Parameters
  • key ( str) - The dictionary key of the header object.

  • value (all type) - The dictionary value of the header object.


delete ( self, key ) ¶

Deletes the item corresponding to the given key.

Parameters
  • key ( str) - The dictionary key of the header object.


delete_all ( self ) ¶

Deletes all the item of the header.


delete_all_except ( self, key ) ¶

Deletes all items except for the given key.

Parameters
  • key ( str) - The dictionary key of the header object.


delete_all_except_these ( self, key ) ¶

Deletes all items that are not included in the given list of keys.

Parameters
  • key ( str) - A list of dictionary keys to be retained.

  • ← Transfer
  • Downloader →
© Copyright 2021, Space Weather.
Created using Sphinx 4.0.1 with Press Theme 0.7.3.