Skip to main content
`Ctrl`+`K`

# 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, ensure_exists]) | Determines the cache directory associated with a namespace and, optionally, creates the directory if it doesn't exist.
`get_cache_dir_path`([rootname, ensure_exists]) | Determines the cache directory associated with a namespace and, optionally, 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, ensure_exists]) | Determines the configuration directory associated with a namespace and creates the directory if it doesn't exist.
`get_config_dir_path`([rootname, ensure_exists]) | Determines the configuration directory associated with a namespace 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.
`temporary_cache_dir_path`([dir_, suffix, ...]) | A context manager to create a temporary directory and define it as the cache directory associated with some namespace.
`temporary_config_dir_path`([dir_, suffix, ...]) | A context manager to create a temporary directory and define it as the configuration directory associated with some namespace.

### 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