Skip to main content

Official SDK for Lightdash

Project description

Lightdash Python Client

A Python client for interacting with the Lightdash API.

Installation

pip install lightdash

Usage

See the SDK Guide for full documentation on the query builder, filters, and other features.

For an interactive tutorial, check out the example notebook.

from lightdash import Client

client = Client(
    instance_url="https://your-instance.lightdash.com",
    access_token="your-access-token",
    project_uuid="your-project-uuid"
)

access_token accepts both personal access tokens (ldpat_…) and service account tokens (ldsvc_…); the SDK selects the correct authentication scheme automatically.

Development

Prerequisites

  • Python 3.9 or higher
  • uv for dependency management
  • just for running commands

Setting up the development environment

  1. Clone the repository:
git clone https://github.com/lightdash/python-sdk.git
cd python-sdk
  1. Create and activate a virtual environment:
uv venv
  1. Set up your environment variables by copying the example file:
cp .env.example .env
  1. 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"
  1. Install development dependencies:
just install

Available Commands

View all available commands:

just

Common commands:

  • just install - Install development dependencies
  • just test - Run acceptance tests
  • just build - Build package distributions
  • just clean - Remove build artifacts

Publishing

Setting up PyPI credentials

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:

  1. Use API tokens instead of your actual username/password
  2. Keep the file secure (chmod 600 ~/.pypirc)
  3. Never commit this file to version control
  4. Use different tokens for TestPyPI and PyPI
  5. Generate tokens with minimal required permissions

Publishing to PyPI

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.

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

lightdash-1.1.0.tar.gz (41.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

lightdash-1.1.0-py3-none-any.whl (30.7 kB view details)

Uploaded Python 3

File details

Details for the file lightdash-1.1.0.tar.gz.

File metadata

  • Download URL: lightdash-1.1.0.tar.gz
  • Upload date:
  • Size: 41.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for lightdash-1.1.0.tar.gz
Algorithm Hash digest
SHA256 784a9f8be3cd3f1d7376ba046c802d0af29dc6f9f152fc01a97c67e685463da7
MD5 fb8991048837a7d3e97aa031a4b0e8c1
BLAKE2b-256 e8be677fa64659df19c3c9d81a4b3decf3ac98e9f6fb41ad3d031843cdb353da

See more details on using hashes here.

Provenance

The following attestation bundles were made for lightdash-1.1.0.tar.gz:

Publisher: release.yml on lightdash/python-sdk

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file lightdash-1.1.0-py3-none-any.whl.

File metadata

  • Download URL: lightdash-1.1.0-py3-none-any.whl
  • Upload date:
  • Size: 30.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for lightdash-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 2173c3708470ac8bccb8e8c3ff9801e1cd5bcc5524ea686ccadafdb5176168fc
MD5 d3c75856461860a32ee1f6462c8fdacf
BLAKE2b-256 43046c8f119a3afdf65b457e621efc6fc232c80068dd815a3989540b9a1c024b

See more details on using hashes here.

Provenance

The following attestation bundles were made for lightdash-1.1.0-py3-none-any.whl:

Publisher: release.yml on lightdash/python-sdk

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page