Skip to content

Timenet.config

timenet.config source

Load TimeNet settings from arguments and TIMENET_* environment variables.

Explicit values override environment variables, which override defaults.

CACHE_TAG module-attribute source

CACHE_TAG = 'CACHEDIR.TAG'

The marker filename for cache folders created by TimeNet.

TimeNetSettings source

Bases: BaseSettings

TimeNet settings from arguments, TIMENET_* environment variables, and an optional .env file.

auto_build class-attribute instance-attribute source

auto_build: bool = True

Whether default sources include installed connectors (TIMENET_AUTO_BUILD).

cache class-attribute instance-attribute source

cache: str = '~/.cache/timenet'

The cache directory for raw downloads and control databases (TIMENET_CACHE).

cache_dir property source

cache_dir: Path

The cache directory path with ~ expanded.

control_cache_dir property source

control_cache_dir: Path

Where verified remote control databases are cached by checksum.

downloads_dir property source

downloads_dir: Path

The raw download cache directory, with a subdirectory for each dataset ID.

isolation class-attribute instance-attribute source

isolation: Literal['on', 'off'] = 'on'

Whether a build runs in an environment built from the connector's requirements.

"off" runs it in the current interpreter. The isolated child sets this to "off" in its own environment, which is what stops it re-execing forever.

local_registry class-attribute instance-attribute source

local_registry: str = '~/.timenet/registry'

The local registry path or file:// URI (TIMENET_LOCAL_REGISTRY).

local_registry_dir property source

local_registry_dir: Path

The local registry directory with ~ expanded.

Raises:

Type Description
TimeNetRegistryError

If the local registry path is blank, remote or uses an invalid URI.

model_config class-attribute instance-attribute source

model_config = SettingsConfigDict(
    env_prefix="TIMENET_", env_file=".env", extra="ignore"
)

remote_registry class-attribute instance-attribute source

remote_registry: str = 'timenet://'

The registry after the local registry in the default sources (TIMENET_REMOTE_REGISTRY).

token class-attribute instance-attribute source

token: str | None = None

Bearer token for a remote registry (TIMENET_TOKEN); None is anonymous.

is_cache_folder source

is_cache_folder(folder: Path) -> bool

Check a folder for TimeNet's CACHEDIR.TAG marker.

The check follows symlinks.

Parameters:

Name Type Description Default
folder Path

The folder to check.

required

Returns:

Type Description
bool

True if the marker's first two lines match TimeNet's cache tag.

make_cache_folder source

make_cache_folder(folder: Path) -> None

Create a cache folder with TimeNet's CACHEDIR.TAG marker.

Existing folders stay unchanged.

Parameters:

Name Type Description Default
folder Path

The cache folder to create along with any missing parents.

required

settings source

settings(**overrides: Any) -> TimeNetSettings

Load and validate the TimeNet settings.

Overrides other than None take precedence over environment variables and defaults.

Parameters:

Name Type Description Default
**overrides Any

Values by field name, with None values ignored.

{}

Returns:

Type Description
TimeNetSettings

The validated settings.

Raises:

Type Description
TimeFValidationError

If a value is invalid.