Skip to content

Commit cf9a66f

Browse files
authored
Add SDK Version to Headers (#229)
* add sdk version to headers * updates * update version
1 parent cb3ceb3 commit cf9a66f

File tree

6 files changed

+13
-8
lines changed

6 files changed

+13
-8
lines changed

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "peopledatalabs"
3-
version = "6.4.0"
3+
version = "6.4.1"
44
description = "Official Python client for the People Data Labs API"
55
homepage = "https://www.peopledatalabs.com"
66
repository = "https://github.com/peopledatalabs/peopledatalabs-python"

src/peopledatalabs/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,6 @@
55
from .main import PDLPY
66

77

8-
__version__ = "6.4.0"
8+
__version__ = "6.4.1"
99

1010
__all__ = ["PDLPY"]

src/peopledatalabs/endpoints/__init__.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,14 @@
1313

1414
from ..errors import InvalidEndpointError
1515
from ..requests import Request
16+
from ..settings import settings
1617
from ..utils import check_empty_parameters
1718

1819
headers = {
1920
"Accept-Encoding": "gzip",
20-
"User-Agent": "PDL-PYTHON-SDK",
2121
"Content-Type": "application/json",
22+
"User-Agent": "PDL-PYTHON-SDK",
23+
"SDK-Version": settings.sdk_version,
2224
}
2325

2426

src/peopledatalabs/main.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
)
1010
from pydantic.v1.dataclasses import dataclass
1111

12-
1312
from .endpoints import Endpoint
1413
from .endpoints.person import Person
1514
from .endpoints.company import Company
@@ -87,8 +86,9 @@ def autocomplete(self, **kwargs):
8786
url=url,
8887
headers={
8988
"Accept-Encoding": "gzip",
90-
"User-Agent": "PDL-PYTHON-SDK",
9189
"Content-Type": "application/json",
90+
"User-Agent": "PDL-PYTHON-SDK",
91+
"SDK-Version": settings.sdk_version,
9292
},
9393
params=kwargs,
9494
validator=AutocompleteModel,
@@ -114,8 +114,9 @@ def job_title(self, **kwargs):
114114
url=url,
115115
headers={
116116
"Accept-Encoding": "gzip",
117-
"User-Agent": "PDL-PYTHON-SDK",
118117
"Content-Type": "application/json",
118+
"User-Agent": "PDL-PYTHON-SDK",
119+
"SDK-Version": settings.sdk_version,
119120
},
120121
params=kwargs,
121122
validator=JobTitleModel,
@@ -141,8 +142,9 @@ def ip(self, **kwargs):
141142
url=url,
142143
headers={
143144
"Accept-Encoding": "gzip",
144-
"User-Agent": "PDL-PYTHON-SDK",
145145
"Content-Type": "application/json",
146+
"User-Agent": "PDL-PYTHON-SDK",
147+
"SDK-Version": settings.sdk_version,
146148
},
147149
params=kwargs,
148150
validator=IPModel,

src/peopledatalabs/settings.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ class Settings:
1919
version: str = "v5"
2020
version_re: str = r"^v[0-9]$"
2121
sandbox_base_path: HttpUrl = "https://sandbox.api.peopledatalabs.com/"
22+
sdk_version: str = "6.4.1"
2223

2324

2425
settings = Settings()

tests/client/test_client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ def test_version():
1919
"""
2020
Version check.
2121
"""
22-
assert __version__ == "6.4.0"
22+
assert __version__ == "6.4.1"
2323

2424

2525
@pytest.mark.usefixtures("fake_api_key")

0 commit comments

Comments
 (0)