A Python client for interacting with the Lightdash API.
pip install lightdash
See the example notebook for a tutorial of how to use the client.
from lightdash import Client
client = Client(
instance_url="https://your-instance.lightdash.com",
access_token="your-access-token",
project_uuid="your-project-uuid"
)
- Clone the repository:
git clone https://github.com/yourusername/pylightdash.git
cd pylightdash
- Create and activate a virtual environment:
uv venv
- Set up your environment variables by copying the example file:
cp .env.example .env
- Edit
.env
with your Lightdash credentials:
LIGHTDASH_INSTANCE_URL="https://your-instance.lightdash.com"
LIGHTDASH_ACCESS_TOKEN="your-access-token"
LIGHTDASH_PROJECT_UUID="your-project-uuid"
- Install development dependencies:
just install
View all available commands:
just
Common commands:
just install
- Install development dependenciesjust test
- Run acceptance testsjust build
- Build package distributionsjust clean
- Remove build artifacts
Create a ~/.pypirc
file with your PyPI API tokens:
[pypi]
username = __token__
password = your-pypi-token-here
[testpypi]
username = __token__
password = your-testpypi-token-here
Make sure to:
- Use API tokens instead of your actual username/password
- Keep the file secure (
chmod 600 ~/.pypirc
) - Never commit this file to version control
- Use different tokens for TestPyPI and PyPI
- Generate tokens with minimal required permissions
First, test your package on TestPyPI:
just publish-test
If everything looks good on TestPyPI, publish to PyPI:
just publish
Note: The package version in pyproject.toml
must be incremented for each new release.
MIT