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.1.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.1-py3-none-any.whl (22.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: timecho_ai-0.2.1.tar.gz
  • Upload date:
  • Size: 20.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.11

File hashes

Hashes for timecho_ai-0.2.1.tar.gz
Algorithm Hash digest
SHA256 cf5d40cea8c296a059174b6a922f84a2460312e43142d28332d75c47ca69bdb7
MD5 65495db16b3410a0b220ac686851181d
BLAKE2b-256 db95cbf30c52fa984e4033461af718aae19859bf8d25e08935189d02fed349c1

See more details on using hashes here.

File details

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

File metadata

  • Download URL: timecho_ai-0.2.1-py3-none-any.whl
  • Upload date:
  • Size: 22.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.11

File hashes

Hashes for timecho_ai-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 9913855225ee09a80cf31e0ed8035ad31fbda876c4ca358344a86c72093b57ea
MD5 b3376cff9175b82e735fd5490895601e
BLAKE2b-256 727a011fedbddd889911794df20e8974b025a02f760c05d53d5168c0196e6eae

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