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://github.com/bolandeu/rb-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.6

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.6
File Size Uploaded Provenance Actions
rb_keys-0.2.6.tar.gz 72.6 kB Without provenance Details for rb_keys-0.2.6.tar.gz

Built distribution (wheel)

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

Total release size: 117.9 kB

Release files / rb_keys-0.2.6.tar.gz

Download URL rb_keys-0.2.6.tar.gz
Size 72.6 kB
Tags Source
SHA-256 checksum
How to use checksums
9701fd2d03cfe3f4ff34e1bff641192278de8957ffdfdd6f4b367f3b6e75ad83
BLAKE2b-256 checksum
How to use checksums
91d27c8aec1a9d448cc948cd545889e0ca55390812651fa0dafbb76950af8c9b
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.6-py3-none-any.whl

Download URL rb_keys-0.2.6-py3-none-any.whl
Size 45.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
21f535293a575876a0240287b9c155dd1d8b6a9eb84445eef4a4aeb3d0029957
BLAKE2b-256 checksum
How to use checksums
97f69b98f86bce90c3099886cce0f31eed29738f950e135f4f447e448035133b
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.6

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