Python client for Lukka cryptocurrency data API
Project description
Lukka API Python Client
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
- Lukka API credentials (Sign up here)
Installation
Install from source
# PyPI
pip install lukka-api
pip install -i https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple/ 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
.envfile 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
from datetime import datetime, timedelta
# Initialize with explicit credentials (recommended for production)
username = ''
password = ''
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 from specific date to now
prices.get_historical_price(pair_codes='XBT-USD', from_date="2025-11-01")
# Get historical prices from beginning up to specific date
prices.get_historical_price(pair_codes='XBT-USD', to_date="2025-11-21")
# Get historical prices for specific date range
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')
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file lukka_api-0.1.6.tar.gz.
File metadata
- Download URL: lukka_api-0.1.6.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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
dc6a9b07aaaf4bf044c29886e9360aa828a235c10db9f154b529827aa82b33da
|
|
| MD5 |
f28fd1769c36ea7e1baa6cd548264995
|
|
| BLAKE2b-256 |
65c2c4276bb387c083a63b7fe298ed30f372371ebc68e276f5b92baf2cf4edfb
|
File details
Details for the file lukka_api-0.1.6-py3-none-any.whl.
File metadata
- Download URL: lukka_api-0.1.6-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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
69d7f76b430b49c231a2c4c1f5ff33ac23a4431cfb38d387b49d107e7c035009
|
|
| MD5 |
8980e682da3c8be06de58736b762861a
|
|
| BLAKE2b-256 |
336bb48324b373d6afa40d12984fccaaff9329e1dc89c089d921a70d74246344
|