acia.config#

Filesystem credentials store for image sources.

ACIA reads image sequences through fsspec, which means a single uniform interface works for local files, SMB/SAMBA shares, S3, HTTP, FTP, … Each remote backend usually needs credentials (storage_options in fsspec terms). To avoid sprinkling secrets across user scripts, those credentials can be stored once in a per-user config file and are resolved automatically by resolve_storage_options.

Config file#

Location: <user_config_dir>/acia/credentials.toml where <user_config_dir> follows the OS convention (via platformdirs):

  • Linux: ~/.config/acia/

  • macOS: ~/Library/Application Support/acia/

  • Windows: %APPDATA%\acia\

The path can be overridden with the ACIA_CONFIG environment variable.

The file is TOML, keyed by [<protocol>."<host>"] with an optional [<protocol>] table holding protocol-wide defaults. Every key in a table is forwarded to fsspec as a storage_options entry, except the secret-resolution keys below, which are evaluated first (precedence: keyring -> env -> plaintext):

# OS keyring (most secure): password fetched from the OS secret store,
#   service = "smb://<host>", username = <username>
[smb."fileserver.lab"]
username = "jdoe"
domain   = "LAB"
keyring  = true

# env-var indirection: any *_env key resolves from the environment and is
#   stored under the stripped key name (password_env -> password)
[smb."other-host"]
username     = "svc"
password_env = "ACIA_OTHER_PW"

# plaintext (discouraged; file perms are checked, see below)
[s3."my-bucket"]
key    = "AKIA..."
secret = "..."
acia.config.resolve_storage_options(url, explicit=None)[source]#

Resolve fsspec storage_options for url from the credentials config.

Looks up the [<protocol>."<host>"] entry (falling back to a [<protocol>] default table) for the URL’s protocol and host, resolves any secret-indirection keys, and merges explicit options on top (explicit always wins).

For local paths or URLs without a remote protocol, returns the explicit options unchanged (an empty dict if none given), so existing local usage is unaffected.

Parameters:
Return type:

dict