Skip to content

Commit

Permalink
Move version metadata to outside the ODPAmsterdam class (#682)
Browse files Browse the repository at this point in the history
* Move version metadata to outside the ODPAmsterdam class

* Move version metadata to outside the ODPAmsterdam class
  • Loading branch information
klaasnicolaas authored Jun 28, 2024
1 parent 9d5bddc commit 14ccf6d
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/odp_amsterdam/odp_amsterdam.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,12 @@
)
from .models import Garage, ParkingSpot

VERSION = metadata.version(__package__)


@dataclass
class ODPAmsterdam:
"""Main class for handling data fetchting from Open Data Platform of Amsterdam."""
"""Main class for handling data fetching from Open Data Platform of Amsterdam."""

request_timeout: float = 15.0
session: ClientSession | None = None
Expand Down Expand Up @@ -59,14 +61,13 @@ async def _request(
the Open Data Platform API of Amsterdam.
"""
version = metadata.version(__package__)
url = URL.build(scheme="https", host="api.data.amsterdam.nl", path="/").join(
URL(uri),
)

headers = {
"Accept": "application/json, text/plain, application/geo+json",
"User-Agent": f"PythonODPAmsterdam/{version}",
"User-Agent": f"PythonODPAmsterdam/{VERSION}",
}

if self.session is None:
Expand Down

0 comments on commit 14ccf6d

Please sign in to comment.