Skip to content

Latest commit

 

History

History
33 lines (20 loc) · 1000 Bytes

README.md

File metadata and controls

33 lines (20 loc) · 1000 Bytes

client-python

Tests codecov

client-python is a library to access Service Binding Specification for Kubernetes conformant Service Binding Workload Projections.

Example

import psycopg2 as psycopg2

from bindings import bindings

b = bindings.from_service_binding_root()
b = bindings.filter(b, "postgresql")

if len(b) != 1:
raise ValueError("Incorrect number of PostgreSQL bindings: %s" % len(b))

u = b[0].get("url")
if u is None:
    raise ValueError("No URL in binding")

conn = psycopg2.connect(u)

# ...

License

Apache License v2.0: see LICENSE for details.