SDKs overview
Time Door offers a programmatic interface for its time series and forecasting platform primarily through its official SDKs. These SDKs are designed to facilitate interaction with the Time Door API, enabling developers to integrate forecasting, anomaly detection, and predictive analytics capabilities directly into their applications and workflows. The core functionality includes data ingestion, model management, training execution, and prediction retrieval. The primary focus of Time Door's SDK offerings is on the Python ecosystem, reflecting its target audience of data scientists and machine learning engineers who frequently utilize Python for data manipulation and statistical modeling.
The SDKs abstract the underlying HTTP requests and response parsing, allowing developers to work with native language constructs. This approach aims to reduce the boilerplate code required to interact with RESTful APIs, which often involves handling authentication, request serialization, and response deserialization. For example, a common task like submitting a dataset for analysis or requesting a forecast can be executed with a few lines of SDK code, as opposed to constructing and sending raw HTTP requests. The official documentation provides comprehensive guides and examples for leveraging these SDKs effectively.
Time Door's API itself is well-documented, offering detailed schemas for requests and responses, which is crucial for developers building integrations or contributing to community efforts. The API reference serves as the authoritative source for all available endpoints and data models, complementing the SDKs by providing a foundational understanding of the service's capabilities. Understanding the underlying API structure can be beneficial even when using an SDK, as it clarifies the data flow and potential parameters.
Official SDKs by language
Time Door currently provides an official SDK for Python. This SDK is maintained by Time Door and is designed to offer a consistent and idiomatic interface for interacting with the Time Door API. The Python SDK simplifies common operations such as uploading datasets, initiating training jobs, and fetching forecasts or anomaly detection results.
| Language | Package Name | Install Command | Maturity |
|---|---|---|---|
| Python | timedoor-sdk |
pip install timedoor-sdk |
Stable |
The Python SDK is actively developed and maintained, with updates typically coinciding with new API features or improvements. Developers can find detailed API documentation, including request/response schemas and authentication methods, at the Time Door API reference. The availability of a robust Python SDK aligns with the common practices in the machine learning and data science communities, where Python is a prevalent language for data processing and model development.
Installation
To install the official Time Door Python SDK, developers typically use pip, the standard package installer for Python. Before installation, it is recommended to set up a virtual environment to manage project dependencies and avoid conflicts with system-wide Python packages. Virtual environments create isolated Python environments for each project, ensuring that dependencies for one project do not interfere with others. Tools like venv (built-in to Python 3.3+) or conda can be used for this purpose.
Python SDK Installation Steps:
-
Create a virtual environment (optional but recommended):
python -m venv my_timedoor_env source my_timedoor_env/bin/activate # On macOS/Linux # my_timedoor_env\Scripts\activate.bat # On Windows -
Install the Time Door SDK:
Once your virtual environment is activated, install the SDK using pip:
pip install timedoor-sdk -
Verify installation:
You can verify the installation by attempting to import the SDK in a Python interpreter:
python >>> import timedoor_sdk >>> print(timedoor_sdk.__version__)If no errors occur and a version number is printed, the SDK is successfully installed.
For more detailed installation instructions and troubleshooting, refer to the Time Door documentation on SDK installation.
Quickstart example
This quickstart example demonstrates how to use the Time Door Python SDK to upload a dataset, initiate a forecast, and retrieve the results. This example assumes you have an API key and a dataset in a compatible format (e.g., CSV with a timestamp column and a value column).
Before running this code, ensure you have your Time Door API key. You can typically find this in your Time Door Console settings.
import timedoor_sdk
import pandas as pd
import io
import os
# Replace with your actual API Key
API_KEY = os.environ.get("TIMEDOOR_API_KEY", "YOUR_TIMEDOOR_API_KEY")
# Initialize the client
client = timedoor_sdk.TimeDoorClient(api_key=API_KEY)
# 1. Prepare sample data (replace with your actual data source)
# Example: Daily sales data for a product
data_csv = """
timestamp,value
2023-01-01,100
2023-01-02,105
2023-01-03,110
2023-01-04,108
2023-01-05,112
2023-01-06,115
2023-01-07,120
2023-01-08,125
2023-01-09,122
2023-01-10,128
"""
df = pd.read_csv(io.StringIO(data_csv), parse_dates=['timestamp'])
# Save to a temporary CSV file for upload
df.to_csv("sample_sales_data.csv", index=False)
# 2. Upload the dataset
print("Uploading dataset...")
dataset_name = "my_product_sales"
response = client.datasets.upload_csv(
file_path="sample_sales_data.csv",
name=dataset_name,
timestamp_column="timestamp",
value_column="value"
)
dataset_id = response['dataset_id']
print(f"Dataset '{dataset_name}' uploaded with ID: {dataset_id}")
# 3. Create and train a forecasting model
print(f"Creating and training model for dataset ID: {dataset_id}...")
model_name = f"forecast_model_{dataset_name}"
model_response = client.models.create_and_train(
dataset_id=dataset_id,
model_name=model_name,
model_type="univariate_arima" # Example model type
)
model_id = model_response['model_id']
print(f"Model '{model_name}' created and training initiated with ID: {model_id}")
# Polling for training status (simplified, in real app use webhooks or more robust polling)
import time
print("Waiting for model training to complete...")
for _ in range(10):
status_response = client.models.get_status(model_id=model_id)
if status_response['status'] == 'trained':
print("Model training complete.")
break
print(f"Current status: {status_response['status']}. Retrying in 5 seconds...")
time.sleep(5)
else:
print("Model training timed out or failed.")
# 4. Generate a forecast
print(f"Generating forecast using model ID: {model_id}...")
forecast_horizon = 7 # Forecast for the next 7 periods
forecast_response = client.forecasts.generate(
model_id=model_id,
horizon=forecast_horizon
)
# 5. Print the forecast results
print("Forecast Results:")
for entry in forecast_response['predictions']:
print(f"Timestamp: {entry['timestamp']}, Predicted Value: {entry['predicted_value']:.2f}")
# Clean up the temporary file
os.remove("sample_sales_data.csv")
This example covers the fundamental steps: authentication, data preparation and upload, model creation and training, and forecast generation. For more advanced features, such as hyperparameter tuning, anomaly detection configurations, or integrating with other data sources, refer to the Time Door Python SDK guide.
The Python SDK's design aims to facilitate common machine learning workflows, particularly those involving time series data. Its object-oriented structure allows developers to interact with datasets, models, and forecasts as distinct entities, mirroring the underlying API resources. For a general understanding of SDK design principles, resources like Google Cloud's SDK design guidelines can provide context on how such libraries are typically structured to enhance developer experience.
Community libraries
As of the current information, Time Door has not officially recognized or cataloged a significant number of community-contributed libraries or SDKs. The primary focus for external integrations remains the official Python SDK and direct API interaction.
Community libraries often emerge when a platform gains widespread adoption and developers create specialized tools, wrappers, or integrations for languages and frameworks not officially supported, or to extend functionality. These can include:
- Language-specific wrappers: SDKs for languages other than Python (e.g., JavaScript, Go, Ruby) that mimic the official SDK's functionality.
- Framework integrations: Libraries that integrate Time Door with popular web frameworks (e.g., Django, Flask) or data science platforms.
- Specialized tools: Utilities for specific data preprocessing tasks, visualization, or custom reporting that leverage Time Door's API.
Developers interested in contributing to the Time Door ecosystem or creating their own libraries are encouraged to consult the Time Door API reference. Building a community library typically involves understanding the API's authentication mechanisms, request/response formats (often JSON), and error handling procedures. Adherence to best practices for API client development, such as robust error handling, clear documentation, and adherence to the platform's terms of service, is essential for any community-driven project.
While official support might be limited to the Python SDK, the open nature of APIs allows for external development. Platforms like GitHub are common repositories for such community-driven projects, where developers can share, collaborate on, and discover third-party integrations. However, users should exercise due diligence when using unofficial libraries, as their maintenance, security, and compatibility with the latest API versions are not guaranteed by Time Door.
For platforms that do support and encourage community contributions, programs like developer grants, hackathons, or dedicated sections on their documentation portals are common. As Time Door evolves, such initiatives might be introduced to foster a broader developer ecosystem.