Skip to main content

client-signals for Python

Python implementation of the shared client-signals contract.

Installation

pip install client-signals

Import as client_signals.

Requires Python 3.9 or newer.

Usage

import client_signals

signals = client_signals.detect_once()
headers = {}

client_signals.apply_headers(headers, signals)
headers["User-Agent"] = f"my-cli/1.0 {client_signals.user_agent_suffix(signals)}"

Use a custom header prefix:

client_signals.apply_headers(headers, signals, prefix="Acme")

API

  • detect() computes fresh signals.
  • detect_once() computes and caches process-wide signals.
  • headers_for(signals, prefix="Fly") returns a header dictionary.
  • apply_headers(target, signals, prefix="Fly") updates a mutable header mapping.
  • user_agent_suffix(signals) returns the client-signals User-Agent token.
  • operator(signals) returns ci, agent, interactive, or unknown; precedence is in that order.
  • Signals is the dataclass returned by detection.
  • sanitize_invoked_by(value) and classify_parent_name(raw) are exposed for tests and advanced consumers that need the shared contract helpers.

Development

python3 -m unittest

Download files

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

Source Distribution

client_signals-0.4.4.tar.gz (3.9 kB view details)

Uploaded Source

Built Distribution

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

client_signals-0.4.4-py3-none-any.whl (4.3 kB view details)

Uploaded Python 3

File details

Details for the file client_signals-0.4.4.tar.gz.

File metadata

  • Download URL: client_signals-0.4.4.tar.gz
  • Upload date:
  • Size: 3.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for client_signals-0.4.4.tar.gz
Algorithm Hash digest
SHA256 1fc1846b9992706349a10c10886f0f326bc56eeedd9af612c41cf9ff1a89562d
MD5 13ca6ee40c87d2210398d25e4c47af2c
BLAKE2b-256 05dd5002f106210ebb4772171e80f206c395e1ac38532c7d601a883903b9b7e6

See more details on using hashes here.

Provenance

The following attestation bundles were made for client_signals-0.4.4.tar.gz:

Publisher: publish-python.yml on superfly/client-signals

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

File details

Details for the file client_signals-0.4.4-py3-none-any.whl.

File metadata

  • Download URL: client_signals-0.4.4-py3-none-any.whl
  • Upload date:
  • Size: 4.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for client_signals-0.4.4-py3-none-any.whl
Algorithm Hash digest
SHA256 672551d797c004cfc9d5ae87ed0dca4ba5a64fc35d1edcf1218cc11f12fdfb25
MD5 64702204915bb521bd9f7f320f8a256d
BLAKE2b-256 ce76e8f0947c8a26ec9fd0ccc960ed3875aec55035afb19bd6c08e9eac574861

See more details on using hashes here.

Provenance

The following attestation bundles were made for client_signals-0.4.4-py3-none-any.whl:

Publisher: publish-python.yml on superfly/client-signals

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

Release history Release notifications | RSS feed

This release

0.4.4 This release

2 files

0.4.3

2 files

0.4.2

2 files

0.4.1

2 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