Metadata-Version: 2.4
Name: lukka-api
Version: 0.1.6
Summary: Python client for Lukka cryptocurrency data API
Home-page: https://github.com/KENOT-IO/lukka-api
Author: KENOT-IO
Author-email: KENOT-IO <du.tran@kenot.io>
Maintainer-email: KENOT-IO <vladimir.depoel@kenot.io>
License: MIT
Project-URL: Homepage, https://github.com/KENOT-IO/lukka-api
Project-URL: Documentation, https://github.com/KENOT-IO/lukka-api#readme
Project-URL: Repository, https://github.com/KENOT-IO/lukka-api
Project-URL: Bug Tracker, https://github.com/KENOT-IO/lukka-api/issues
Project-URL: Changelog, https://github.com/KENOT-IO/lukka-api/blob/main/CHANGELOG.md
Keywords: lukka,cryptocurrency,bitcoin,ethereum,crypto,api,data,finance
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Financial and Insurance Industry
Classifier: Topic :: Office/Business :: Financial
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.13
Classifier: Operating System :: OS Independent
Requires-Python: >=3.13
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: pandas>=2.3.0
Requires-Dist: numpy>=2.0.0
Requires-Dist: requests>=2.32.0
Requires-Dist: python-dotenv>=1.0.0
Requires-Dist: portalocker>=3.0.0
Requires-Dist: pyarrow>=22.0.0
Provides-Extra: dev
Requires-Dist: pytest>=7.0.0; extra == "dev"
Requires-Dist: pytest-cov>=4.0.0; extra == "dev"
Requires-Dist: black>=23.0.0; extra == "dev"
Requires-Dist: mypy>=1.0.0; extra == "dev"
Requires-Dist: bandit>=1.7.0; extra == "dev"
Requires-Dist: safety>=2.0.0; extra == "dev"
Provides-Extra: redis
Requires-Dist: redis>=5.0.0; extra == "redis"
Provides-Extra: all
Requires-Dist: redis>=5.0.0; extra == "all"
Dynamic: author
Dynamic: home-page
Dynamic: license-file
Dynamic: requires-python

# Lukka API Python Client

[![Tests](https://github.com/KENOT-IO/lukka-api/workflows/Tests/badge.svg)](https://github.com/KENOT-IO/lukka-api/actions/workflows/tests.yml)
[![codecov](https://codecov.io/gh/KENOT-IO/lukka-api/branch/main/graph/badge.svg)](https://codecov.io/gh/KENOT-IO/lukka-api)
[![PyPI version](https://badge.fury.io/py/lukka-api.svg)](https://badge.fury.io/py/lukka-api)
[![Python 3.13+](https://img.shields.io/badge/python-3.13+-blue.svg)](https://www.python.org/downloads/)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/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

- Lukka API credentials ([Sign up here](https://www.lukka.tech/))

## Installation

### Install from source
```bash
# 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)**
```python
from lukka_api import LukkaPrices

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

**2. Environment Variables (Recommended for 12-Factor Apps)**
```bash
# Set in shell or via container orchestration
export username='your_username'
export password='your_password'
```

```python
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**.

```env
LUKKA_USERNAME=your_username
LUKKA_PASSWORD=your_password
```

```python
from lukka_api import LukkaPrices

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

## Quick Start

### Basic Usage

```python
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')
```
