Skip to main content

rb-keys

Shared normalization keys (query, domain, URL) for linking records across tools

Usage

from rb_keys import KEYS_VERSION, norm_domain, norm_query, norm_url

norm_query("!Купить  Ёлку -бесплатно")  # "купить елку"
norm_domain("https://WWW.xn--e1afmkfd.xn--p1ai:443/")  # "пример.рф"
norm_url("https://www.example.com/Catalog/?utm_source=x&p=2#top")  # "example.com/Catalog?p=2"

Not in Python: keys query|domain|url VALUE [--json] prints the key (--json: {"ok": true, "fn", "input", "key", "keys_version"}; not a URL → exit 2 INVALID_ARGUMENTS). Batch: keys query|domain|url A B … [--input FILE|-] [--json] — one process for many values; --json: {"ok": true, "fn", "count", "keys_version", "results": [{"input", "key"}]} in input order. The rules are the contract vectors in vectors/keys-v1.yaml — run them against your own implementation as a contract test.

Development

uv sync
uv run keys --help
uv run pytest --snapshot-update  # after changing a command's help; review tests/snapshots/help/

The gate is gate check, run on this machine before a commit (.agents/antagor/antagor.toml). pytest fails below the coverage floor in pyproject.toml; ruff includes the security (S) rules.

Release

The version is the git tag (vX.Y.Z) — pyproject.toml has no version =. Releases go through Antagor: antagor publish runs the gate, writes CHANGELOG.md, tags and pushes.

Install

</code></pre>
<p>From the git tag instead (never a branch):</p>
<pre><code class="language-bash">uv tool install "rb-keys @ git+https://homeserver.tailee01ab.ts.net:3000/bolandeu/keys.git@vX.Y.Z"

Replace vX.Y.Z with the latest release tag. An AI agent bootstraps the CLI the same way — see src/rb_keys/data/SKILL.md. Update an installed copy: uv tool upgrade rb-keys.

After install, the command keys is available globally, on macOS, Linux and Windows alike.

Architecture

This project follows a fixed CLI architecture:

  • src/rb_keys/commands/ — argument parsing only, no business logic.
  • src/rb_keys/core/ — services, models, errors: the real logic.
  • src/rb_keys/providers/ — external APIs/integrations.
  • src/rb_keys/credentials/ — secrets via the OS keychain (keyring) and environment variables. Secrets never live in .rb_keys/config.toml.
  • src/rb_keys/output/ — human (rich) and --json rendering.

Run keys doctor to check environment/config/auth readiness, and keys --help for the full command surface. Every command supports --json for machine/agent consumption; errors are structured (error.code, fixed exit codes, error.action telling you what to do next) and go to stderr in human mode, so stdout is always safe to pipe.

A project can require a minimum CLI version in its .rb_keys/config.toml ([cli] min_version = "..."); an older install refuses with exit 6 and uv tool upgrade rb-keys fixes it.

See src/rb_keys/data/SKILL.md for the agent-facing usage guide bundled with this package — install it into an AI tool with keys skill install, or get it as plain text with keys --ai (works even without file access).

Metadata

Release files for rb-keys 0.2.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 rb-keys 0.2.4
File Size Uploaded Provenance Actions
rb_keys-0.2.4.tar.gz 73.9 kB Without provenance Details for rb_keys-0.2.4.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for rb-keys 0.2.4
File Interpreter ABI Platform Actions
rb_keys-0.2.4-py3-none-any.whl Python 3 none any Details for rb_keys-0.2.4-py3-none-any.whl

Total release size: 119.4 kB

Release files / rb_keys-0.2.4.tar.gz

Download URL rb_keys-0.2.4.tar.gz
Size 73.9 kB
Tags Source
SHA-256 checksum
How to use checksums
e200062929776603160bd71d55df7affd1da931a17d044c0cac3dbf9b79d4b50
BLAKE2b-256 checksum
How to use checksums
1473322a9fe8b79fefa04d9a6f687446075ae3c6625251dfd9e39655da5450ae
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.4 {"installer":{"name":"uv","version":"0.13.4","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / rb_keys-0.2.4-py3-none-any.whl

Download URL rb_keys-0.2.4-py3-none-any.whl
Size 45.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f0c1881226a7d69ac65822e17a472c97e5d3cda6e28734135aca6dd816e667b0
BLAKE2b-256 checksum
How to use checksums
a818aab15e79bda595bd40fc3291f8253071d3f973e96053d5f3749240771f4f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.4 {"installer":{"name":"uv","version":"0.13.4","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Security for rb-keys 0.2.4

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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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