Skip to main content

Timberborn http api wrapper

Project description

Timberborn HTTP API Wrapper

A Python library for interacting with the Timberborn HTTP automation API. Supports both direct API control and webhook-based event handling.

Features

  • Control levers and adapters in your Timberborn game
  • Poll or watch for state changes
  • Webhook support for real-time events
  • Multiple interaction styles: OOP, decorators, and direct function calls

Installation

pip install timberborn-http

Quickstart

1. Direct API Control

from timberborn_http import TimberbornAPI

api = TimberbornAPI("http://localhost:8080")

# Get all levers
levers = api.get_levers()
for lever in levers:
    print(lever.name, lever.state)

# Control a lever
api.switch_on("Main Water Pump")
api.set_color("Main Water Pump", "ff0000")

2. Webhook Events

from timberborn_http import TimberbornWebhookServer

server = TimberbornWebhookServer()

@server.on("Main Water Pump")
def handle_on(name):
    print(f"{name} turned ON!")

server.start()

Documentation & Examples

Getting Help

Commands

  • python -m venv .venv
  • pip install -r requirements.txt
  • pip install -e .
  • python -m build
  • python3 -m twine upload --repository testpypi dist/*
  • python3 -m pip install --index-url https://test.pypi.org/simple/ --no-deps timberborn_http

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

timberborn_http-0.0.2.tar.gz (16.7 kB view details)

Uploaded Source

Built Distribution

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

timberborn_http-0.0.2-py3-none-any.whl (17.0 kB view details)

Uploaded Python 3

File details

Details for the file timberborn_http-0.0.2.tar.gz.

File metadata

  • Download URL: timberborn_http-0.0.2.tar.gz
  • Upload date:
  • Size: 16.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for timberborn_http-0.0.2.tar.gz
Algorithm Hash digest
SHA256 38421c2916ce84a2e9d1d347d0d52133d85f9ed8fb41e42cf96e44c5fd43d405
MD5 a6d6c8bd11627470cbe4ca15d6d20f33
BLAKE2b-256 9084f15cd4756d120ed8ce8fee377dff5f8312cc73dc43a3efe780ae913bcb81

See more details on using hashes here.

File details

Details for the file timberborn_http-0.0.2-py3-none-any.whl.

File metadata

File hashes

Hashes for timberborn_http-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 c8ebec586637383a9be297e53bc9cdcce706b483330bf72a2f6e82cd024730bf
MD5 da502eba3687a5ebc891fd5b42f0ab9a
BLAKE2b-256 098e8843655882fbcd330af47c3fc4ea06b067f8d607fb0546a7ff8cacb164a9

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