dalva
dalva.init
init(
project: str,
name: str | None = None,
config: dict | None = None,
resume_from: str | None = None,
fork_from: str | None = None,
copy_tables_on_fork: bool | list[int] = False,
server_url: str = "http://localhost:8000",
outbox_dir: Path | None = None,
http_timeout: float | None = None,
) -> Run
Initialize a new run.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
project
|
str
|
Project name |
required |
name
|
str | None
|
Optional run name (user-defined, for display purposes only) |
None
|
config
|
dict | None
|
Optional configuration dictionary |
None
|
resume_from
|
str | None
|
run_id to resume (omit to create a new run) |
None
|
fork_from
|
str | None
|
run_id to fork from (creates a copy with configs/metrics) |
None
|
copy_tables_on_fork
|
bool | list[int]
|
False (no tables), True (all tables), or list of table IDs. Only used when fork_from is set. |
False
|
server_url
|
str
|
Server URL. Defaults to http://localhost:8000 |
'http://localhost:8000'
|
outbox_dir
|
Path | None
|
Directory for WAL files. Defaults to ~/.dalva/outbox/ |
None
|
http_timeout
|
float | None
|
HTTP timeout in seconds. Defaults to None (no timeout). |
None
|
Returns:
| Type | Description |
|---|---|
Run
|
Run object |
Example
Source code in backend/src/dalva/__init__.py
dalva.table
table(
project: str,
schema: type[DalvaSchema] | None = None,
name: str | None = None,
config: dict | None = None,
run_id: str | None = None,
resume_from: str | None = None,
server_url: str = "http://localhost:8000",
outbox_dir: Path | None = None,
http_timeout: float | None = None,
) -> Table
Initialize a new table or resume an existing one.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
project
|
str
|
Project name |
required |
schema
|
type[DalvaSchema] | None
|
A DalvaSchema subclass defining the table columns. Required unless
resuming an existing table via |
None
|
name
|
str | None
|
Optional table name (user-defined, for display purposes only) |
None
|
config
|
dict | None
|
Optional configuration dictionary |
None
|
run_id
|
str | None
|
Optional run_id to link this table to a run |
None
|
resume_from
|
str | None
|
table_id to resume (omit to create a new table) |
None
|
server_url
|
str
|
Server URL. Defaults to http://localhost:8000 |
'http://localhost:8000'
|
outbox_dir
|
Path | None
|
Directory for WAL files. Defaults to ~/.dalva/outbox/ |
None
|
http_timeout
|
float | None
|
HTTP timeout in seconds. Defaults to None (no timeout). |
None
|
Returns:
| Type | Description |
|---|---|
Table
|
Table object |