MCPcopy Create free account
hub / github.com/cosdata/cosdata / create_session

Function create_session

tests/test-key-value-store-simple.py:19–30  ·  view source on GitHub ↗

Initialize the cosdata client

()

Source from the content-addressed store, hash-verified

17host = os.getenv("COSDATA_HOST", "http://127.0.0.1:8443")
18
19def create_session():
20 """Initialize the cosdata client"""
21 # Use environment variable from .env file if available, otherwise prompt
22 password = os.getenv("COSDATA_PASSWORD")
23 if not password:
24 password = getpass.getpass("Enter admin password: ")
25
26 username = os.getenv("COSDATA_USERNAME", "admin")
27
28 global client
29 client = Client(host=host, username=username, password=password, verify=False)
30 return client
31
32
33def create_db(name: str, description: str | None = None):

Callers 1

mainFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected