Skip to main content

A bundeld set of tools, clients for the lange-suite of tools and more.

Project description

lange-python

Python helpers for Lange services.

Mesh Relay Worker

MeshRelay connects a local HTTP service to the Lange mesh relay and forwards public relay requests to your local target.

pip install lange-python
from lange.mesh.relay import MeshRelay

relay = MeshRelay(
    host="wss://api.lange-labs.com",
    key="default",
    target="http://localhost:3000",
)

relay.start()

try:
    print(relay.status)
    print(relay.remote_relay_address)
finally:
    relay.stop()

By default, MeshRelay reads authentication from the LANGE_LABS_API_KEY environment variable. Keep API keys in the environment or a local secret store instead of hardcoding them in application code.

export LANGE_LABS_API_KEY="your-api-key"

The relay exposes lifecycle state for integrations:

  • status: one of unauthenticated, off, pending, connected, or failed
  • connected: whether the relay websocket is currently connected
  • remote_relay_address: public REST relay address returned by the API
  • worker_config: full worker configuration returned by the API

Reload authentication or reconnect the worker without rebuilding it:

relay.reload()
relay.reload(api_key=None)
relay.reconnect()

Project details


Download files

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

Source Distribution

lange_python-0.7.0.tar.gz (19.0 kB view details)

Uploaded Source

Built Distribution

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

lange_python-0.7.0-py3-none-any.whl (30.5 kB view details)

Uploaded Python 3

File details

Details for the file lange_python-0.7.0.tar.gz.

File metadata

  • Download URL: lange_python-0.7.0.tar.gz
  • Upload date:
  • Size: 19.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for lange_python-0.7.0.tar.gz
Algorithm Hash digest
SHA256 42910df48df509294c2f0b5acf55f16cc09c587ab9c3e7df7e5e966fa80aa949
MD5 bb04a09be1ef01a18630bf9c9bc7d915
BLAKE2b-256 0d20521f0b5476279d696068d5d6bc31db9150994af5934f47dbf049412130fa

See more details on using hashes here.

Provenance

The following attestation bundles were made for lange_python-0.7.0.tar.gz:

Publisher: publish.yml on langelabs/lange-python

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file lange_python-0.7.0-py3-none-any.whl.

File metadata

  • Download URL: lange_python-0.7.0-py3-none-any.whl
  • Upload date:
  • Size: 30.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for lange_python-0.7.0-py3-none-any.whl
Algorithm Hash digest
SHA256 4564bb673d55f39144d41a2476373e2a36a0cec407d6dc259d917c4b3ee34614
MD5 cb2b2796fdf9754763c738497d849bd8
BLAKE2b-256 6c1841efe603162da8fe3869b4924af7e189e3a5e85611ffebe93f85d3236c95

See more details on using hashes here.

Provenance

The following attestation bundles were made for lange_python-0.7.0-py3-none-any.whl:

Publisher: publish.yml on langelabs/lange-python

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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