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.3.tar.gz (3.7 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.3-py3-none-any.whl (4.2 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for client_signals-0.4.3.tar.gz
Algorithm Hash digest
SHA256 db3db393941810964da707ab51c65d9b640c60538982b0a1b80efdc3d6fc5311
MD5 b6be13562054462f0b0fa169f248e96d
BLAKE2b-256 a48d46bc293710040e755e76efe4f249228b9794145654c3fffe8baeccf90757

See more details on using hashes here.

Provenance

The following attestation bundles were made for client_signals-0.4.3.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.3-py3-none-any.whl.

File metadata

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

File hashes

Hashes for client_signals-0.4.3-py3-none-any.whl
Algorithm Hash digest
SHA256 1aefa9e113aa85385d5613ef2e1ecf90593be79ea34618986e42d69082d64cf8
MD5 65ac24bf18b57f19d8c30bed5b303375
BLAKE2b-256 b447e46c93ce1a40775c0771b52a9ffdc5a0657aa1a2c9d8a997bdb43acad695

See more details on using hashes here.

Provenance

The following attestation bundles were made for client_signals-0.4.3-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

0.4.4

2 files

This release

0.4.3 This release

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