Skip to content

Read the registry

This tutorial installs both packages and lists the registry's workers with their latest version.

Python

pip install virtufin-worker-registry \
  --extra-index-url https://pypi.haenerconsulting.com/api/packages/virtufin/pypi/simple/
from virtufin import worker_registry

print("registry", worker_registry.version())
for entry in worker_registry.tables():
    versions = entry.get("versions", [])
    print(entry["name"], versions[-1] if versions else "-", entry["mime_type"])

The output starts with the registry version, then one line per worker, for example WebSocketFeed 0.30.0 application/x-dotnet-dll.

TypeScript

Point the @virtufin scope at the org's npm feed (.npmrc):

@virtufin:registry=https://gitea.haenerconsulting.com/api/packages/virtufin/npm/
//gitea.haenerconsulting.com/api/packages/virtufin/npm/:_authToken=${VIRTUFIN_REGISTRY_TOKEN}
npm install @virtufin/worker-registry smol-toml
import { text, version } from '@virtufin/worker-registry'
import { parse } from 'smol-toml'

console.log('registry', version)
for (const entry of (parse(text) as { worker: { name: string; versions?: string[] }[] }).worker)
  console.log(entry.name, entry.versions?.at(-1) ?? '-')

The module has no node: imports, so a browser bundle takes it as is (the web app does).

Next