Metadata-Version: 2.4
Name: psr-lakehouse
Version: 0.4.0
License-File: LICENSE
Requires-Python: >=3.12
Requires-Dist: pandas>=2.2.0
Requires-Dist: plotly>=5.17.0
Requires-Dist: requests>=2.32.0
Requires-Dist: streamlit>=1.48.1
Description-Content-Type: text/markdown

<div align="center">

<picture>

  <source media="(prefers-color-scheme: light)" srcset="https://raw.githubusercontent.com/psrenergy/psr_lakehouse/master/docs/_static/img/lakehouse_vertical_light.png">
  <source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/psrenergy/psr_lakehouse/master/docs/_static/img/lakehouse_vertical_dark.png">
  <img height="200" alt="Lakehouse logo" src="https://raw.githubusercontent.com/psrenergy/psr_lakehouse/master/docs/_static/img/lakehouse_vertical_light.png">
  
</picture>
<br>

![Tests](https://github.com/psrenergy/psr_lakehouse/actions/workflows/ci.yml/badge.svg)  ![PyPI - Version](https://img.shields.io/pypi/v/psr-lakehouse?color=3dd13f) [![Docs](https://img.shields.io/badge/docs-GitHub%20Pages-blue)](https://psrenergy.github.io/psr_lakehouse/)


</div>

# PSR Lakehouse 🏞️🏡


A Python client library for accessing PSR's data lakehouse API, providing easy access to Brazilian energy market data including ANEEL, CCEE and ONS datasets.

## 📦 Installation

```bash
pip install psr-lakehouse
```

## ⚙️ Quick Start

Configure the API URL:

```bash
export LAKEHOUSE_API_URL="https://api.example.com"
```

Fetch data from the API:

```python
from psr.lakehouse import client

# Fetch CCEE spot price data
df = client.fetch_dataframe(
    table_name="ccee_spot_price",
    data_columns=["spot_price"],
    start_reference_date="2023-05-01",
    end_reference_date="2023-05-02",
    filters={"subsystem": "SOUTHEAST"},
)
print(df)
```

## 📚 Documentation

For complete documentation including advanced features, API reference, and examples, visit the [full documentation](https://psrenergy.github.io/psr_lakehouse/).

Features include:
- Data filtering and aggregation
- Temporal aggregation with datetime granularity
- Complex queries with table joins
- Schema discovery and exploration
- Custom ordering and timezone support

## 💬 Support

For questions or issues, please open an issue on the project repository.
