Skip to content

update user agent for sync client #1086

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

Merged
merged 4 commits into from
Dec 19, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions planet/sync/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@
from .orders import OrdersAPI
from .subscriptions import SubscriptionsAPI
from planet.http import Session
from planet.__version__ import __version__

SYNC_CLIENT_AGENT = "python-sdk-sync"
SYNC_CLIENT_X_PLANET_APP = "python-sdk-sync"


class Planet:
Expand Down Expand Up @@ -42,8 +43,12 @@ class Planet:

def __init__(self, session: Optional[Session] = None) -> None:
self._session = session or Session()
self._session._client.headers.update(
{"X-Planet-App": SYNC_CLIENT_AGENT})
self._session._client.headers.update({
"X-Planet-App":
SYNC_CLIENT_X_PLANET_APP,
"User-Agent":
f"planet-client-python/{__version__}/sync"
})

self.data = DataAPI(self._session)
self.orders = OrdersAPI(self._session)
Expand Down
Loading