Skip to main content
A flat, scannable reference for everything in alphacast. Every method is documented in detail on its own page; this page is for quick lookup.
from alphacast import Alphacast

alphacast = Alphacast("YOUR_API_KEY")

Alphacast(api_key)

The top-level client. Holds your API key and exposes the four sub-clients.
AttributeTypeDescription
repositoryRepositoryRepository operations.
datasetsDatasetsDataset listing and creation.
searchSearchCatalog search.
series(series_id)SeriesSeries handle. Returns a fresh Series each call.

Repository

Documented on the Repositories page.
MethodReturnsDescription
read_all()list[dict]Every repository visible to your API key.
read_by_id(repository_id)dictOne repository by numeric ID.
read_by_name(repo_name)dict | FalseFirst repository whose name matches exactly. Returns False when not found.
create(repo_name, repo_description=None, privacy="Private", slug=None, returnIdIfExists=False)dictCreate a new repository.
delete(repository_id)bytesDelete a repository and all its datasets.

Datasets

Documented on the Datasets page (collection-level methods) and Uploading data (create).
MethodReturnsDescription
read_all()list[dict]Every dataset where you have owner / admin / write permission.
read_by_name(dataset_name, repo_id=None)dict | NoneFirst dataset whose name matches. Pass repo_id to disambiguate.
create(dataset_name, repo_id, description="", returnIdIfExists=False)dictCreate an empty dataset in a repository.
dataset(dataset_id)DatasetPer-dataset handle (see below).

Dataset (per-dataset handle)

Returned by alphacast.datasets.dataset(id). Each call constructs a fresh handle bound to the given ID.

Read methods

MethodReturnsDocumented at
metadata()dictdatasets.mdx
get_column_definitions()list[dict]datasets.mdx
datestats()bytesdatasets.mdx
download_data(format="csv", startDate=None, endDate=None, filterVariables=[], filterEntities=[])depends on formatdownloading.mdx

Write methods

MethodReturnsDocumented at
initialize_columns(dateColumnName, entitiesColumnNames, dateFormat)bytesuploading.mdx
upload_data_from_df(df, deleteMissingFromDB=False, onConflictUpdateDB=False, uploadIndex=True, dateColumnName=None, dateFormat=None, entitiesColumnNames=None, stringColumnNames=None, acceptNewColumns=None)bytesuploading.mdx
upload_data_from_csv(csv, deleteMissingFromDB=False, onConflictUpdateDB=False, dateColumnName=None, dateFormat=None, entitiesColumnNames=None, stringColumnNames=None, acceptNewColumns=None)bytesuploading.mdx
delete()bytesdatasets.mdx

Process

MethodReturnsDocumented at
processes()bytesprocesses.mdx
process(process_id)bytesprocesses.mdx
Documented on the Search page.
MethodReturnsDescription
datasets(query, offset=0, length=10, repository_id=None, search_all=False, exclude_deprecated=False)dictFull-text search. Returns {data, totalItems, totalPages, currentPage, offset}.

Series

Documented on the Series page.
MethodReturnsDescription
metadata()dictSeries metadata — name, units, frequency, parent dataset.
download_data(format="csv")depends on formatSeries values. Same format options as Dataset.download_data.

Conventions

  • Mutating methods return bytes. The SDK returns the raw API response body for initialize_columns, upload_data_from_*, delete, processes, process, and get_connector_run. Decode and json.loads(...) if you need a dict.
  • Read methods return parsed JSON. read_all, read_by_id, metadata, get_column_definitions, and search.datasets return Python dicts/lists directly.
  • download_data is special. Its return type depends on format: bytes for CSV/XLSX/TSV, list of dicts for JSON, pandas.DataFrame for pandas.
  • All methods raise Exception on HTTP errors (status not OK). The message includes the status code and any server-provided error message.

Source

The SDK is open source. Full source: github.com/Alphacastio/alphacast-python-sdk/blob/main/alphacast/alphacast.py.