SunPy util

sunpy.util Package

Functions

deprecated(since[, message, name, alternative])

Used to mark a function or class as deprecated.

dict_keys_same(list_of_dicts)

Makes sure that a list of dictionaries all have the same keys.

expand_list(inp)

Expand a list of lists or tuples.

expand_list_generator(inp)

get_sys_dict()

Test which packages are installed on system.

replacement_filename(path)

Return a replacement path if input path is currently in use.

system_info()

Takes dictionary from sys_info() and prints the contents in an attractive fashion.

unique(itr[, key])

Return only unique elements of a sequence.

Classes

MetaDict(*args)

A class to hold metadata associated with a sunpy.map.Map derivative.

SunpyDeprecationWarning

A warning class to indicate a deprecated feature.

SunpyPendingDeprecationWarning

A warning class to indicate a soon-to-be deprecated feature.

SunpyUserWarning

The primary warning class for Sunpy.

SunpyWarning

The base warning class from which all Sunpy warnings should inherit.

Class Inheritance Diagram

Inheritance diagram of sunpy.util.metadata.MetaDict, sunpy.util.exceptions.SunpyDeprecationWarning, sunpy.util.exceptions.SunpyPendingDeprecationWarning, sunpy.util.exceptions.SunpyUserWarning, sunpy.util.exceptions.SunpyWarning

sunpy.util.config Module

This module provides SunPy’s configuration file functionality.

Functions

load_config()

Read the “sunpyrc” configuration file.

print_config()

Print current configuration options.

sunpy.util.datatype_factory_base Module

This module provides the base registration factory used for all SunPy data/net factories.

Classes

BasicRegistrationFactory([…])

Generalized registerable factory type.

NoMatchError

Exception for when no candidate class is found.

MultipleMatchError

Exception for when too many candidate classes are found.

ValidationFunctionError

Exception for when no candidate class is found.

Class Inheritance Diagram

Inheritance diagram of sunpy.util.datatype_factory_base.BasicRegistrationFactory, sunpy.util.datatype_factory_base.NoMatchError, sunpy.util.datatype_factory_base.MultipleMatchError, sunpy.util.datatype_factory_base.ValidationFunctionError

sunpy.util.multimethod Module

This module provides multimethod implementation in pure Python.

Classes

TypeWarning

MultiMethod(get)

A multimethod is a callable object that decides which code to execute based on the type of one or more of its arguments.

Class Inheritance Diagram

Inheritance diagram of sunpy.util.multimethod.TypeWarning, sunpy.util.multimethod.MultiMethod

sunpy.util.net Module

This module provides general net utility functions.

Functions

slugify(text[, delim])

Slugify given unicode text.

get_content_disposition(content_disposition)

Get the content disposition filename from given header.

get_filename(sock, url)

Get filename from given urlopen object and URL.

get_system_filename(sock, url[, default])

Get filename from given urlopen object and URL.

download_file(url, directory[, default, …])

Download a file from a url into a directory.

download_fileobj(opn, directory[, url, …])

Download a file from a url into a directory.

check_download_file(filename, remotepath, …)

Downloads a file from a remotepath to a localpath if it isn’t there.

sunpy.util.xml Module

This module provides XML helper functions.

Functions

xml_to_dict(xmlstring)

Converts an XML string to a Python dictionary.

node_to_dict(node)

Scans through the children of the node and makes a dictionary from the content.

get_node_text(node)

Scans through all children of Element node and gathers the text.

Class Inheritance Diagram

Inheritance diagram of sunpy.util.xml.NotTextNodeError

sunpy.util.scraper Module

This module provides a web scraper.

Classes

Scraper(pattern, **kwargs)

A Scraper to scrap web data archives based on dates.

Class Inheritance Diagram

Inheritance diagram of sunpy.util.scraper.Scraper