from nolano import Nolano
import pandas as pd
# Initialize the client
client = Nolano(api_key="your_api_key_here")
# Or set environment variable: NOLANO_API_KEY=your_api_key_here
client = Nolano()
# Verify API key (recommended)
verification = client.verify_api_key()
if not verification['valid']:
print(f"API key issue: {verification['message']}")
exit(1)
print("✅ API key verified successfully!")
# Prepare your time series data
df = pd.DataFrame({
'date': pd.date_range(start='2023-01-01', periods=100, freq='D'),
'sales': [100, 102, 98, 105, 110, 108, 115, 120, 125, 130, 128, 135, 140, 145, 150, 155, 160, 165, 170, 175, 180, 185, 190, 195, 200, 205, 210, 215, 220, 225, 230, 235, 240, 245, 250, 255, 260, 265, 270, 275, 280, 285, 290, 295, 300, 305, 310, 315, 320, 325, 330, 335, 340, 345, 350, 355, 360, 365, 370, 375, 380, 385, 390, 395, 400, 405, 410, 415, 420, 425, 430, 435, 440, 445, 450, 455, 460, 465, 470, 475, 480, 485, 490, 495, 500, 505, 510, 515, 520, 525, 530, 535, 540, 545, 550, 555, 560, 565, 570, 575]
})
# Generate forecast
forecast = client.forecast(
dataset=df,
target_col='sales',
timestamp_col='date',
forecast_horizon=30,
data_frequency='Daily'
)
print(f"Forecast: {forecast.median}")
print(f"Lower bound: {forecast.lower_bound}")
print(f"Upper bound: {forecast.upper_bound}")