Quickstart (CLI)
This section covers ingesting, querying, and publishing data using the Airfold CLI.
Overview
In this guide, we’ll develop an API to identify the top-mentioned features in sales calls.
We’ll process web events data to extract top referrers using the sample web events CSV file.
Our steps include:
- Ingesting the dataset
- Executing queries to get the top 3 referrers
- Exposing the features through an API
Create a Workspace
Before we begin, we need to create a workspace to store our data and resources, as well as a token to authenticate our CLI.
- Go to Airfold and create a new workspace.
- Copy an admin token from the workspace’s Keys page.
The token should look like this: aft_6eab8fcd902e4cbfb63ba174469989cd.Ds1PME5dQsJKosKQWVcZiBSlRFBbmhzIocvHg8KQddV
.
Set up the CLI.
- Install the CLI using
pip install airfold-cli
. - Run
af config
and paste your token when prompted.
Create a Source
First, download web_events_sample.csv
To create a source, a YAML file defining the source is required.
Let’s generate a source by inferring the schema from a CSV file.
(Replace /path/to/web_events_sample.csv
with the actual path):
The CLI will infer the schema from the CSV file and generate a YAML file with the following contents:
Push the source definition to your workspace:
At this point, our source has been created, but no data has been ingested yet.
Verify creation by listing sources:
Ingest Data
With the source set up, ingest the CSV data:
Further Analysis with Pipes
To identify top referrers in web events data, create an insights.yaml
file:
Push the insights pipe:
Query Results
Use the API:
Or the CLI:
Which should output:
Next Steps
You’ve successfully ingested, analyzed, and published data using Airfold in a few simple steps! This workflow enables intuitive interaction with data, transforming raw web events data into actionable insights.
Feel free to dive deeper into specific concepts, such as workspaces, sources, and more!