Configuration
Speasy can be configured through the config module, environment variables, or by editing an INI file directly.
For any entry, the environment variable (named SPEASY_<SECTION>_<ENTRY>) takes precedence over the config
file, which takes precedence over the built-in default.
The configuration file is an INI file located in your platform’s user config directory:
~/.config/speasy/config.ini on Linux, ~/Library/Application Support/speasy/config.ini on macOS,
%LOCALAPPDATA%\LPP\speasy\config.ini on Windows (the LPP author segment only appears on Windows).
You can also find the exact path programmatically:
>>> import speasy as spz
>>> print(spz.config.SPEASY_CONFIG_FILE)
To display the current configuration:
>>> import speasy as spz
>>> spz.config.show()
Core section
Disabling data providers
Sometimes you may want to disable some data providers either to speed up Speasy import or because you don’t need them.
This can be done by adding the provider name to the disabled_providers list in the configuration file.
Valid names are amda, csa, cda (alias cdaweb), ssc (alias sscweb),
archive (alias generic_archive), uiowaephtool (alias UiowaEphTool) and
cdpp3dview (alias 3DView).
The value you set replaces the default rather than adding to it: the default is empty (every provider
enabled), so setting disabled_providers = amda disables only AMDA.
For example, to disable AMDA and CDAWeb, add the following to the configuration file:
[CORE]
disabled_providers = amda,cdaweb
Or from Python:
>>> import speasy as spz
>>> spz.config.core.disabled_providers.set('amda,cdaweb')
Other core entries
Entry / env var |
Default |
Purpose |
|---|---|---|
|
|
A Python dict literal of URL prefixes to rewrite before sending requests
(e.g. |
|
|
User agent string sent with HTTP requests. Empty uses Speasy’s default user agent. |
|
|
Maximum number of connections to keep in the underlying |
|
|
Maximum number of connection pools kept by |
|
(empty) |
Comma-separated list of extra directories to scan for user-defined codecs. |
Proxy section
Speasy can go through the SciQLop community proxy, a caching server shared by all Speasy users that avoids redundant downloads of the same data. This is unrelated to a corporate/network HTTP proxy — see Connecting behind an HTTP proxy below for that.
Entry / env var |
Default |
Purpose |
|---|---|---|
|
|
Whether to use the Speasy caching proxy at all. |
|
|
URL of the Speasy caching proxy server. |
[PROXY]
enabled = true
url = https://sciqlop.lpp.polytechnique.fr/cache
Or from Python:
>>> import speasy as spz
>>> spz.config.proxy.enabled.set(True)
>>> spz.config.proxy.url.set('https://sciqlop.lpp.polytechnique.fr/cache')
Cache section
Entry / env var |
Default |
Purpose |
|---|---|---|
|
platform user cache dir |
Where Speasy stores the local disk cache. |
|
|
Maximum cache size in bytes. |
|
|
Trades the migration rollback backup for lower peak disk usage — see Migrating with limited disk space below. |
The default cache path follows your platform’s user cache directory: ~/.cache/speasy on Linux,
~/Library/Caches/speasy on macOS, %LOCALAPPDATA%\LPP\speasy\Cache on Windows (the LPP
author segment only appears on Windows). Read the current value with spz.config.cache.path.get().
[CACHE]
path = /path/to/cache
size = 1e9
Or from Python:
>>> import speasy as spz
>>> spz.config.cache.path.set('/path/to/cache')
>>> spz.config.cache.size.set(1e9)
Inspecting and clearing the cache
>>> from speasy.core.cache import cache_len, cache_disk_size, entries, drop_item, drop_matching_entries
>>> cache_len()
130169
>>> cache_disk_size()
78207505517
>>> list(entries())[:1]
['UiowaEphTool_orbits/Callisto_Cassini_Co-rotational/2010-01-01T00:00:00+00:00']
>>> drop_item(list(entries())[0])
>>> drop_matching_entries(".*amda.*")
>>> # clears every entry
>>> drop_matching_entries(".*")
If your data still looks stale after clearing the cache, remember the local cache is only one layer:
the Speasy proxy may also be serving a cached response, and provider-specific
caches (e.g. AMDA’s user_cache_retention) apply on top.
Migrating an older cache
Speasy’s local disk cache is backed by pysciqlop-cache,
a native cache library, replacing the pure-Python diskcache package used in older Speasy versions.
If you had already used an older Speasy version, the first import of the new version detects your
existing diskcache-format cache and migrates it automatically:
This is a one-time operation and can take a few minutes for a large cache; subsequent imports are unaffected.
Your old cache is renamed to
<cache path>.diskcache.backupand kept alongside the new one. Speasy reminds you with a warning on every import for as long as a backup still exists.Speasy still depends on
diskcacheprecisely so this migration can run out of the box, with no extra install step needed. In the unlikely case it’s unavailable in your environment (e.g. a custom install with--no-deps), Speasy logs a warning and starts a fresh cache instead of migrating; your old cache is left untouched on disk and nothing is lost.If you switch back to a pre-1.8 Speasy version after already migrating (which doesn’t know about sciqlop-cache, so it writes its own fresh
diskcachealongside the live cache) and fetch new data, the next 1.8+ import detects and merges those new entries into the live cache automatically — you won’t lose anything by switching back and forth.
Once you’ve confirmed the new cache works, delete the backup(s) with:
>>> from speasy.core.cache import migration_backups, delete_migration_backups
>>> migration_backups()
['/home/user/.cache/speasy/Cache.diskcache.backup', '/home/user/.local/share/speasy/index.diskcache.backup']
>>> delete_migration_backups()
['/home/user/.cache/speasy/Cache.diskcache.backup', '/home/user/.local/share/speasy/index.diskcache.backup']
delete_migration_backups() only ever removes these .diskcache.backup directories, never a live cache.
Note
Speasy has no compiled pysciqlop-cache build for WASM/Pyodide (e.g. JupyterLite); on that
platform caching is transparently disabled (a no-op cache) rather than causing an import error.
Migrating with limited disk space
By default, migration is a copy: your old cache is renamed to <cache path>.diskcache.backup
and kept fully intact while every entry is also written into the new cache — so for a short window,
both copies exist on disk at once (roughly double the cache’s size in free space needed).
If disk space is tight, set migrate_by_moving to move instead: each entry is deleted from the
old cache as soon as it’s written to the new one, so at most one entry’s worth of duplication ever
exists at a time.
[CACHE]
migrate_by_moving = true
Warning
Moving trades away the rollback safety net: once an entry is moved, it’s gone from the old cache, so there’s nothing left to fall back to if the new cache turns out to have a problem afterwards. Prefer the default (copy) unless you’re genuinely short on disk space.
Index section
Entry / env var |
Default |
Purpose |
|---|---|---|
|
platform user data dir + |
Where Speasy stores its product index database. |
CDAWeb section
Entry / env var |
Default |
Purpose |
|---|---|---|
|
platform user data dir + |
Where Speasy caches the CDAWeb inventory. |
|
|
|
AMDA section
Entry / env var |
Default |
Purpose |
|---|---|---|
|
|
Your AMDA username. Once set (together with |
|
|
Your AMDA password. |
|
|
Cache retention, in seconds, for AMDA requests such as |
|
|
Maximum request duration in days; longer requests are automatically split into smaller ones. |
|
|
Base URL of the AMDA web service. |
|
|
File format requested from AMDA. Only |
For example, from Python:
>>> import speasy as spz
>>> spz.config.amda.username.set('my_amda_username')
>>> spz.config.amda.password.set('my_amda_password')
Archive section
Entry / env var |
Default |
Purpose |
|---|---|---|
|
(empty) |
Comma-separated list of extra directories the Direct Archive provider scans for YAML inventory files, beyond its default user directory. See Direct archive access. |
Inventories section
Entry / env var |
Default |
Purpose |
|---|---|---|
|
|
Maximum age, in days, Speasy keeps a provider’s inventory cached before re-fetching it. |
Connecting behind an HTTP proxy
If your network requires going through a forward HTTP proxy to reach the internet, Speasy honors the
standard HTTP_PROXY environment variable for its HTTP traffic. Note that HTTPS_PROXY is not
currently read — set HTTP_PROXY even for HTTPS requests. This is unrelated to the Speasy caching
proxy described in the Proxy section above.