Skip to main content
Every dataset in Alphacast lives inside a repository. Repositories control privacy (Public vs Private) and grant permissions to users. The SDK exposes repository operations through the repository attribute on the Alphacast client.
For the conceptual overview of what a repository is and how permissions work, see Repositories in the Documentation tab.

List your repositories

read_all() returns every repository where you have at least read permission, including public repositories you have explicitly subscribed to.
The response is a list of dicts. Each dict includes at least id, name, description, privacy, slug, and permission.

Look up a repository by ID

Use this when you already have the repository ID — for example from a previous create() call or from the URL https://www.alphacast.io/repositories/{id} in the Alphacast UI.

Look up a repository by name

read_by_name scans the list returned by read_all() and returns the first repository whose name matches exactly. If no repository matches, it returns False.
Name lookup is case-sensitive and matches the exact string. If you have repositories with similar names, prefer looking them up by ID.

Create a repository

Parameters

str
required
Display name for the repository. Must be unique within your account.
str
Long-form description shown on the repository page. Defaults to repo_name if omitted.
str
default:"Private"
"Private" or "Public". Public repositories are discoverable by all Alphacast users.
str
URL-safe identifier used in the repository’s web URL. Defaults to a slugified version of repo_name if omitted.
bool
default:"False"
Controls behavior when a repository with the same repo_name already exists. When True, the existing repository is returned. When False, a ValueError is raised.

Idempotent create

Pass returnIdIfExists=True to make repository creation safe to re-run — for example in a script that bootstraps an environment:
The first run creates the repository; subsequent runs return the existing one without raising.

Delete a repository

Deleting a repository permanently removes the repository and every dataset inside it, including all uploaded data. This action cannot be undone.
Pass the repository’s numeric ID. The call returns the raw response body from the API as bytes — the SDK does not parse it.

Common patterns

Find or create

When you want a single canonical repository for a workflow:
Or, equivalently, with returnIdIfExists:

List only repositories you can write to

read_all() returns repositories where you have any permission. Filter on the permission field to keep only writeable ones:

Next steps