Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add French carbon intensity provider #42

Open
mrchrisadams opened this issue Jul 16, 2022 · 2 comments
Open

Add French carbon intensity provider #42

mrchrisadams opened this issue Jul 16, 2022 · 2 comments
Labels
good first issue Good for newcomers

Comments

@mrchrisadams
Copy link
Member

mrchrisadams commented Jul 16, 2022

I found a cool project called Tracarbon the other day.

They do a lot of what this project does, but I discoered that they use a data feed from what appears to a French grid operator for free, hourly, average carbon intensity data.

https://www.rte-france.com/eco2mix

Here's the code we'd need to implement in Golang to provide the numbers in an exporter for France

https://github.com/fvaleye/tracarbon/blob/main/tracarbon/locations/country.py#L113

And here's an example of the data returned in a request:
https://odre.opendatasoft.com/api/records/1.0/search/?dataset=eco2mix-national-tr

I haven't looked into the geographical or temporal resolution for this, nor the licensing, but it looks to be around hourly.

@rossf7
Copy link
Contributor

rossf7 commented Aug 1, 2022

This is a great find and integrating with the API doesn't look too hard.

Once the API changes in #44 are done I think we could add this provider and document the steps involved.

This would make it easier for the community to contribute more providers.

@mrchrisadams mrchrisadams added the good first issue Good for newcomers label Sep 25, 2022
@mrchrisadams
Copy link
Member Author

This appears to be national level info, updating every 15 minutes.

Here's an example API call:

https://odre.opendatasoft.com/api/records/1.0/search/?dataset=eco2mix-national-tr&q=&rows=1&facet=taux_co2&facet=date_heure&refine.date=2022-09-25&refine.heure=18:30

Broken down, and in pseudo code that request is largely

https://odre.opendatasoft.com/api/records/1.0/search/ # our API path
dataset=eco2mix-national-t    # use this dataset
rows=1                        # just give us one row for the next 30mins
facet=taux_co2                # we want taux_co2 (I'm not sure what the french is here - presumably total CO2?)
facet=date_heure              # filter by time
refine.date=2022-09-25        # we need to pass the date we are querying for
refine.heure=18:30            # we also need to pass the hour and minute.

You need to send data in UTC time.

Presumably, we could use the Carbon Intensity UK provider as a reference point, as that is similarly tied to a specific country / location

https://github.com/thegreenwebfoundation/grid-intensity-go/blob/main/pkg/provider/carbon_intensity_uk.go

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants