Metadata-Version: 2.1
Name: lightdash-ops
Version: 0.2.2
Summary: The CLI enables us to operate resources on Lightdash.
Author: yu-iskw
Requires-Python: >=3.8.0
Description-Content-Type: text/markdown
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Information Technology
Classifier: Intended Audience :: System Administrators
Classifier: Operating System :: OS Independent
Classifier: Topic :: Software Development :: Libraries
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Typing :: Typed
Requires-Dist: pydantic[dotenv] >=1.9,<2.0
Requires-Dist: loguru >=0.7.0,<1.0.0
Requires-Dist: typer>=0.9.0,<1.0.0
Requires-Dist: email-validator>=1.1.3,<2.0.0
Requires-Dist: ruamel.yaml >=0.17,<0.18
Requires-Dist: lightdash-client-python==0.651.2
Requires-Dist: flit ==3.7.1 ; extra == "dev"
Requires-Dist: build ==0.7.0 ; extra == "dev"
Requires-Dist: yapf >=0.29.0 ; extra == "dev"
Requires-Dist: pyyaml >=5.3 ; extra == "dev"
Requires-Dist: types-PyYAML >=6.0,<7.0 ; extra == "dev"
Requires-Dist: pdoc3 >=0.9.2 ; extra == "dev"
Requires-Dist: pre-commit >=2.15.0 ; extra == "dev"
Requires-Dist: safety >=2.0,<3.0 ; extra == "dev"
Requires-Dist: pytest >=6.2.4,<7.0.0 ; extra == "test"
Requires-Dist: py >=1.11.0,<2.0.0 ; extra == "test"
Requires-Dist: parameterized >=0.7.0, <1.0.0 ; extra == "test"
Requires-Dist: pylint >=2.12.0 ; extra == "test"
Requires-Dist: mypy >=1.3.0,<2.0.0 ; extra == "test"
Requires-Dist: flake8 >=3.8.3,<4.0.0 ; extra == "test"
Requires-Dist: black ==21.9b0 ; extra == "test"
Requires-Dist: isort >=5.0.6,<6.0.0 ; extra == "test"
Requires-Dist: yapf >=0.29.0 ; extra == "test"
Project-URL: Home, https://github.com/yu-iskw/lightdash-ops
Provides-Extra: dev
Provides-Extra: doc
Provides-Extra: test

# lightdash-ops

This is a python-based [Lightdash](https://www.lightdash.com/).
It focuses on to operate resources like users' roles and spaces on Lightdash by calling, as [the official CLI](https://docs.lightdash.com/api/v1/), as [The Lightdash CLI \| Documentation \| Lightdash](https://docs.lightdash.com/guides/cli/intro/) enables us to deploy projects and so on.
For instance, we can get members

## Install

```commandline
pip install -U lightdash-ops
```

## Settings

We can configure the API endpoint and so on with environment variables.
We can also take advantage of an `.env` file.
The template is located at [.env.template](.env.template).

```commandline
# .env
LIGHTDASH_URL=https://localhost:8000
...
```

### How to use

The CLI requires a personal access token to call the Lightdash APIs.
[The official documentation](https://docs.lightdash.com/references/personal_tokens/) describes how to get personal access tokens.

The CLI provides many sub commands.
Please refer to the detailed documentation in [docs/cli.ms](./docs/cli.md).

#### Example
The subsequent command is used to get all members in an organization.

```commandline
$ export LIGHTDASH_URL="https://localhost:8000"
$ export LIGHTDASH_API_KEY="YOUR-LIGHTDASH-PERSONAL-ACCESS-TOKEN"
$ lightdash-ops organization get-members
[
  {
    "member_uuid": "ade0aef5-bca8-4cbe-819b-07803390ffb0",
    "email": "lightdash-member@example.com",
    "role": "member"
  },
  {
    "member_uuid": "d7ee948b-26d6-461a-b289-906cc7bb0c73",
    "email": "lightdash-admin@example.com",
    "role": "admin"
  }
]
```

