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. 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 are the gate, the tag (vX.Y.Z), uv build and the GitHub release with the built artifacts.

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

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.5
File Size Uploaded Provenance Actions
rb_keys-0.2.5.tar.gz 72.7 kB Without provenance Details for rb_keys-0.2.5.tar.gz

Built distribution (wheel)

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

Total release size: 118.0 kB

Release files / rb_keys-0.2.5.tar.gz

Download URL rb_keys-0.2.5.tar.gz
Size 72.7 kB
Tags Source
SHA-256 checksum
How to use checksums
bcc1f44fcc80a86da96dd1a0f63623fa1710dc3d545f2b99b2358a94601fece2
BLAKE2b-256 checksum
How to use checksums
2a9a4bde7782fb19063ede58ebb67f0c72f3c2891f926924a5c0239930ec93ee
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.5-py3-none-any.whl

Download URL rb_keys-0.2.5-py3-none-any.whl
Size 45.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
2574feb98fc5f308484273ea3b612b50eab58f0d4401a3429dfa6a045aa6c3e7
BLAKE2b-256 checksum
How to use checksums
793210e94c1f845b12c4ecb918696fb49c536b0da6719bf4911ee060c10b0d00
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.5

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