Skip to content

API reference / Reading and ingest

tsdive.write_demo_data

write_demo_data(
    directory: str | Path = DEFAULT_DIR,
) -> list[Path]

Write the demo archives under directory and return their paths.

The two profile archives go to directory/demo/ and the three switchback tags to directory/switchback_demo/. write_demo_data("data") writes the paths the README and the docs examples read.

Raises:

Type Description
FileExistsError

one of the archives exists already; nothing is written.

Examples:

>>> import tsdive
>>> for path in tsdive.write_demo_data("tsdive-demo"):
...     print(path.as_posix())
tsdive-demo/demo/fic101_demo.parquet
tsdive-demo/demo/tic101_demo.parquet
tsdive-demo/switchback_demo/ti201.parquet
tsdive-demo/switchback_demo/fi200.parquet
tsdive-demo/switchback_demo/tt001.parquet
>>> str(tsdive.profile("tsdive-demo/demo/fic101_demo.parquet").identity)
'demo:FIC101.PV'