Skip to main content

Station Python

Python SDK for sending simple app stats to Station.

Install

pip install station-python

Usage

import station_python as station

station.set_api_key("your-api-key")
station.set_debug(True)

station.track_count("page_view")
station.track_count("signup", 3)
station.track_value("checkout_total", 24.95)

station.capture_count("background_job_started")
station.capture_value("api_latency_ms", 142)

Instead of calling set_api_key, you can set the STATION_API_KEY environment variable before starting your app:

STATION_API_KEY=your-api-key python app.py

API

set_api_key(api_key)

Sets the Station API key used by subsequent events.

set_debug(enabled)

Enables or disables debug logging. Debug mode is disabled by default.

track_count(stat_name, value=1)

Sends a count event to Station. Use it for incrementing counters such as page views, clicks, signups, or other discrete events.

track_value(stat_name, value)

Sends a numeric value event to Station. Use it for measurements such as totals, durations, scores, or other numeric observations.

capture_count(stat_name, value=1)

Fire-and-forget version of track_count. It schedules the request and returns immediately.

capture_value(stat_name, value)

Fire-and-forget version of track_value. It schedules the request and returns immediately.

Network errors do not interrupt your application flow. Enable debug mode if you want failed event submissions logged during development or diagnostics. The client reuses keep-alive connections, applies a short request timeout, retries one transient network/server failure, and backs off after 429 rate limit responses.

Current Contract

The package posts to:

  • POST https://api.station.guide/v1/events/count
  • POST https://api.station.guide/v1/events/value

Request bodies use apiKey, statName, and value.

Development

uv sync --dev
uv run pytest

Metadata

Release files for station-python 1.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for station-python 1.0.0
File Size Uploaded
station_python-1.0.0.tar.gz 26.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for station-python 1.0.0
File Interpreter ABI Platform
station_python-1.0.0-py3-none-any.whl Python 3 none any Details

Total release size: 31.5 kB

Release files / station_python-1.0.0.tar.gz

Download URL station_python-1.0.0.tar.gz
Size 26.4 kB
Tags Source
SHA-256 checksum
How to use checksums
2dc78397388894eea97b139cbf48b406a7ebab58ea0d7dff2fe0464246662521
BLAKE2b-256 checksum
How to use checksums
10f7a5c01a72fd258791a2fd240fb96d7ff754b12003d45dcd3744d4ea650959
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.3

Release files / station_python-1.0.0-py3-none-any.whl

Download URL station_python-1.0.0-py3-none-any.whl
Size 5.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
4b9ddede8c217ccb166ef42b2cf54b3c7e603942fbb37deca437b1f2aa93b8e2
BLAKE2b-256 checksum
How to use checksums
4e8d6c52f04884a4d9e9f3e009b607c649a49252d6027e62716b96ab0b1bb706
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.3

Release history Release notifications | RSS feed

This release

1.0.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page