python-klabclient 1.0.4

Creator: railscoder56

Last updated:

Add to Cart

Description:

pythonklabclient 1.0.4

# python-klabclient## InstallationDeveloper installation:```bashgit clone https://github.com/kuberlab/python-klabclientcd python-klabclientpip install -e . ```* for MacOS add --ignore-installed six at the end of the command lineUser installation:```bashpip install python-klabclient```* for MacOS add --ignore-installed six at the end of the command lineInstall in virtual environment:```bashvirtualenv venvcd venvbin/pip install python-klabclient```* `klab` console command will be accessed from `venv/bin/klab` path.## Uninstall:```bashpip uninstall python-klabclient```* Also, if it is required, delete file `~/.kuberlab/config`.## Usage#### Use config for auth (default location is *~/.kuberlab/config*)```bashtouch ~/.kuberlab/configcat << EOF >> ~/.kuberlab/configbase_url: https://go.kuberlab.com/api/v0.2token: <user-token>EOF```**Note**: Refer to [Config example](config.yaml.example) to see all possible values.#### Use environment variables```bash# Set tokenexport KUBERLAB_TOKEN=token# Or, use your login/passwordexport KUBERLAB_USERNAME=my@example.comexport KUBERLAB_PASSWORD=mypassword```#### Call CLI or see help to take a look on a command list:```bashklab workspace-list# See helpklab --help```## App installation exampleSee how to install a simple app - [App installation](App_installation.md)**Note**: Priority for auth parameters: CLI parameters, Env variables, config values.## Usage as a python library```pythonfrom klabclient.api import client# Init sessionses = client.create_session(token='token') # Pick up default base_url# Or, use username and password# ses = client.create_session(username='username', password='password') # Pick up default base_urlklab = client.Client(session=ses) # Pick up default klab_urlworkspaces = klab.workspaces.list()# Print all workspace namesprint([w.Name for w in workspaces])```

License

For personal and professional use. You cannot resell or redistribute these repositories in their original state.

Customer Reviews

There are no reviews.