Skip to main content

Query metrics from Lightdash

Project description

Lightdash Python Client

A Python client for interacting with the Lightdash API.

Installation

pip install lightdash

Usage

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"
)

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/yourusername/pylightdash.git
cd pylightdash
  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-0.3.0.tar.gz (12.5 kB view details)

Uploaded Source

Built Distribution

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

lightdash-0.3.0-py3-none-any.whl (11.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: lightdash-0.3.0.tar.gz
  • Upload date:
  • Size: 12.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.9.18

File hashes

Hashes for lightdash-0.3.0.tar.gz
Algorithm Hash digest
SHA256 e1905cd346c3d79118e64fd6f6f8b55c7085d4a896a9baad017c086d762bdf67
MD5 ed4e5a859b64b3e3bf36d2d54b4f4175
BLAKE2b-256 303569d6f8c233511a8ce153787ae9709c257776d219c320c6b32187be414315

See more details on using hashes here.

File details

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

File metadata

  • Download URL: lightdash-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 11.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.9.18

File hashes

Hashes for lightdash-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d1d7c4f504c2109ad3049863ef09c3060c611f5a62a05cb80efff6abf9328fc8
MD5 defd5800870fc769ee6b2df99935b3af
BLAKE2b-256 5bdb1e92edc8329b62b4f13d2bf7d1395b5d37b2fb07f9583530582aa138940b

See more details on using hashes here.

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