Caching Functions¶
Functions for managing cache directories where Brahe stores downloaded data.
Main Cache Directory¶
get_brahe_cache_dir builtin ¶
get_brahe_cache_dir() -> str
Get the brahe cache directory path.
The cache directory is determined by the BRAHE_CACHE environment variable. If not set, defaults to ~/.cache/brahe.
The directory is created if it doesn't exist.
Returns:
| Name | Type | Description |
|---|---|---|
str | str | The full path to the cache directory. |
Raises:
| Type | Description |
|---|---|
IOError | If the cache directory cannot be created or accessed. |
Example
Note
The directory will be created on first access if it doesn't exist.
get_brahe_cache_dir_with_subdir builtin ¶
Get the brahe cache directory path with an optional subdirectory.
The cache directory is determined by the BRAHE_CACHE environment variable. If not set, defaults to ~/.cache/brahe. If a subdirectory is provided, it is appended to the cache path.
The directory is created if it doesn't exist.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
subdirectory | str or None | Optional subdirectory name to append to cache path. | required |
Returns:
| Name | Type | Description |
|---|---|---|
str | str | The full path to the cache directory (with subdirectory if provided). |
Raises:
| Type | Description |
|---|---|
IOError | If the cache directory cannot be created or accessed. |
Example
Note
The directory (and subdirectory) will be created on first access if it doesn't exist.
Specialized Cache Directories¶
get_eop_cache_dir builtin ¶
get_eop_cache_dir() -> str
Get the EOP cache directory path.
Returns the path to the EOP (Earth Orientation Parameters) cache subdirectory. Defaults to ~/.cache/brahe/eop (or $BRAHE_CACHE/eop if environment variable is set).
The directory is created if it doesn't exist.
Returns:
| Name | Type | Description |
|---|---|---|
str | str | The full path to the EOP cache directory. |
Raises:
| Type | Description |
|---|---|
IOError | If the cache directory cannot be created or accessed. |
Example
Note
The directory will be created on first access if it doesn't exist.
get_celestrak_cache_dir builtin ¶
get_celestrak_cache_dir() -> str
Get the CelesTrak cache directory path.
Returns the path to the CelesTrak cache subdirectory used for storing downloaded TLE data. Defaults to ~/.cache/brahe/celestrak (or $BRAHE_CACHE/celestrak if environment variable is set).
The directory is created if it doesn't exist.
Returns:
| Name | Type | Description |
|---|---|---|
str | str | The full path to the CelesTrak cache directory. |
Raises:
| Type | Description |
|---|---|
IOError | If the cache directory cannot be created or accessed. |
Example
Note
The directory will be created on first access if it doesn't exist.