smard-api icon indicating copy to clipboard operation
smard-api copied to clipboard

Issue with example

Open staniPetrox opened this issue 3 years ago • 5 comments

Invalid value for region (day), must be one of ['DE', 'AT', 'LU', 'DE-LU', 'DE-AT-LU', '50Hertz', 'Amprion', 'TenneT', 'TransnetBW', 'APG', 'Creos']

Just tried to use the example, didn't work

staniPetrox avatar May 27 '22 17:05 staniPetrox

Hi,

Thanks for reporting.

Which example are you referring to?

wirthual avatar Jun 29 '22 05:06 wirthual

Just had the same issue.

It is the example in the readme.md of https://github.com/bundesAPI/smard-api)/python-client/

This error is easy to solve: in the following row, the variables are in the wrong order: api_instance.filter_region_filter_copy_region_copy_resolution_timestamp_json_get(filter, filter_copy, region, region_copy, resolution, timestamp)

I solved it by making it explicit: api_instance.filter_region_filter_copy_region_copy_resolution_timestamp_json_get(filter = filter, filter_copy = filter_copy, region = region, region_copy = region_copy, resolution = resolution, timestamp = timestamp)

Anyhow if corrected the following error appears:

`Exception when calling DefaultApi->filter_region_filter_copy_region_copy_resolution_timestamp_json_get: (404)
Reason: Not Found
HTTP response headers: HTTPHeaderDict({'Content-Security-Policy': "frame-ancestors 'self' *.smard.de; default-src *.gstatic.com *.googleapis.com 'unsafe-inline' 'self' *.smard.de; img-src data: *.googleapis.com *.gstatic.com 'self' *.smard.de 'unsafe-inline'; script-src 'unsafe-eval' 'unsafe-inline' 'self' *.smard.de *.googleapis.com", 'X-Content-Type-Options': 'nosniff', 'X-UA-Compatible': 'IE=edge', 'Date': 'Wed, 03 Aug 2022 14:08:33 GMT', 'Content-Length': '0', 'Set-Cookie': 'bnetza_cookie=!8fEHEKip8IQV+cHp/+OfuGMAvOUzBbJ3ORwq3Jp+Mk9HcFSGJHZ3LcZ+3gpXWV7EaAT6C0ttOU2AeA==; path=/; Httponly; Secure, TS01418b58=01e68c70d5ff1a49d9bf44c221f27ac344df68ca276cf1a36aef1e4f16da1b5af237b486890ccf61f59e82e78fc79c0f704a80e02abff07b76688bcc43d2589ca57071c73a; Path=/; Domain=.www.smard.de; Secure; HTTPOnly', 'Strict-Transport-Security': 'max-age=16070400; includeSubDomains'})`

ThomasRegier avatar Aug 03 '22 14:08 ThomasRegier

The example and the whole python client you're referring to is autogenerated which could lead to issues. Maybe regeneration of the python client could solve the issues?

lukaspanni avatar Oct 06 '22 07:10 lukaspanni

@lukaspanni thanks for your idea.

But since I found a solution for issue #9 I'm able to download the data directly and in a flexible way.

https://stackoverflow.com/questions/73219857/perform-download-via-download-button-when-request-url-in-browser-inspect-does-no/73743659#73743659

I'm just not yet able to match production, consumption, and trade data correctly. Don't know if I do not do the correct check or if the data is just shitty.

ThomasRegier avatar Oct 06 '22 12:10 ThomasRegier

Btw: I think the original issue here is solved as soon as my answer from 3rd of August is implemented.

But since I do not use the repository anymore. I deleted it from my computer.

ThomasRegier avatar Oct 06 '22 12:10 ThomasRegier