Skip to main content

Language-agnostic URI to handler adapter

Project description

urirun python adapter

Install directly from GitHub:

pip install "git+https://github.com/if-uri/urirun.git@v0.3.13#subdirectory=adapters/python"

Or install a GitHub Release wheel:

pip install "https://github.com/if-uri/urirun/releases/download/v0.3.13/urirun-0.3.13-py3-none-any.whl"

PyPI publishing is not required. The distribution is named urirun; the Python import package remains urirun:

import urirun

After installation the urirun CLI is available:

urirun scan ./project --out .urirun/bindings.v2.json --registry-out .urirun/registry.merged.json
urirun validate .urirun/bindings.v2.json
urirun list .urirun/registry.merged.json
urirun run 'cli://local/git/status' .urirun/registry.merged.json

urirun-v1 and urirun-v2 are also installed as explicit versioned entry points for scripts that need a stable major-version command.

The optional v2 gRPC transport can be installed with:

pip install "urirun[grpc] @ git+https://github.com/if-uri/urirun.git@v0.3.13#subdirectory=adapters/python"

v2 can generate schema-first bindings and a compiled registry from existing artifacts:

urirun scan ./project \
  --out generated/bindings.v2.json \
  --registry-out generated/registry.json
urirun validate generated/bindings.v2.json
urirun list generated/registry.json

Connector packages can generate bindings directly from decorated Python functions. The shortest path is to declare the connector once and then attach short URI paths to functions:

import urirun

connector = urirun.connector("http-check", scheme="httpcheck")

@connector.command("http/query/status")
def status_command(url: str, expectStatus: int = 200, timeout: float = 10.0):
    return ["urirun-http-check", "status", "{url}", "--expect-status", "{expectStatus}"]

def urirun_bindings():
    return connector.bindings()

License

Licensed under Apache-2.0.

Project details


Release history Release notifications | RSS feed

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

urirun-0.4.47.tar.gz (240.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

urirun-0.4.47-py3-none-any.whl (219.1 kB view details)

Uploaded Python 3

File details

Details for the file urirun-0.4.47.tar.gz.

File metadata

  • Download URL: urirun-0.4.47.tar.gz
  • Upload date:
  • Size: 240.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.7

File hashes

Hashes for urirun-0.4.47.tar.gz
Algorithm Hash digest
SHA256 5f5ef376d88f3e8d86c1f5985856374b7b2e6e9de55eded77ad935ddd58bc068
MD5 2cdacee6d40e87c204c5d60abcc9e6f7
BLAKE2b-256 a15db43567cdc09fd5b996b042f146fd9c55903a20b2a896a6863c6773574f34

See more details on using hashes here.

File details

Details for the file urirun-0.4.47-py3-none-any.whl.

File metadata

  • Download URL: urirun-0.4.47-py3-none-any.whl
  • Upload date:
  • Size: 219.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.7

File hashes

Hashes for urirun-0.4.47-py3-none-any.whl
Algorithm Hash digest
SHA256 25f7deb5731db31a415e65eadd7d8f610b08011e4785cf508d065f85e0301d92
MD5 c7ecf7e871d5cd877ad5efa16ff0a59f
BLAKE2b-256 d135870a962eceb59ba4d530521a749dafc6f6554d41b9b39c33c9a3b229df39

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page