Skip to content

Commit

Permalink
feat: Add more info to user-agent string
Browse files Browse the repository at this point in the history
  • Loading branch information
JanEbbing committed Feb 15, 2023
1 parent 9a85da4 commit 09e6d42
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

Note: older library versions also support the new languages, this update only adds new code constants.
### Changed
* Added system, python and request library version information to the user-agent string that is sent with API calls.
### Deprecated
### Removed
### Fixed
Expand Down
6 changes: 5 additions & 1 deletion deepl/http_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,18 @@
from . import version
from .exceptions import ConnectionException, DeepLException
import http
import platform
import random
import requests
import time
from typing import Dict, Optional, Tuple, Union
from .util import log_info


user_agent = f"deepl-python/{version.VERSION}"
user_agent = (
f"deepl-python/{version.VERSION} ({platform.platform()}) "
f"python/{platform.python_version()} requests/{requests.__version__}"
)
max_network_retries = 5
min_connection_timeout = 10.0

Expand Down

0 comments on commit 09e6d42

Please sign in to comment.