Skip to main content
This guide uploads a small DataFrame and downloads it again.
Creating datasets requires a plan that lets you create assets. If you only want to read data, go to Downloading data.

Before you start

Get your API key from your settings and save it in the ALPHACAST_API_KEY environment variable. See Authentication.

The script

Save this as quickstart.py and run python quickstart.py.

What each step does

  • Create or reuse. returnIdIfExists=True returns the existing repository or dataset with the same name, so you can run the script again.
  • Initialize the columns. Tells Alphacast which column holds the date and which columns identify each row. You cannot change this with this method after the dataset has data.
  • Upload. Returns the response as bytes. The upload method does not raise on HTTP errors, so the script checks that the response is a process. If the response is not JSON, json.loads raises an error.
  • Wait. Uploads run in the background. The status starts at Requested.

Next steps

Uploading data

Upload options and merge flags.

Search

Find datasets to download.