Skip to main content

A Python package for interacting with the thaink2 analytics APIs

Project description

th2analytics

PyPI version
License: MIT
Python Versions

th2analytics is a Python library that provides a simple and efficient wrapper for interacting with the thaink2 analytics APIs. It enables users to generate future forecasts rapidly while adapting to various types of data.


Features

  • Generate forecasts quickly using an intuitive interface.
  • Supports multiple forecasting models like ARIMA, XGBOOST, Random, and others.
  • Customizable parameters for forecast horizon, grouping, and target variables.
  • Lightweight and easy to integrate into existing workflows.

Installation

Install the package using pip:

pip install th2analytics

d,ldz,l,zdz

from th2analytics.forecasting import ForecastingAPI
import numpy as np
import pandas as pd

api_token = "************" # get your token here: https:\\opensource.thaink2.com\app\th2token


# Initialize the API wrapper
api = ForecastingAPI(
    base_url = "https://apis-dev.thaink2.fr/",
    api_token = api_token
)

np.random.seed(42)
dates = pd.date_range(start='2022-01-01', periods=100, freq='D')
values = np.random.randn(100).cumsum()
# Create a DataFrame from the generated data
input_data = pd.DataFrame({'date': dates, 'value': values})
# Generate the forecast
forecast = api.th2forecast_api(
    actuals = input_data,
    fcast_horizon = 30,
    group_target = None,
    target_var = "value",
    date_var = "date",
    models_list = ["xgboost"]
)
# Print the forecast
print("Forecast Results:", forecast)

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

th2analytics-0.0.3.tar.gz (3.0 kB view details)

Uploaded Source

Built Distribution

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

th2analytics-0.0.3-py3-none-any.whl (3.0 kB view details)

Uploaded Python 3

File details

Details for the file th2analytics-0.0.3.tar.gz.

File metadata

  • Download URL: th2analytics-0.0.3.tar.gz
  • Upload date:
  • Size: 3.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.13.1

File hashes

Hashes for th2analytics-0.0.3.tar.gz
Algorithm Hash digest
SHA256 349fe9cbfc52f71d5ef65de7957cc9248d75de6ef504aa84568d951aaf61bbea
MD5 fd915f6e3dd105354bced43dba4d2aa5
BLAKE2b-256 898f08261b6ae3f36284bd1b4def71dabfb674491316153a534d6028de86ac8d

See more details on using hashes here.

File details

Details for the file th2analytics-0.0.3-py3-none-any.whl.

File metadata

  • Download URL: th2analytics-0.0.3-py3-none-any.whl
  • Upload date:
  • Size: 3.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.13.1

File hashes

Hashes for th2analytics-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 a199b6f438611c902d31166f7e9357967e64d6d0e4888b613babbf88972bb313
MD5 b88c54d2c9190dab9cde47004306e3c3
BLAKE2b-256 1e41b500f625159653d15a6a77804637dda247e1493092b1534c2d836d3b27a2

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