entsoe

package module
v0.1.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 24, 2024 License: EUPL-1.2 Imports: 8 Imported by: 0

README

Simple library for requesting pricing data from Entso-e

This is a simple library for requesting pricing data from Entso-e Transparency platform. You need to have a valid API key to access the Entso-e REST API. Follow their instructions to get one.

Usage

Can be used as a library or as is. Build code with just build and then run either the cli or server version of it.

$ just build
$ ENTSOE_TOKEN="<your-token>" bin/entsoe-server &
$ curl -s https://localhost:8080/api/entsoe/pricing/2024-11-21
{"start_time":"2024-11-20T23:00:00Z","end_time":"2024-11-21T23:00:00Z","prices":[13.3,11.35,11.41,13.82,14.64,16.61,81.88,105.04,116.49,118.3,109.75,90.02,77.74,90.5,79.1,79.22,99.69,95.09,93.73,80.07,65.04,60.59,60.21,48.46]}

See cmd/entso-cli/main.go and cmd/entso-server/main.go for more example usage.

Documentation

Index

Constants

View Source
const (
	ENTSO_PRICE_API                    = "https://web-api.tp.entsoe.eu/api"
	ENTSO_PRICE_API_TEMPLATE           = "%s?securityToken=%s&documenttype=A44&periodStart=%s&periodEnd=%s&out_Domain=%s&in_Domain=%s"
	ENTSO_PRICE_API_PERIOD_TIME_FORMAT = "200601021504"
)

Variables

View Source
var MapEICCode = map[string]string{
	"FIN": "10YFI-1--------U",
}

MapEICCode contains human-readable and memorable name abbreviation of the bidding zone. More areas can be added as needed. See https://transparencyplatform.zendesk.com/hc/en-us/articles/15885757676308-Area-List-with-Energy-Identification-Code-EIC.

Functions

This section is empty.

Types

type EntsoeAPIError

type EntsoeAPIError struct {
	Code    string
	Message string
}

func (*EntsoeAPIError) Error

func (e *EntsoeAPIError) Error() string

type EntsoePriceApi

type EntsoePriceApi struct {
	// contains filtered or unexported fields
}

func NewEntsoePriceApi

func NewEntsoePriceApi(securityToken, domain string) EntsoePriceApi

Create new instance of EntsoePriceApi. securityToken is required parameter, domain is optional and can be empty string.

func (EntsoePriceApi) GetEnergyPrices

func (e EntsoePriceApi) GetEnergyPrices(day time.Time) (EntsoePrices, error)

func (EntsoePriceApi) GetEnergyPricesForDomain added in v0.1.1

func (e EntsoePriceApi) GetEnergyPricesForDomain(day time.Time, domain string) (EntsoePrices, error)

type EntsoePrices

type EntsoePrices struct {
	StartTime     time.Time `json:"start_time"`
	EndTime       time.Time `json:"end_time"`
	ResolutionMin int       `json:"resolution_min"`
	Prices        []float64 `json:"prices"`
}

func FromXml added in v0.1.1

func FromXml(data []byte) (EntsoePrices, error)

Parse Entso-e Prices from xml. Might fail if xml isn't in correct format.

func NewEntsoePrices

func NewEntsoePrices(doc entsoedoc.Publication) EntsoePrices

Directories

Path Synopsis
cmd
pkg

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳