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/countPOST 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)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| station_python-1.0.0.tar.gz | 26.4 kB | Without provenance | Details for station_python-1.0.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| station_python-1.0.0-py3-none-any.whl | Python 3 | none | any | Details for station_python-1.0.0-py3-none-any.whl |
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
|
Security for station-python 1.0.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.