woob.tools.config.sqliteconfig

class SQLiteConfig(path, commit_since_seconds=None, dump_since_seconds=None, last_run=True, logger=None)[source]

Bases: IConfig

commit_since_seconds = 3600
dump_since_seconds = 600
load(default={}, optimize=True)[source]

Load config.

Parameters:

default (dict[str]) – default values for the config (default: {})

save(commit_since_seconds=None, dump_since_seconds=None)[source]

Save config.

force_save()[source]
commit(**kwargs)[source]
dump(**kwargs)[source]
ensure_table(name)[source]
tables()[source]
items(table, size=100)[source]

Low memory way of listing all items. The size parameters alters how many items are fetched at a time.

keys(table, size=200)[source]

Low memory way of listing all keys. The size parameters alters how many items are fetched at a time.

count(table)[source]
get(*args, **kwargs)[source]

Get the value of an option.

Parameters:
  • args – path of the option key.

  • default – if specified, default value when path is not found

set(*args)[source]

Set a config value.

Parameters:

args (str or object) – all args except the last arg are the path of the option key.

delete(*args)[source]

Delete an option from config.

Parameters:

args (str) – path to the option key.

has(*args)[source]