Skip to content

Commit

Permalink
Merge pull request #130 from traveltime-dev/add/custom-agent
Browse files Browse the repository at this point in the history
add custom user agent for python sdk
  • Loading branch information
danielnaumau authored Aug 27, 2024
2 parents 212ef51 + 700e6f1 commit bb56514
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions traveltimepy/sdk.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,9 +95,16 @@ def __init__(
host: str = "api.traveltimeapp.com",
proto_host: str = "proto.api.traveltimeapp.com",
timeout: int = 300,
user_agent: Optional[str] = None,
) -> None:
self._app_id = app_id
self._api_key = api_key

if user_agent is not None:
self._user_agent = user_agent
else:
self._user_agent = f"Travel Time Python SDK {__version__}"

self._sdk_params = SdkParams(
host,
proto_host,
Expand Down

0 comments on commit bb56514

Please sign in to comment.