Skip to content

Commit

Permalink
Docs
Browse files Browse the repository at this point in the history
  • Loading branch information
Hexagon committed Feb 10, 2023
1 parent c702b07 commit 0a5744a
Show file tree
Hide file tree
Showing 44 changed files with 914 additions and 611 deletions.
24 changes: 6 additions & 18 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,29 +7,17 @@ pids
*.pid
*.seed

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
coverage

# VS Code Settings
.vscode

# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# node-waf configuration
.lock-wscript

# Compiled binary addons (http://nodejs.org/api/addons.html)
build/Release

# Dependency directory
# https://www.npmjs.org/doc/misc/npm-faq.html#should-i-check-my-node_modules-folder-into-git
node_modules

# Avoid committing temporary tests
testing.js
testing.ts
test.js
test.ts

# Deno specific
deno.lock

# Coverage
Expand Down
5 changes: 5 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"recommendations": [
"denoland.vscode-deno"
]
}
6 changes: 6 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"deno.enable": true,
"deno.lint": true,
"editor.defaultFormatter": "denoland.vscode-deno",
"editor.inlayHints.enabled": "off"
}
53 changes: 51 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,64 @@ npm install entsoe-api-client --save

## Documentation

Library and method documentation can be found at [deno.land/x/entsoe_api_client](https://deno.land/x/entsoe_api_client@0.9.4/mod.ts).

Documents structure and parameters returned by this library closely resemble what you find in [ENTSO-e REST API documentation](https://transparency.entsoe.eu/content/static_content/Static%20content/web%20api/Guide.html), so have a look there too.

If you want a `Publication_MarketDocument`, the corresponding function in this library is `QueryPublication`. In the resulting document (object), the key `receiver_MarketParticipant.mRID` will become `receiverMarketParticipantId`. The same goes for parameters. We recommend have auto-completion enabled in your editor, the types will give great help in navigating the parameters and document objects.

Another difference compared to source documents is that most ids automatically get a complementary description, where applicable.
As an example `businessType`=`B33` in the raw xml will result in keys `businessType: "B33"` and `businessTypeDescription: "Area Control Error"` in the output.

> **Note**
> Full library and method documentation can be found at [deno.land/x/entsoe_api_client](https://deno.land/x/entsoe_api_client@0.9.4/mod.ts).
### Methods

| Method | Interface | Description |
|-----------------------------|-----------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------|
| Query | (securityToken, params)<br>=><br>Promise<unknown[]> | Fetch any document, and return a array of typed and<br>parsed JavaScript object(s). Primarily internal, but exported. |
| QueryPublication | (securityToken, params)<br>=><br>Promise<PublicationDocument[]> | Request Publication_MarketDocument(s), and return<br>a array of typed and parsed JavaScript object(s) |
| QueryGL | (securityToken, params)<br>=><br>Promise<GLDocument[]> | Same, for GL_MarketDocument |
| QueryUnavailability | (securityToken, params)<br>=><br>Promise<UnavailabilityDocument[]> | Same, for Unavailability_MarketDocument |
| QueryConfiguration | (securityToken, params)<br>=><br>Promise<ConfigurationDocument[]> | Same, for Configuration_MarketDocument |
| QueryBalancing | (securityToken, params)<br>=><br>Promise<BalancingDocument[]> | Same, for Balancing_MarketDocument(s) |
| QueryTransmissionNetwork | (securityToken, params)<br>=><br>Promise<TransmissionNetworkD...> | Same, for Transmission_MarketDocument(s) |
| QueryCriticalNetworkElement | (securityToken, params)<br>=><br>Promise<CriticalNetworkEleme...> | Same, for CriticalNetworkElement_MarketDocument(s) |
| ParseDocument | (xmlDocument)<br>=><br>PublicationDocument\|BalancingDoc... | Parses raw XML into a typed object. <br>Primarily internal, but exported and usable. |
| FirstAreaByIdentifier | (identifier)<br>=><br>string[] \| undefined | Finds internal id (10YL-1001A00074) of all areas<br> having aspecific identier (CTA\|SE, BZN\|DE-LU etc...) |
| AllAreasByIdentifier | (identifier)<br>=><br>string \| undefined | Same as above, but return first match |

### Parameters

All parameters that can be passes to `Query()`, `QueryPublication()` etc.

| Parameter Name | Type | Name in ENSO-e REST API | Note |
|----------------------------------------|--------|---------------------------------------------|------------------------------------------------------------|
| documentType | string | DocumentType | |
| processType (optional) | string | ProcessType | |
| businessType (optional) | string | BusinessType | |
| psrType (optional) | string | PsrType | |
| inDomain (optional) | string | In_Domain | |
| inBiddingZoneDomain (optional) | string | InBiddingZone_Domain | |
| biddingZoneDomain (optional) | string | BiddingZone_Domain | |
| outDomain (optional) | string | Out_Domain | |
| outBiddingZoneDomain (optional) | string | OutBiddingZone_Domain | |
| startDateTime(optional) | Date | TimeInterval | ISO8601 string |
| endDateTime (optional) | Date | TimeInterval | ISO8601 string |
| startDateTimeUpdate (optional) | Date | TimeIntervalUpdate | ISO8601 string |
| endDateTimeUpdate (optional) | Date | TimeIntervalUpdate | ISO8601 string |
| offset (optional) | number | Offset | Enables fetching more than x documents by using pagination |
| implementationDateAndOrTime (optional) | string | Implementation_DateAndOrTime | ISO8601 string |
| contractMarketAgreementType (optional) | string | Contract_MarketAgreement.Type | |
| auctionType (optional) | string | Auction.Type | |
| auctionCategory (optional) | string | Auction.Category | |
| classificationSequenceAICPosition (optional)| string | ClassificationSequence_(...).Position | |
| connectingDomain (optional) | string | connecting_Domain | |
| standardMarketProduct (optional) | string | Standard_MarketProduct | |
| originalMarketProduct(optional) | string | Original_MarketProduct | |
| registeredResource (optional) | string | registeredResource | |
| acquiringDomain (optional) | string | Acquiring_Domain | |
| mRID (optional) | string | mRID | |
| docStatus (optional) | string | DocStatus | |

## Examples

Expand Down
6 changes: 3 additions & 3 deletions examples/generation-forecast.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
**/

// Deno import:
import { QueryGL } from "https://deno.land/x/entsoe_api_client/mod.ts";
import { QueryGL, FirstAreaByIdentifier } from "../mod.ts";

// Node import:
// import { QueryGL } from "entsoe-api-client";
Expand All @@ -30,8 +30,8 @@ const result = await QueryGL(
{
documentType: "A71", // A71 - Generation forecast
processType: "A01", // A01 - Day ahead
inDomain: "Sweden (SE)",
outDomain: "Sweden (SE)",
inDomain: FirstAreaByIdentifier("Sweden (SE)"), // FistAreaByIdentifier resolves to "10YSE-1--------K" which is also CTA|SE, MBA|SE etc...
outDomain: FirstAreaByIdentifier("Sweden (SE)"),
startDateTime: dateToday, // Start date
endDateTime: dateTomorrow // End date
}
Expand Down
6 changes: 3 additions & 3 deletions examples/generation-per-unit.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
**/

// Deno import:
import { QueryGL } from "https://deno.land/x/entsoe_api_client/mod.ts";
import { QueryGL, FirstAreaByIdentifier } from "https://deno.land/x/entsoe_api_client/mod.ts";

// Node import:
// import { QueryGL } from "entsoe-api-client";
Expand All @@ -32,8 +32,8 @@ const result = await QueryGL(
{
documentType: "A75", // A75 - Actual generation per type
processType: "A16", // A16 - Realised
inDomain: "BZN|SE2", // In_Domain
outDomain: "BZN|SE2", // Out_Domain
inDomain: FirstAreaByIdentifier("BZN|SE2"), // In_Domain
outDomain: FirstAreaByIdentifier("BZN|SE2"), // Out_Domain
startDateTime: dateToday, // Start date
endDateTime: dateTomorrow, // End date
}
Expand Down
4 changes: 2 additions & 2 deletions examples/outages.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
**/

// Deno:
import { QueryUnavailability } from "https://deno.land/x/entsoe_api_client/mod.ts";
import { QueryUnavailability, FirstAreaByIdentifier } from "https://deno.land/x/entsoe_api_client/mod.ts";

// Node:
// import { QueryUnavailability } from "entsoe-api-client";
Expand All @@ -30,7 +30,7 @@ const result = await QueryUnavailability(
: Deno.env.get("API_TOKEN"), // ... in Deno
{
documentType: "A77", // A77 - Production unavailability OR A80 - Generation unavailability
biddingZoneDomain: "CTA|SE", // biddingZone_Domain
biddingZoneDomain: FirstAreaByIdentifier("CTA|SE"), // biddingZone_Domain
startDateTime: dateToday, // Start date
endDateTime: dateTomorrow, // End date
offset: 0
Expand Down
4 changes: 2 additions & 2 deletions examples/prod-and-gen-units.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* @license MIT
**/

import { QueryConfiguration } from "https://deno.land/x/entsoe_api_client/mod.ts";
import { QueryConfiguration, FirstAreaByIdentifier } from "https://deno.land/x/entsoe_api_client/mod.ts";

// Node import:
// import { QueryConfiguration } from "entsoe-api-client";
Expand All @@ -24,7 +24,7 @@ const result = await QueryConfiguration(
{
documentType: "A95",
businessType: "B11",
biddingZoneDomain: "BZN|SE3",
biddingZoneDomain: FirstAreaByIdentifier("BZN|SE3"),
implementationDateAndOrTime: dateToday.toLocaleDateString('sv-SE') // sv-SE yields a date in format YYYY-MM-DD
}
);
Expand Down
6 changes: 3 additions & 3 deletions examples/spot-prices-today.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
**/

// Deno import:
import { QueryPublication } from "https://deno.land/x/entsoe_api_client/mod.ts";
import { QueryPublication, FirstAreaByIdentifier } from "https://deno.land/x/entsoe_api_client/mod.ts";

// Node import:
// import { QueryPublication } from "entsoe-api-client";
Expand All @@ -29,8 +29,8 @@ const result = await QueryPublication(
{
documentType: "A44", // A44 - Price document
processType: "A01", // A01 - Day ahead
inDomain: "SE2", // In_Domain: For A44 - Electricity price area
outDomain: "SE2", // Out_Domain: For A44 - Electricity price area
inDomain: FirstAreaByIdentifier("BZN|SE2"), // In_Domain: For A44 - Electricity price area
outDomain: FirstAreaByIdentifier("BZN|SE2"), // Out_Domain: For A44 - Electricity price area
startDateTime: dateToday, // Start date
endDateTime: dateTomorrow // End date
}
Expand Down
Loading

0 comments on commit 0a5744a

Please sign in to comment.