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

Metadata

Release files for client-signals 0.4.4

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

Source distribution (sdist)

Source distribution for client-signals 0.4.4
File Size Uploaded
client_signals-0.4.4.tar.gz 3.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for client-signals 0.4.4
File Interpreter ABI Platform
client_signals-0.4.4-py3-none-any.whl Python 3 none any Details

Total release size: 8.2 kB

Release files / client_signals-0.4.4.tar.gz

Download URL client_signals-0.4.4.tar.gz
Size 3.9 kB
Tags Source
SHA-256 checksum
How to use checksums
1fc1846b9992706349a10c10886f0f326bc56eeedd9af612c41cf9ff1a89562d
BLAKE2b-256 checksum
How to use checksums
05dd5002f106210ebb4772171e80f206c395e1ac38532c7d601a883903b9b7e6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 5, 2026.

Transparency log

Release files / client_signals-0.4.4-py3-none-any.whl

Download URL client_signals-0.4.4-py3-none-any.whl
Size 4.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
672551d797c004cfc9d5ae87ed0dca4ba5a64fc35d1edcf1218cc11f12fdfb25
BLAKE2b-256 checksum
How to use checksums
ce76e8f0947c8a26ec9fd0ccc960ed3875aec55035afb19bd6c08e9eac574861
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 5, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.4.4 This release

2 release files

0.4.3

2 release files

0.4.2

2 release files

0.4.1

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