example()

Download a ready-to-run example project.

Usage

Source

example(
    name,
    path=None,
)

The example’s raw data and recipes come from the useful-views-data repository, at the version this release of useful-views pins, and each file is checked against its SHA-256 before anything is written. The folder is then set up like init does. Make its views with useful-views sync.

Parameters

name: str

The example, such as "pwt" (Penn World Table extract).

path: str | Path | None = None
The folder to create; default "<name>-example". It must not exist, or be empty.

Returns

Path
The project folder, as an absolute path.

Raises

ExampleError

The name is unknown, the folder is not empty (or is your home folder or the top of a drive), a file could not be downloaded, or a checksum did not match. Nothing is written in those cases.

ProjectError
The folder is inside another project.