Skip to main content

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.typed marker.
  • Friendly errors: HTTP status codes map to a typed exception hierarchy.
  • OData querying: ergonomic filter / top / skip / orderby / select keywords.

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_KEY
  • SIGNTRAKER_BASE_URL or SIGNTRAKER_SUBDOMAIN
  • SIGNTRAKER_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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

signtraker-0.1.0.tar.gz (21.0 kB view details)

Uploaded Source

Built Distribution

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

signtraker-0.1.0-py3-none-any.whl (24.8 kB view details)

Uploaded Python 3

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

Hashes for signtraker-0.1.0.tar.gz
Algorithm Hash digest
SHA256 7ec643d073ee7083749447bf59327e525bfed0dbb86aafffbf7c9394933cbf64
MD5 7e4bcb8aea4bbc9ba987812752da2fab
BLAKE2b-256 5bab88bb158a24c843226c94b6a430821c4f955f9780df85f9b82f915971d6ce

See more details on using hashes here.

Provenance

The following attestation bundles were made for signtraker-0.1.0.tar.gz:

Publisher: release.yml on theperrygroup/signtraker

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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

Hashes for signtraker-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 2b4f1055ff5e29346443e32fbda1bee522a56703e17f590b664df82aa05913c5
MD5 97df394b3089d5a16fb851cbe590ee91
BLAKE2b-256 f7f825c1557890a6d31aaddfaee8b16b841f953cc03aa6f99acffb98e977f684

See more details on using hashes here.

Provenance

The following attestation bundles were made for signtraker-0.1.0-py3-none-any.whl:

Publisher: release.yml on theperrygroup/signtraker

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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