forked from electricitymaps/electricitymaps-contrib
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
47 changed files
with
193 additions
and
154 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,7 +4,7 @@ | |
*secrets* | ||
*.env | ||
|
||
app | ||
mobileapp | ||
|
||
datascience | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,127 @@ | ||
{ | ||
"AL": { | ||
"country_iso_a2": "AL" | ||
}, | ||
"AT": { | ||
"country_iso_a2": "AT" | ||
}, | ||
"BA": { | ||
"country_iso_a2": "BA" | ||
}, | ||
"BE": { | ||
"country_iso_a2": "BE" | ||
}, | ||
"BG": { | ||
"country_iso_a2": "BG" | ||
}, | ||
"BY": { | ||
"country_iso_a2": "BY" | ||
}, | ||
"CH": { | ||
"country_iso_a2": "CH" | ||
}, | ||
"CZ": { | ||
"country_iso_a2": "CZ" | ||
}, | ||
"DE": { | ||
"country_iso_a2": "DE" | ||
}, | ||
"DK": { | ||
"country_iso_a2": "DK" | ||
}, | ||
"EE": { | ||
"country_iso_a2": "EE" | ||
}, | ||
"ES": { | ||
"country_iso_a2": "ES" | ||
}, | ||
"FI": { | ||
"country_iso_a2": "FI" | ||
}, | ||
"FR": { | ||
"country_iso_a2": "FR" | ||
}, | ||
"GB": { | ||
"country_iso_a2": "GB", | ||
"_comment": "Key should be GB-GBN (see https://en.wikipedia.org/wiki/ISO_3166-2:GB)" | ||
}, | ||
"GB-NIR": { | ||
"country_iso_a2": "GB", | ||
"flag_file_name": "_Northern%20Ireland.png" | ||
}, | ||
"GR": { | ||
"country_iso_a2": "GR" | ||
}, | ||
"HR": { | ||
"country_iso_a2": "HR" | ||
}, | ||
"HU": { | ||
"country_iso_a2": "HU" | ||
}, | ||
"IE": { | ||
"country_iso_a2": "IE" | ||
}, | ||
"IS": { | ||
"country_iso_a2": "IS" | ||
}, | ||
"IT": { | ||
"country_iso_a2": "IT" | ||
}, | ||
"LT": { | ||
"country_iso_a2": "LT" | ||
}, | ||
"LU": { | ||
"country_iso_a2": "LU" | ||
}, | ||
"LV": { | ||
"country_iso_a2": "LV" | ||
}, | ||
"MD": { | ||
"country_iso_a2": "MD" | ||
}, | ||
"ME": { | ||
"country_iso_a2": "ME" | ||
}, | ||
"MK": { | ||
"country_iso_a2": "MK" | ||
}, | ||
"MT": { | ||
"country_iso_a2": "MT" | ||
}, | ||
"NL": { | ||
"country_iso_a2": "NL" | ||
}, | ||
"NO": { | ||
"country_iso_a2": "NO" | ||
}, | ||
"PL": { | ||
"country_iso_a2": "PL" | ||
}, | ||
"PT": { | ||
"country_iso_a2": "PT" | ||
}, | ||
"RO": { | ||
"country_iso_a2": "RO" | ||
}, | ||
"RS": { | ||
"country_iso_a2": "RS" | ||
}, | ||
"RU": { | ||
"country_iso_a2": "RU" | ||
}, | ||
"SE": { | ||
"country_iso_a2": "SE" | ||
}, | ||
"SI": { | ||
"country_iso_a2": "SI" | ||
}, | ||
"SK": { | ||
"country_iso_a2": "SK" | ||
}, | ||
"TR": { | ||
"country_iso_a2": "TR" | ||
}, | ||
"UA": { | ||
"country_iso_a2": "UA" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
# Adding a new country | ||
It is very simple to add a new country. The Electricity Map backend runs a list of so-called *parsers* every 5min. Those parsers are responsible to fetch the generation mix for a given country (check out the existing list in the [parsers](https://github.com/corradio/electricitymap/tree/master/parsers) directory, or look at the [work in progress](https://github.com/tmrowco/electricitymap/issues?q=is%3Aissue+is%3Aopen+label%3Aparser)). | ||
|
||
A parser is a python script that is expected to define the method `fetch_production` which returns the production mix at current time, in the format: | ||
|
||
```python | ||
def fetch_production(country_code='FR', session=None): | ||
return { | ||
'countryCode': 'FR', | ||
'datetime': '2017-01-01T00:00:00Z', | ||
'production': { | ||
'biomass': 0.0, | ||
'coal': 0.0, | ||
'gas': 0.0, | ||
'hydro': 0.0, | ||
'nuclear': null, | ||
'oil': 0.0, | ||
'solar': 0.0, | ||
'wind': 0.0, | ||
'geothermal': 0.0, | ||
'unknown': 0.0 | ||
}, | ||
'storage': { | ||
'hydro': -10.0, | ||
}, | ||
'source': 'mysource.com' | ||
} | ||
``` | ||
|
||
The `session` object is a python request session that you can re-use to make HTTP requests. | ||
|
||
The production values should never be negative. Use `null`, or ommit the key, if a specific production mode is not known. | ||
Storage values can be both positive (when storing energy) or negative (when the storage is emptied). | ||
|
||
The parser can also return an array of objects if multiple time values can be fetched. The backend will automatically update past values properly. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters