Skip to content

Commit 09e6d42

Browse files
committed
feat: Add more info to user-agent string
1 parent 9a85da4 commit 09e6d42

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1919

2020
Note: older library versions also support the new languages, this update only adds new code constants.
2121
### Changed
22+
* Added system, python and request library version information to the user-agent string that is sent with API calls.
2223
### Deprecated
2324
### Removed
2425
### Fixed

deepl/http_client.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,18 @@
55
from . import version
66
from .exceptions import ConnectionException, DeepLException
77
import http
8+
import platform
89
import random
910
import requests
1011
import time
1112
from typing import Dict, Optional, Tuple, Union
1213
from .util import log_info
1314

1415

15-
user_agent = f"deepl-python/{version.VERSION}"
16+
user_agent = (
17+
f"deepl-python/{version.VERSION} ({platform.platform()}) "
18+
f"python/{platform.python_version()} requests/{requests.__version__}"
19+
)
1620
max_network_retries = 5
1721
min_connection_timeout = 10.0
1822

0 commit comments

Comments
 (0)