Learn how to fetch data using the WaveAssist SDK.
Basic Usage
import waveassist
# Fetch a string
message = waveassist.fetch_data("welcome_message")
print(message) # "Hello, World!"
# Fetch a dictionary
user_data = waveassist.fetch_data("user_profile")
print(user_data["name"]) # "Alice"
Fetching DataFrames
import waveassist
# Fetch a DataFrame
df = waveassist.fetch_data("user_scores")
print(df.head()) # Displays the DataFrame
Function Parameters
Parameter | Type | Required | Description |
---|
key | string | Yes | Key of the data to retrieve |
environment | string | No | Override default environment |
Error Handling
try:
data = waveassist.fetch_data("missing_key")
except waveassist.KeyNotFoundError:
print("Data not found")
except waveassist.FetchError as e:
print(f"Failed to fetch data: {e}")
Type Handling
The SDK automatically handles type conversion:
# Original data types are preserved
string_data = waveassist.fetch_data("text_key") # returns str
dict_data = waveassist.fetch_data("dict_key") # returns dict
df_data = waveassist.fetch_data("dataframe_key") # returns pd.DataFrame