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.2.3.tar.gz (12.0 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.2.3-py3-none-any.whl (10.7 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for lightdash-0.2.3.tar.gz
Algorithm Hash digest
SHA256 436f0473f4117e36bd6c86620b642a137a8f91056a55e6ef2b2c9b2ebae86f6c
MD5 2e5cc71fe51241362f9a1947984ad0f0
BLAKE2b-256 9ad8394d7c661a72936b69e73e91db3d0a7b3c7f1208019429373763539bdc65

See more details on using hashes here.

File details

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

File metadata

  • Download URL: lightdash-0.2.3-py3-none-any.whl
  • Upload date:
  • Size: 10.7 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.2.3-py3-none-any.whl
Algorithm Hash digest
SHA256 496f5b9940d36171d1da66645823c41283e62cbaf52644446a6a864232c360bc
MD5 0f6c182221aa847d95ff025cd0fb6382
BLAKE2b-256 0d42ffd5c3a733fd05b542638b2129fb098a8a42699ec1bd41baa2f73851c79a

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