Skip to main content

Python CLI SDK for Timecho AI API

Project description

Timecho AI

PyPI version Python License

Python SDK for Timecho AI time series forecasting API. Provides both synchronous and asynchronous clients.

Installation

pip install timecho_ai

Quick Start

Synchronous Client

import pandas as pd
from timecho_ai import TimechoAIClient

# Load your time series data
df = pd.read_csv("your_data.csv")

# Create a client
client = TimechoAIClient(api_key="your-api-key")

# Test connectivity
print(client.hello_timer(name="World"))

# Univariate forecast
results = client.forecast(
    targets=df[["time", "OT"]][:2880],
    output_length=720,
)
print(results[0].head())

# Forecast with covariates
results = client.forecast(
    targets=df[["time", "OT"]][:2880],
    history_covs=df[["time", "hufl", "hull", "mufl", "mull", "lufl", "lull"]][:2880],
    future_covs=df[["time", "hufl", "hull", "mufl", "mull", "lufl", "lull"]][2880:3600],
    output_length=720,
)
print(results[0].head())

Asynchronous Client

import asyncio
import pandas as pd
from timecho_ai import TimechoAIAsyncClient

async def main():
    df = pd.read_csv("your_data.csv")

    async with TimechoAIAsyncClient(api_key="your-api-key") as client:
        print(await client.hello_timer(name="World"))

        results = await client.forecast(
            targets=df[["time", "OT"]][:2880],
            output_length=720,
        )
        print(results[0].head())

asyncio.run(main())

Configuration

The client can be configured via constructor parameters or environment variables:

Parameter Environment Variable Default Description
api_key TIMER_CLIENT_API_KEY - API key for authentication (required)
base_url TIMER_CLIENT_BASE_URL https://ai.timecho.com API base URL
timeout TIMER_CLIENT_TIMEOUT 30.0 Request timeout in seconds
export TIMER_CLIENT_API_KEY="your-api-key"
from timecho_ai import TimechoAIClient

# API key is read from environment variable automatically
client = TimechoAIClient()

Forecast API

The forecast method accepts the following parameters:

Parameter Type Required Description
targets DataFrame Yes Target time series with a time column and one or more value columns
history_covs DataFrame No Historical covariates (same length as targets)
future_covs DataFrame No Future covariates (same length as output_length)
model_id str No Model identifier
output_length int No Forecast horizon (default: 96)
output_start_time Timestamp No Start time of the forecast output
output_interval str No Time interval of the forecast output
time_col str No Name of the time column (auto-detected if not specified)
auto_adapt bool No Auto-adapt covariate lengths (default: True)

Returns a list of DataFrame, one per forecast task.

License

Apache License 2.0

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

timecho_ai-0.2.0.tar.gz (20.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

timecho_ai-0.2.0-py3-none-any.whl (22.6 kB view details)

Uploaded Python 3

File details

Details for the file timecho_ai-0.2.0.tar.gz.

File metadata

  • Download URL: timecho_ai-0.2.0.tar.gz
  • Upload date:
  • Size: 20.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/8.7.1 pkginfo/1.12.1.2 requests/2.32.5 requests-toolbelt/1.0.0 tqdm/4.67.1 CPython/3.11.11

File hashes

Hashes for timecho_ai-0.2.0.tar.gz
Algorithm Hash digest
SHA256 efaa36c53857367623b3d90590040e4fd4482bf5f12044f22144f0e40c75e177
MD5 bcab37ae517748c5f1dd6424614fbcb5
BLAKE2b-256 7915c105a27c7d1353de2547250ee573044a450e2401c64bc66d058663966b06

See more details on using hashes here.

File details

Details for the file timecho_ai-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: timecho_ai-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 22.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/8.7.1 pkginfo/1.12.1.2 requests/2.32.5 requests-toolbelt/1.0.0 tqdm/4.67.1 CPython/3.11.11

File hashes

Hashes for timecho_ai-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 92a43a9cff99495bf00f0c2567db617915af486c25ce5b534ed9cf37933a5220
MD5 610e14873c2e6b6a60e4c1eefcdf5a1a
BLAKE2b-256 85de31528527bbb96f99d34ab0544c0184045891fefa14c8b0827d8db6987afa

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page