Skip to content
rlsbl.registry
On this page

Registry version query functions for npm, PyPI, and the Go proxy, returning the latest published version for name availability and dependency checks.

#rlsbl.registry

#rlsbl.registry

Registry version query functions for npm, PyPI, and the Go proxy, returning the latest published version for name availability and dependency checks.

#query_npm_version

python
def query_npm_version(name)

Query the npm registry for the latest version of a package.

Returns {"status": "found", "version": "X.Y.Z"} on success, {"status": "not_found"} if the package does not exist, or {"status": "error", "message": "..."} on failure.

#query_pypi_version

python
def query_pypi_version(name)

Query PyPI for the latest version of a package.

Returns {"status": "found", "version": "X.Y.Z"} on success, {"status": "not_found"} if the package does not exist, or {"status": "error", "message": "..."} on failure.

#query_pypi_release

python
def query_pypi_release(name, version)

Ask PyPI whether ONE specific version of a package is published.

query_pypi_version answers "what is the latest?", which cannot decide whether an older or a just-locked version exists on the index. This one reads the per-release endpoint instead.

Returns {"status": "found"} when the release exists, {"status": "not_found"} when the package or that version does not, or {"status": "error", "message": "..."} on failure. Callers that must be certain treat "error" as a refusal, never as absence.

#query_go_version

python
def query_go_version(module_path)

Query the Go module proxy for the latest version of a module.

Returns {"status": "found", "version": "X.Y.Z"} on success (v prefix stripped), {"status": "not_found"} if the module does not exist, or {"status": "error", "message": "..."} on failure.

The path is escaped the way the proxy demands (see :func:escape_module_path), exactly as :func:query_go_mod does: an unescaped uppercase letter names a module the proxy does not serve, and its 404 would read as "never published" for a module that is.

#escape_module_path

python
def escape_module_path(module_path)

Encode a module path the way the Go module proxy demands.

The proxy's URL space is case-insensitive, so every uppercase letter is written as ! plus its lowercase form. A path sent unescaped resolves to a different (usually absent) module, which would read as "never published" for a module that is published.

#query_go_mod

python
def query_go_mod(module_path, version)

Fetch one version's go.mod text from the Go module proxy.

Returns {"status": "found", "text": "..."}, {"status": "not_found"} when the proxy has no such module or version, or {"status": "error", "message": "..."}. A caller that must be certain treats "error" as a refusal to answer, never as absence.

#go_mod_deprecation

python
def go_mod_deprecation(text)

The deprecation message a go.mod states, or None.

Go's own rule, applied exactly: the notice is a // Deprecated: comment in the comment block IMMEDIATELY BEFORE the module directive, or a comment on the same line. A // Deprecated: anywhere else in the file (inside a retract block, say) deprecates that thing, not the module, so it is deliberately not read here.

#query_go_module_deprecation

python
def query_go_module_deprecation(module_path)

Does the module proxy serve a deprecation notice for module_path?

Two reads: the latest version, then that version's go.mod. Returns {"status": "deprecated", "version": v, "message": m}, {"status": "not_deprecated", "version": v}, {"status": "not_found"} when the module was never published, or {"status": "error", "message": ...}.

#query_registry_version

python
def query_registry_version(name, registry)

Query a registry for the latest version of a package.

The registry argument is a TARGET NAME, and the target answers: each one that has a version API overrides query_latest_version, and the base implementation answers Unknown registry for the rest. This replaced a hand-maintained dispatch dict that had to be edited alongside the target registry and could silently disagree with it.

Returns {"status": "found", "version": "X.Y.Z"} on success, {"status": "not_found"} if the package does not exist, {"status": "error", "message": "..."} on failure, or {"status": "error", "message": "Unknown registry: ..."} for unrecognized registry names.

More tools from this site

  • claudestream Drive Claude Code from Python: run it as a subprocess and read its output as typed events, with async and sync sessions, sandbox policies, and tools you define in Python
  • claudewheel A TUI Claude Code Launcher that lets you have more than one profile, manage sessions lifecycle, pick the exact CC version, model to use (even older unlisted ones), pick which GitHub account to use, etc.
  • dirstat Fast, single-binary directory statistics CLI: every file under a tree grouped by format, with counts, sizes, and lines of code, as a colored terminal table or as JSON
  • fastware A batteries-included ASGI framework: msgspec JSON, a managed Granian server, dependency injection, SSE, WebSockets, auth, and a test client
  • go-toml-edit Zero-dep TOML editing library for Go with comment preservation
  • howmuchleft The fastest Claude Code statusline: context window, 5-hour, and weekly limit usage as three customizable gradient bars, rendering in about 6 ms
  • orxtra
  • pgdesign
  • predraw Declarative rendering pipeline: describe a scene in JSON and get SVG, PNG and WebP out, with light and dark style tokens, reusable components and text converted to path outlines
  • reposummary Turn a git repository's history into a Markdown journal: pick a time window or revision range and get a readable digest of what changed, optionally narrated by an LLM
  • safegit git wrapper CLI that gives each commit its own temporary index and retries ref updates on conflict, so concurrent agents share one repository
  • saferm Command-line replacement for rm that archives every deletion with a mandatory reason and the context it ran in, so deleted files can be listed, inspected and restored
  • selfdoc Static Site Generator that builds a project's documentation site directly from its source code, so the docs can never drift from the code they describe, with SEO/AEO, first-class blog, search, and cross-project linking built in
  • strictcli
  • stricttest An always-on test-isolation floor: a pytest plugin and a Go env-hygiene module that make a test suite structurally unable to reach real credentials, the real HOME, the network, or the development repository.
  • wesktop A Python framework that turns an ASGI web app into a desktop application, serving it from a local Granian server and displaying it in a native OS window via pywebview
Search