Skip to main content

Python client for Lukka cryptocurrency data API

Project description

Lukka API Python Client

Created by Kenot GitHub Downloads PyPI Downloads Tests codecov PyPI version Python 3.13+ License: MIT Code style: black

A Python library for retrieving cryptocurrency data from the Lukka API. Supports pricing sources, historical prices (minute-level and daily), latest prices, and multiple output formats (JSON, CSV, Parquet).

Requirements

Installation

Install from source

# PyPI
python -m pip install lukka-api

⚙️ Configuration

Authentication (Required)

The library supports three methods for providing credentials, in order of priority:

1. Explicit Parameters (Recommended for Production)

from lukka_api import LukkaPrices

prices = LukkaPrices(
    username="your_username",
    password="your_password"
)

2. Environment Variables (Recommended for 12-Factor Apps)

# Set in shell or via container orchestration
export username='your_username'
export password='your_password'
from lukka_api import LukkaPrices

# Credentials loaded from environment automatically
prices = LukkaPrices()

3. .env File (Local Development)

Important: Create an .env file in your projects directory.

LUKKA_USERNAME=your_username
LUKKA_PASSWORD=your_password
from lukka_api import LukkaPrices

# Credentials loaded from .env file
prices = LukkaPrices()

Quick Start

Basic Usage

from lukka_api import LukkaSources, LukkaPrices

# Initialize with explicit credentials (recommended for production)
sources = LukkaSources(username='username', password='password')
prices = LukkaPrices(username='username', password='password')

# Or use environment variables / .env file
sources = LukkaSources()
prices = LukkaPrices()

# Get all available pricing sources
sources.get_sources()

# Get sources for specific pairs only
sources.get_sources(pair_codes=['XBT-USD', 'ETH-USD'])

# Get sources for specific pairs with data available from a start date
sources.get_sources(pair_codes=['XBT-USD', 'ETH-USD'], start_date="2021-01-01")

# Get detailed information for a specific source, including pair_codes.
sources.get_source_details(source_id=1000)

# Get last 30 days of historical prices (uses default date range)
prices.get_historical_price(pair_codes='XBT-USD')

# Get historical prices for specific date range (from_date or to_date can be omitted)
prices.get_historical_price(pair_codes='XBT-USD', from_date="2025-11-01", to_date="2025-11-21")

# Get latest price within last hour (default lookback)
prices.get_latest_price(pair_codes='XBT-USD')

Advanced Usage

from datetime import datetime, timedelta

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

lukka_api-0.1.7.tar.gz (46.2 kB view details)

Uploaded Source

Built Distribution

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

lukka_api-0.1.7-py3-none-any.whl (48.2 kB view details)

Uploaded Python 3

File details

Details for the file lukka_api-0.1.7.tar.gz.

File metadata

  • Download URL: lukka_api-0.1.7.tar.gz
  • Upload date:
  • Size: 46.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.8

File hashes

Hashes for lukka_api-0.1.7.tar.gz
Algorithm Hash digest
SHA256 d91749f2d09b0a0184e269ef1afe08c81c5804078f00132198c4fc8613597a5f
MD5 fd36b7ec8703aff8edc7eef37de125e4
BLAKE2b-256 172cfa90b9660c86cecd701cbace482d3ece164f49dc9cc334572353e5bdd936

See more details on using hashes here.

File details

Details for the file lukka_api-0.1.7-py3-none-any.whl.

File metadata

  • Download URL: lukka_api-0.1.7-py3-none-any.whl
  • Upload date:
  • Size: 48.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.8

File hashes

Hashes for lukka_api-0.1.7-py3-none-any.whl
Algorithm Hash digest
SHA256 59602e3b1ea19d0a8b1d0ac93299885b7f6ac214e3e021d2adea91bb2ca80333
MD5 b8caf34508dfbd3bfd4f5432f3612a87
BLAKE2b-256 78ffba6e420e1ea8829765e71dd902431a8b8bc98bcb0af2914f2d80693ec53d

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