OpenEnergyPlatform / open-MaStR

A collaborative software to download the energy database Marktstammdatenregister (MaStR)
https://open-mastr.readthedocs.io/en/latest/
GNU Affero General Public License v3.0
83 stars 17 forks source link

add open-mastr user agent to bulk download requests #526

Closed maurerle closed 3 months ago

maurerle commented 3 months ago

Summary of the discussion

adds a User-Agent to the requests when doing a bulk download. The importlib.metadata is available in the python core since version 3.9, so for all supported versions.

In the rare but possible case, that the open-mastr module is called directly without being installed in any way, the user-agent is simply set to open-mastr without any version.

As all requests also contain the version of the python-requests library, this is added as well to provide metadata.

Workflow checklist

Automation

Closes #489

PR-Assignee

Reviewer

FlorianK13 commented 3 months ago

API Credentials are not revealed for PRs from outside. I will merge anyway and rely on the tests that are running before the next release.

Thanks @maurerle for your PRs!