io
io
#
Analysis-side disk verbs: load a captured value, commit one, copy file paths.
commit(path, value, schema=None)
#
Write value rooted at path; unchanged leaves are left alone, none are removed.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
path
|
Path | str
|
Destination root. |
required |
value
|
object
|
The value to write. |
required |
schema
|
type[CGType] | dict[str, JSONValue] | None
|
The type to store |
None
|
Returns:
| Type | Description |
|---|---|
Path
|
The destination |
Source code in capturegraph-lib/capturegraph/types/io.py
copy(*, src, dst)
#
Copy files from source paths to destination paths.
Destination parent directories are created as needed. A missing or None source produces a Missing placeholder in the result instead of raising.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
src
|
Array
|
Array of source file paths. |
required |
dst
|
Array
|
Array of destination paths (same length as src). |
required |
Returns:
| Type | Description |
|---|---|
Array
|
Array of destination paths that were created. |
Source code in capturegraph-lib/capturegraph/types/io.py
load(path, schema)
#
Load a captured value from path according to schema.
File leaves resolve to their path (the media is opened only on demand), so a
load is metadata-weight; to read one slot of a large target without the rest,
point path and schema at the sub-tree.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
path
|
Path | str
|
The capture root on disk. |
required |
schema
|
type[CGType] | dict[str, JSONValue]
|
The type describing the data — a |
required |
Returns:
| Type | Description |
|---|---|
object
|
The loaded value — a |
object
|
attribute access for vectorized analysis. |