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.1.3.tar.gz (19.4 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.1.3-py3-none-any.whl (21.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: timecho_ai-0.1.3.tar.gz
  • Upload date:
  • Size: 19.4 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.1.3.tar.gz
Algorithm Hash digest
SHA256 bed8508e00f582913928475c212c3884d7f62d1bd3cacca653dffa0737c729f6
MD5 694c55d8868e54fdce63fa92dca39d35
BLAKE2b-256 657b050afd7ad0614b8e39df52a0f822e1dec51e077a71fdb67b5c3e42b40cb6

See more details on using hashes here.

File details

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

File metadata

  • Download URL: timecho_ai-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 21.2 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.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 bd0223059d0e97601625d314373609342b153d2ac82360fbdf0ed461b5a60b2b
MD5 70cbfb5b5ec2727f2e620059fc377a5a
BLAKE2b-256 bf5698696919f8da528b471391aea38183010eba0035c925987c1abf7f518fb3

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