Skip to main content

Privacy-safe client signals for CLI HTTP traffic.

Project description

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.
  • 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

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

client_signals-0.4.1.tar.gz (3.5 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.1-py3-none-any.whl (4.0 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for client_signals-0.4.1.tar.gz
Algorithm Hash digest
SHA256 9865d463c6ec39f3061093a5da09b7028b9175e0bfaf710c265168e06c8a250a
MD5 e76fcdd3ae935269835bc0d971b865af
BLAKE2b-256 75d85371aaf01e5afc3ed24c89eacb998307ede7471bdfba91d7bd50a05069d3

See more details on using hashes here.

Provenance

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

File metadata

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

File hashes

Hashes for client_signals-0.4.1-py3-none-any.whl
Algorithm Hash digest
SHA256 6d7b64d9898a32ddacab94675ae530236c9d6080573adcb147d2780c1e0633ea
MD5 dad0fc459f1e0e344e6f97d0cee99d94
BLAKE2b-256 356f4c3f280688e8a38ae622ca49d97ce0cbf0e5fa45ccf9434bc1f6ebdc5c30

See more details on using hashes here.

Provenance

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

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