EPİAŞ (Turkish Electricity Market) transparency platform data API client
Project description
pyepias
A Python client library for accessing EPİAŞ (Turkish Electricity Market) transparency platform data.
Overview
pyepias provides a simple and intuitive interface to fetch electricity market data from the EPİAŞ (Enerji Piyasaları İşletme A.Ş.) transparency platform. This library handles authentication and data retrieval, making it easy to access market clearing prices and other electricity market data.
Features
- 🔐 Automatic authentication with EPİAŞ platform
- 📊 Fetch Market Clearing Price (MCP) data
- 📅 Support for multiple time periods (today, week, month, custom range)
- 📈 Built-in statistical analysis
- 🐼 Pandas DataFrame integration
- 📄 JSON export support
Installation
From PyPI (when published)
pip install pyepias
From source
git clone https://github.com/hasancagrigungor/pyepias.git
cd pyepias
pip install -e .
Install dependencies only
pip install -r requirements.txt
Quick Start
from pyepias import EpiasClient
# Initialize the client with your EPİAŞ credentials
client = EpiasClient("your@email.com", "your_password")
# Get today's market clearing prices
data = client.download(period="today")
print(data)
Usage Examples
Get data for different time periods
from pyepias import EpiasClient
client = EpiasClient("your@email.com", "your_password")
# Today's data
today_data = client.download(period="today")
# Last week's data
week_data = client.download(period="week")
# Last month's data
month_data = client.download(period="month")
Custom date range
from datetime import datetime
from pyepias import EpiasClient
client = EpiasClient("your@email.com", "your_password")
# Define custom date range
start_date = datetime(2024, 1, 1)
end_date = datetime(2024, 1, 10)
# Get data for custom range
data = client.download(period=(start_date, end_date))
Get JSON output instead of DataFrame
from pyepias import EpiasClient
client = EpiasClient("your@email.com", "your_password")
# Get data as JSON string
json_data = client.download(
period="today",
output_format="json"
)
print(json_data)
Get statistical summary
from pyepias import EpiasClient
client = EpiasClient("your@email.com", "your_password")
# Get statistics for the last week
stats = client.stats(period="week")
print(f"Average Price (TL): {stats['mean_price_tl']:.2f}")
print(f"Min Price (TL): {stats['min_price_tl']:.2f}")
print(f"Max Price (TL): {stats['max_price_tl']:.2f}")
print(f"Total Records: {stats['total_records']}")
Data analysis with pandas
from pyepias import EpiasClient
import matplotlib.pyplot as plt
client = EpiasClient("your@email.com", "your_password")
# Get last month's data
df = client.download(period="month")
# Analyze the data
print(df.describe())
# Plot the data
df.plot(x='date', y='price', kind='line', title='Market Clearing Prices')
plt.ylabel('Price (TL/MWh)')
plt.show()
API Reference
EpiasClient
Main client class for interacting with EPİAŞ transparency platform.
Constructor
EpiasClient(email: str, password: str)
Parameters:
email(str): Your EPİAŞ account emailpassword(str): Your EPİAŞ account password
Methods
download()
download(
period: Union[str, Tuple[datetime, datetime]] = "today",
output_format: str = "dataframe"
) -> Union[pd.DataFrame, str, None]
Download Market Clearing Price (MCP) data.
Parameters:
period: Time period for data retrieval"today": Today's data"week": Last 7 days"month": Last 30 days(start_date, end_date): Custom date range as tuple of datetime objects
output_format: Output format -"dataframe"or"json"
Returns:
pd.DataFrame,str, orNone: Market data in requested format
stats()
stats(
period: Union[str, Tuple[datetime, datetime]] = "today"
) -> Optional[Dict[str, float]]
Get statistical summary of market clearing prices.
Parameters:
period: Time period (same as download)
Returns:
dict: Dictionary containing statistical measures:mean_price_tl: Average price in TLmin_price_tl: Minimum price in TLmax_price_tl: Maximum price in TLmedian_price_tl: Median price in TLstd_price_tl: Standard deviation of price in TLtotal_records: Number of recordsmean_price_eur: Average price in EUR (if available)mean_price_usd: Average price in USD (if available)
Requirements
- Python >= 3.7
- requests >= 2.25.0
- pandas >= 1.2.0
About EPİAŞ
EPİAŞ (Enerji Piyasaları İşletme A.Ş.) is the operator of Turkish electricity markets. The transparency platform provides public access to various electricity market data including market clearing prices, production data, consumption data, and more.
Note: You need to register on the EPİAŞ Transparency Platform to obtain credentials for using this library.
Author
Hasan Çağrı Güngör
- Email: iletisim@cagrigungor.com
- Website: https://www.cagrigungor.com
- GitHub: @hasancagrigungor
License
This project is licensed under the MIT License - see the LICENSE file for details.
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
Disclaimer
This library is not officially associated with EPİAŞ. Use at your own risk and make sure to comply with EPİAŞ terms of service.
Changelog
v0.1.1 (Latest)
- Updated GitHub repository URL
- Updated homepage URL
v0.1.0 (Initial Release)
- Basic client implementation
- Market Clearing Price (MCP) data retrieval
- Support for multiple time periods
- Statistical analysis features
- JSON and DataFrame output formats
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
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 pyepias-0.1.1.tar.gz.
File metadata
- Download URL: pyepias-0.1.1.tar.gz
- Upload date:
- Size: 6.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
38e21167ff98085a1a8a25f46eed3c9fe09cb1fbdc3f57bd8735630d59eb915b
|
|
| MD5 |
bf25e23c718577f021724b5807e41b30
|
|
| BLAKE2b-256 |
d4b20ecbd16816f436ecd06e8c6a0951cbf32eccfd249c2774ec53e1eb39e712
|
File details
Details for the file pyepias-0.1.1-py3-none-any.whl.
File metadata
- Download URL: pyepias-0.1.1-py3-none-any.whl
- Upload date:
- Size: 7.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4158d76c78d7a404b4e21277961b97131916fbdfcb1b8064c3caa0be7c216fdf
|
|
| MD5 |
a1c00a619011563a546bd1d3adc3bb04
|
|
| BLAKE2b-256 |
d68dafae6de2469e385bb5337555c0576cd4ab21da78b504716add34a1241003
|