Skip to content

Releases: devuo/omiedata

v1.1.0 - Average Price Calculator Example

16 Aug 22:30

Choose a tag to compare

What's New

Features

  • Added average-price example that calculates average Portugal electricity prices for a date range
    • Takes start and end dates as DD-MM-YYYY format
    • Fetches data from start date 00:00 to end date+1 00:00
    • Calculates and displays average PT price across all hours

Documentation

  • Updated README with new example usage
  • Updated CLAUDE.md with new example commands

Usage

go run ./examples/average-price -start 01-01-2024 -end 03-01-2024

This will fetch OMIE data for January 1-3, 2024 and calculate the average Portugal electricity price.

v1.0.3 - Remove Planned Features

02 Aug 15:35

Choose a tag to compare

What's Changed

Documentation

  • Removed all references to planned features (Intraday Prices)
  • Simplified library name from "OMIEData Go Library" to "OMIEData"
  • Updated documentation to reflect only implemented features

Clean Up

  • Removed IntradayPrice type exports from omiedata.go
  • Cleaned up CLAUDE.md development guide

This is a patch release with documentation updates only. No functional changes.

Note: The library now focuses on the two implemented features:

  • Marginal Prices
  • Energy by Technology

v1.0.2 - Documentation and Formatting Updates

02 Aug 15:30

Choose a tag to compare

What's Changed

Documentation

  • Removed references to planned Supply/Demand Curves feature from README and documentation
  • Kept Energy by Technology feature documentation as it's already implemented

Code Quality

  • Applied gofmt -s formatting to all Go files for consistent code style
  • No functional changes, only formatting improvements

Maintenance

  • Updated CLAUDE.md development guide to reflect current feature set
  • Cleaned up type exports in omiedata.go

This is a patch release with no breaking changes or new functionality.

v1.0.1 - Examples Organization

01 Aug 13:33

Choose a tag to compare

Changes

🗂️ Examples Organization

  • Moved examples from flat structure to organized subdirectories
  • examples/marginal-price/main.go - Basic price data import example
  • examples/energy-by-technology/main.go - Technology breakdown analysis example
  • Updated README.md and CLAUDE.md with correct example paths

📚 Documentation Updates

  • Fixed example paths in README.md from ./cmd/ to ./examples/
  • Updated CLAUDE.md project structure documentation
  • Improved example directory organization following Go conventions

This patch release improves project organization and makes examples easier to navigate and run.

Full Changelog: v1.0.0...v1.0.1

v1.0.0 - Initial Release

01 Aug 13:08

Choose a tag to compare

OMIEData Go Library v1.0.0 🎉

This is the initial release of the OMIEData Go library, a complete port of the OMIEData Python library for accessing electricity market data from OMIE (Iberian Peninsula's Electricity Market Operator).

✨ Features

Data Types Supported

  • Marginal Prices: Hourly electricity prices for Spain and Portugal
  • Energy by Technology: Generation breakdown by source (wind, solar, nuclear, etc.)
  • Historical Format Support: Handles format changes from 2006 to present
  • DST Support: Correctly handles daylight saving time changes (23/25 hour days)

Key Capabilities

  • European Number Format: Proper parsing of comma decimals and dot thousands separators
  • Concurrent Downloads: Parallel data fetching with configurable limits
  • Type Safety: Full Go type safety with proper error handling
  • Multiple Systems: Support for Spanish, Portuguese, and Iberian markets
  • Format Evolution: Automatic handling of OMIE format changes over time

🚀 Quick Start

package main

import (
    "context"
    "fmt"
    "log"
    "time"
    
    "github.com/devuo/omiedata"
)

func main() {
    // Get marginal prices for yesterday
    importer := omiedata.NewMarginalPriceImporter()
    ctx := context.Background()
    yesterday := time.Now().AddDate(0, 0, -1)
    
    data, err := importer.ImportSingleDate(ctx, yesterday)
    if err \!= nil {
        log.Fatal(err)
    }
    
    priceData := data.(*omiedata.MarginalPriceData)
    fmt.Printf("Date: %s\n", priceData.Date.Format("2006-01-02"))
    
    for hour := 1; hour <= 24; hour++ {
        if price, exists := priceData.SpainPrices[hour]; exists {
            fmt.Printf("Hour %2d: %.2f EUR/MWh\n", hour, price)
        }
    }
}

🔧 Installation

go get github.com/devuo/omiedata

📊 Data Types

Marginal Price Data

  • Spain and Portugal hourly prices (EUR/MWh)
  • Energy volumes by market segment
  • Bilateral energy flows
  • Historical format conversion (Cent/kWh → EUR/MWh)

Energy by Technology

  • Nuclear, wind, solar, hydro, coal, gas generation
  • Hourly breakdown by technology type
  • System-specific data (Spain, Portugal, Iberian)
  • Renewable energy percentage calculations

🧪 Testing

Comprehensive test suite with:

  • Format Evolution Tests: Validates parsing across historical format changes
  • European Number Format Tests: Ensures proper comma/dot handling
  • Real Data Validation: Tests against actual OMIE files
  • Edge Case Coverage: DST changes, missing data, format variations

Run tests:

go test ./...

📈 Performance

  • Concurrent Downloads: Up to 5 parallel connections by default
  • Streaming Processing: Low memory usage for large date ranges
  • Native Go Performance: Optimized for speed and efficiency

🏗️ Architecture

omiedata/
├── types/       # Data structures and enums
├── parsers/     # File parsing with European number format support
├── downloaders/ # HTTP client with retry logic
├── importers/   # High-level API
└── testdata/    # Sample files for testing

🐛 Bug Fixes & Improvements

European Number Format Parsing

  • ✅ Fixed parsing of values like "7.087,2" → 7087.2
  • ✅ Proper handling of thousands separators and decimal commas
  • ✅ Support for both "1.432,0" and "25,7" formats

Column Mapping

  • ✅ Correct technology column detection in Spanish headers
  • ✅ Fixed URL generation for energy by technology downloads
  • ✅ Proper field assignment for all data types

Data Validation

  • ✅ NaN handling for empty/missing values
  • ✅ Hour indexing validation (1-24, with 25 for DST)
  • ✅ Multi-format support across different file years

🔗 Related Links

🙏 Acknowledgments

  • Based on the original OMIEData Python library
  • OMIE for providing the electricity market data
  • Go community for excellent tooling and libraries

Full Changelog: https://github.com/devuo/omiedata/commits/v1.0.0