Reference/API#

astropy.config Package#

This module contains configuration and setup utilities for the Astropy project.

Functions#

create_config_file(pkg[, rootname, overwrite])

Create the default configuration file for the specified package.

generate_config([pkgname, filename, verbose])

Generates a configuration file, from the list of ConfigItem objects for each subpackage.

get_cache_dir([rootname])

Determines the Astropy cache directory name and creates the directory if it doesn't exist.

get_cache_dir_path([rootname])

Determines the Astropy cache directory name and creates the directory if it doesn't exist.

get_config([packageormod, reload, rootname])

Gets the configuration object or section associated with a particular package or module.

get_config_dir([rootname])

Determines the package configuration directory name and creates the directory if it doesn't exist.

get_config_dir_path([rootname])

Determines the package configuration directory name and creates the directory if it doesn't exist.

reload_config([packageormod, rootname])

Reloads configuration settings from a configuration file for the root package of the requested package/module.

Classes#

ConfigItem([defaultvalue, description, ...])

A setting and associated value stored in a configuration file.

ConfigNamespace()

A namespace of configuration items.

InvalidConfigurationItemWarning

A Warning that is issued when the configuration value specified in the astropy configuration file does not match the type expected for that configuration value.

set_temp_cache([path, delete])

Context manager to set a temporary path for the Astropy download cache, primarily for use with testing (though there may be other applications for setting a different cache directory, for example to switch to a cache dedicated to large files).

set_temp_config([path, delete])

Context manager to set a temporary path for the Astropy config, primarily for use with testing.

Class Inheritance Diagram#

Inheritance diagram of astropy.config.configuration.ConfigItem, astropy.config.configuration.ConfigNamespace, astropy.config.configuration.InvalidConfigurationItemWarning, astropy.config.paths.set_temp_cache, astropy.config.paths.set_temp_config