Typed Python client for the SignTraker API
Project description
signtraker
A typed, production-grade Python client for the SignTraker API.
- Layered design: a shared HTTP transport (
BaseClient) plus one thin client per resource group. - Typed throughout: full type hints, Pydantic v2 models, and a shipped
py.typedmarker. - Friendly errors: HTTP status codes map to a typed exception hierarchy.
- OData querying: ergonomic
filter/top/skip/orderby/selectkeywords.
Installation
pip install signtraker
Optional .env support:
pip install "signtraker[dotenv]"
Authentication
The API uses an API key sent as Authorization: ST-API <key>. Find your key in
SignTraker under My Profile (contact your administrator if API access is not
enabled).
The API host is tenant-specific (https://<subdomain>.signtraker.com), so you
must provide either a subdomain or a full base_url.
from signtraker import SignTrakerClient
# Provide the key explicitly...
client = SignTrakerClient(api_key="YOUR_KEY", subdomain="theperrygroup")
# ...or via environment variables (SIGNTRAKER_API_KEY / SIGNTRAKER_SUBDOMAIN).
client = SignTrakerClient(subdomain="theperrygroup")
Supported environment variables (the brand-spelled SIGNTRACKER_* forms are also
accepted as a fallback):
SIGNTRAKER_API_KEYSIGNTRAKER_BASE_URLorSIGNTRAKER_SUBDOMAINSIGNTRAKER_TIMEOUT_SECONDS,SIGNTRAKER_MAX_RETRIES,SIGNTRAKER_RETRY_BACKOFF_SECONDS
Quickstart
from signtraker import SignTrakerClient
client = SignTrakerClient(subdomain="theperrygroup")
# List the first 5 agents ordered by last name
agents = client.agents.list_agents(top=5, orderby="LastName")
for agent in agents:
print(agent["FirstName"], agent["LastName"])
# Fetch one agent
agent = client.agents.get_agent(123)
# Find an agent by email
matches = client.agents.list_agents(email="someone@example.com")
Responses are plain dictionaries. For typed access, validate with a model:
from signtraker.models import Agent
agent = Agent.model_validate(client.agents.get_agent(123))
print(agent.first_name, agent.email)
API coverage
| Resource group | Property | Endpoints |
|---|---|---|
| Agents | client.agents |
list, get, create, update, activate, deactivate |
| Change Orders | client.change_orders |
list, get, create |
| Credits | client.credits |
list awards, create award |
| Enterprises | client.enterprises |
list |
| Offices | client.offices |
list |
| Order Presets | client.order_presets |
list |
| Orders (signage) | client.orders |
list, get, create, request removal |
| Services | client.services |
list, get, create |
Error handling
from signtraker import SignTrakerClient, NotFoundError, SignTrakerError
client = SignTrakerClient(subdomain="theperrygroup")
try:
agent = client.agents.get_agent(999999)
except NotFoundError:
print("No such agent")
except SignTrakerError as exc:
print(exc.status_code, exc.message)
Documentation
Full documentation (API reference, guides, and examples) is built with MkDocs.
See the docs/ directory or the published site.
Development
python -m venv .venv && source .venv/bin/activate
pip install -e ".[dev]"
pip install -r docs/requirements.txt
black --check .
isort --check-only --profile=black --line-length=88 .
flake8 .
mypy signtraker/ --strict
pytest --cov=signtraker --cov-report=term-missing
mkdocs build --strict
Live integration tests are opt-in and run only when a real key is set in the environment:
SIGNTRAKER_API_KEY=... SIGNTRAKER_SUBDOMAIN=theperrygroup pytest -m live
License
MIT. See LICENSE.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file signtraker-0.1.0.tar.gz.
File metadata
- Download URL: signtraker-0.1.0.tar.gz
- Upload date:
- Size: 21.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7ec643d073ee7083749447bf59327e525bfed0dbb86aafffbf7c9394933cbf64
|
|
| MD5 |
7e4bcb8aea4bbc9ba987812752da2fab
|
|
| BLAKE2b-256 |
5bab88bb158a24c843226c94b6a430821c4f955f9780df85f9b82f915971d6ce
|
Provenance
The following attestation bundles were made for signtraker-0.1.0.tar.gz:
Publisher:
release.yml on theperrygroup/signtraker
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
signtraker-0.1.0.tar.gz -
Subject digest:
7ec643d073ee7083749447bf59327e525bfed0dbb86aafffbf7c9394933cbf64 - Sigstore transparency entry: 1659942001
- Sigstore integration time:
-
Permalink:
theperrygroup/signtraker@1a410b8c44308aa0d6b5b1069f1e5bba5b464545 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/theperrygroup
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@1a410b8c44308aa0d6b5b1069f1e5bba5b464545 -
Trigger Event:
push
-
Statement type:
File details
Details for the file signtraker-0.1.0-py3-none-any.whl.
File metadata
- Download URL: signtraker-0.1.0-py3-none-any.whl
- Upload date:
- Size: 24.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2b4f1055ff5e29346443e32fbda1bee522a56703e17f590b664df82aa05913c5
|
|
| MD5 |
97df394b3089d5a16fb851cbe590ee91
|
|
| BLAKE2b-256 |
f7f825c1557890a6d31aaddfaee8b16b841f953cc03aa6f99acffb98e977f684
|
Provenance
The following attestation bundles were made for signtraker-0.1.0-py3-none-any.whl:
Publisher:
release.yml on theperrygroup/signtraker
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
signtraker-0.1.0-py3-none-any.whl -
Subject digest:
2b4f1055ff5e29346443e32fbda1bee522a56703e17f590b664df82aa05913c5 - Sigstore transparency entry: 1659942054
- Sigstore integration time:
-
Permalink:
theperrygroup/signtraker@1a410b8c44308aa0d6b5b1069f1e5bba5b464545 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/theperrygroup
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@1a410b8c44308aa0d6b5b1069f1e5bba5b464545 -
Trigger Event:
push
-
Statement type: