Skip to content

Commit

Permalink
Merge pull request planetlabs#1086 from planetlabs/steve/sync-user-agent
Browse files Browse the repository at this point in the history
update user agent for sync client
  • Loading branch information
stephenhillier authored Dec 19, 2024
2 parents e3aa242 + eb94132 commit e2234fd
Showing 1 changed file with 8 additions and 3 deletions.
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

0 comments on commit e2234fd

Please sign in to comment.