hyperbrowser 0.20.0__py3-none-any.whl → 0.21.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of hyperbrowser might be problematic. Click here for more details.

@@ -1,4 +1,9 @@
1
- from hyperbrowser.models.profile import ProfileResponse, CreateProfileResponse
1
+ from hyperbrowser.models.profile import (
2
+ CreateProfileResponse,
3
+ ProfileListParams,
4
+ ProfileListResponse,
5
+ ProfileResponse,
6
+ )
2
7
  from hyperbrowser.models.session import BasicResponse
3
8
 
4
9
 
@@ -23,3 +28,11 @@ class ProfileManager:
23
28
  self._client._build_url(f"/profile/{id}"),
24
29
  )
25
30
  return BasicResponse(**response.data)
31
+
32
+ async def list(
33
+ self, params: ProfileListParams = ProfileListParams()
34
+ ) -> ProfileListResponse:
35
+ response = await self._client.transport.get(
36
+ self._client._build_url("/profiles"), params=params.__dict__
37
+ )
38
+ return ProfileListResponse(**response.data)
@@ -1,4 +1,9 @@
1
- from hyperbrowser.models.profile import ProfileResponse, CreateProfileResponse
1
+ from hyperbrowser.models.profile import (
2
+ CreateProfileResponse,
3
+ ProfileListParams,
4
+ ProfileListResponse,
5
+ ProfileResponse,
6
+ )
2
7
  from hyperbrowser.models.session import BasicResponse
3
8
 
4
9
 
@@ -23,3 +28,11 @@ class ProfileManager:
23
28
  self._client._build_url(f"/profile/{id}"),
24
29
  )
25
30
  return BasicResponse(**response.data)
31
+
32
+ def list(
33
+ self, params: ProfileListParams = ProfileListParams()
34
+ ) -> ProfileListResponse:
35
+ response = self._client.transport.get(
36
+ self._client._build_url("/profiles"), params=params.__dict__
37
+ )
38
+ return ProfileListResponse(**response.data)
@@ -1,5 +1,7 @@
1
- from pydantic import BaseModel, ConfigDict, Field
2
1
  from datetime import datetime
2
+ from typing import List
3
+
4
+ from pydantic import BaseModel, ConfigDict, Field
3
5
 
4
6
 
5
7
  class CreateProfileResponse(BaseModel):
@@ -15,3 +17,41 @@ class ProfileResponse(BaseModel):
15
17
  team_id: str = Field(alias="teamId")
16
18
  created_at: datetime = Field(alias="createdAt")
17
19
  updated_at: datetime = Field(alias="updatedAt")
20
+
21
+
22
+ class ProfileListParams(BaseModel):
23
+ """
24
+ Parameters for listing profiles.
25
+ """
26
+
27
+ model_config = ConfigDict(
28
+ populate_by_alias=True,
29
+ )
30
+
31
+ page: int = Field(default=1, ge=1)
32
+ limit: int = Field(default=10, ge=1)
33
+
34
+
35
+ class ProfileListResponse(BaseModel):
36
+ """
37
+ Response containing a list of profiles with pagination information.
38
+ """
39
+
40
+ model_config = ConfigDict(
41
+ populate_by_alias=True,
42
+ )
43
+
44
+ profiles: List[ProfileResponse]
45
+ total_count: int = Field(alias="totalCount")
46
+ page: int
47
+ per_page: int = Field(alias="perPage")
48
+
49
+ @property
50
+ def has_more(self) -> bool:
51
+ """Check if there are more pages available."""
52
+ return self.total_count > (self.page * self.per_page)
53
+
54
+ @property
55
+ def total_pages(self) -> int:
56
+ """Calculate the total number of pages."""
57
+ return -(-self.total_count // self.per_page)
@@ -1,8 +1,9 @@
1
- from typing import Any, List, Literal, Optional, Union
2
1
  from datetime import datetime
3
- from pydantic import BaseModel, Field, ConfigDict, field_validator
2
+ from typing import Any, List, Literal, Optional, Union
3
+
4
+ from pydantic import BaseModel, ConfigDict, Field, field_validator
4
5
 
5
- from hyperbrowser.models.consts import Country, OperatingSystem, Platform, ISO639_1
6
+ from hyperbrowser.models.consts import ISO639_1, Country, OperatingSystem, Platform
6
7
 
7
8
  SessionStatus = Literal["active", "closed", "error"]
8
9
 
@@ -66,6 +67,7 @@ class SessionListParams(BaseModel):
66
67
 
67
68
  status: Optional[SessionStatus] = Field(default=None, exclude=None)
68
69
  page: int = Field(default=1, ge=1)
70
+ limit: int = Field(default=10, ge=1)
69
71
 
70
72
 
71
73
  class SessionListResponse(BaseModel):
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: hyperbrowser
3
- Version: 0.20.0
3
+ Version: 0.21.0
4
4
  Summary: Python SDK for hyperbrowser
5
5
  License: MIT
6
6
  Author: Nikhil Shahi
@@ -4,13 +4,13 @@ hyperbrowser/client/base.py,sha256=9gFma7RdvJBUlDCqr8tZd315UPrjn4ldU4B0-Y-L4O4,1
4
4
  hyperbrowser/client/managers/async_manager/crawl.py,sha256=hBS2WwfE0-ZopCW9PjP30meU5iTDdRViFl1C1OF1hVU,2291
5
5
  hyperbrowser/client/managers/async_manager/extension.py,sha256=a-xYtXXdCspukYtsguRgjEoQ8E_kzzA2tQAJtIyCtAs,1439
6
6
  hyperbrowser/client/managers/async_manager/extract.py,sha256=gjrAixnbBHjGlJNr6DGQIa5MbVy3MevT-9liSX00Zg4,1614
7
- hyperbrowser/client/managers/async_manager/profile.py,sha256=l9S-5iw-zLP89xg9f5ZCT7OjimuCotFFQtyxfDZ8Ahg,882
7
+ hyperbrowser/client/managers/async_manager/profile.py,sha256=f2uX2GGYdgL0fyzB0jnI-L-nWleqG6cwZ0pc1K1zdQY,1244
8
8
  hyperbrowser/client/managers/async_manager/scrape.py,sha256=7FdYS_NNEpvB9z3ShGZaZxNryKHm02MQR-g9diadGhA,1319
9
9
  hyperbrowser/client/managers/async_manager/session.py,sha256=ObJhz1IkCCIQLwmztQ-M7lCKzKsVDr-eWCFnan2d9rQ,1692
10
10
  hyperbrowser/client/managers/sync_manager/crawl.py,sha256=lnMtBmOPcamjtvzH4BAnWbBTGbKBmHGUQiMnnZlj2tg,2222
11
11
  hyperbrowser/client/managers/sync_manager/extension.py,sha256=1YoyTZtMo43trl9jAsXv95aor0nBHiJEmLva39jFW-k,1415
12
12
  hyperbrowser/client/managers/sync_manager/extract.py,sha256=rxDFjDG3tw3llaG5AAkUA3y17krevqeiTHlcNsLvaZ0,1560
13
- hyperbrowser/client/managers/sync_manager/profile.py,sha256=EvEtJ9INV8yhYKJoSJV1x2eBtsrS2QPeSifFEi7gxb4,846
13
+ hyperbrowser/client/managers/sync_manager/profile.py,sha256=va6mlhQ5SKZa-viEGFNzV6UBZEP5SqwVp32_oxC_NzM,1196
14
14
  hyperbrowser/client/managers/sync_manager/scrape.py,sha256=DxSvdHa-z2P_rvNUwmRfU4iQz19wiEi_M2YmBQZfLyk,1265
15
15
  hyperbrowser/client/managers/sync_manager/session.py,sha256=74cekrDaGKW5WlP_0Qrqlk-xW2p1u4s63E-D08a4A2s,1610
16
16
  hyperbrowser/client/sync.py,sha256=HgglJY9pNdW987OzNO_5dSZgj1AfAqovCmY99WYQD2E,1213
@@ -20,9 +20,9 @@ hyperbrowser/models/consts.py,sha256=9hv1NQKrXoqPn-6QHbCTJOc2-Dnj--7XEOZZ0IGtvvk
20
20
  hyperbrowser/models/crawl.py,sha256=cP8XmRfTqIJLAnyIHn8MXnHrYokYlYj-JagehGcY0Xc,2603
21
21
  hyperbrowser/models/extension.py,sha256=nXjKXKt9R7RxyZ4hd3EvfqZsEGy_ufh1r5j2mqCLykQ,804
22
22
  hyperbrowser/models/extract.py,sha256=LZM4bZ96C_-8Mhf4f4LLMQYmBpvxvtOHs0AkFbswncc,1214
23
- hyperbrowser/models/profile.py,sha256=SYu4SR6OSwvg0C3bMW3j9z3zhPi-IzXuJE5aVJ3t-Nc,397
23
+ hyperbrowser/models/profile.py,sha256=KRb_LNxxW00AsD_thzzthFS51vInJawt1RcoNz4Q9i8,1322
24
24
  hyperbrowser/models/scrape.py,sha256=yjoU-w1wvTROp5PYu9vyJUEaeuqYjErtnFkzWxxqgk4,2140
25
- hyperbrowser/models/session.py,sha256=Y4j3bj6hsBGLZBl61EEjWxURIcTxvY_upn8ttxjK2fg,5144
25
+ hyperbrowser/models/session.py,sha256=1rxYhcpOhF89WKG97iuIjUDBKtAY2nhDLyUwd2WV4EE,5186
26
26
  hyperbrowser/tools/__init__.py,sha256=OUaTUM-kiigYmzfbpx3XQhzMK1xT1wd8cqXgR4znsAY,2021
27
27
  hyperbrowser/tools/anthropic.py,sha256=5pEkJm1H-26GToTwXsDjo4GGqVy1hATws4Pg59mumow,1667
28
28
  hyperbrowser/tools/openai.py,sha256=4-71IIWSxc_ByhywcfWj9-QI9iYNEe0xO6B2spE8WG0,2200
@@ -30,7 +30,7 @@ hyperbrowser/tools/schema.py,sha256=cR2MUX8TvUyN8TnCyeX0pccp4AmPjrdaKzuAXRThOJo,
30
30
  hyperbrowser/transport/async_transport.py,sha256=MIPJvilvZWBPXLZ96c9OohuN6TN9DaaU0EnyleG3q6g,4017
31
31
  hyperbrowser/transport/base.py,sha256=ildpMrDiM8nvrSGrH2LTOafmB17T7PQB_NQ1ODA378U,1703
32
32
  hyperbrowser/transport/sync.py,sha256=ER844H_OCPCrnmbc58cuqphWTVvCZJQn7-D7ZenCr3Y,3311
33
- hyperbrowser-0.20.0.dist-info/LICENSE,sha256=6rUGKlyKb_1ZAH7h7YITYAAUNFN3MNGGKCyfrw49NLE,1071
34
- hyperbrowser-0.20.0.dist-info/METADATA,sha256=JaWMDuaKjTSZvy6Xu_TTNjt6bW1pBXeXTi6mFBaBz7k,3440
35
- hyperbrowser-0.20.0.dist-info/WHEEL,sha256=IYZQI976HJqqOpQU6PHkJ8fb3tMNBFjg-Cn-pwAbaFM,88
36
- hyperbrowser-0.20.0.dist-info/RECORD,,
33
+ hyperbrowser-0.21.0.dist-info/LICENSE,sha256=6rUGKlyKb_1ZAH7h7YITYAAUNFN3MNGGKCyfrw49NLE,1071
34
+ hyperbrowser-0.21.0.dist-info/METADATA,sha256=iap89l4WEXRAGUWShaJgh5kDfLQNZK9TjFdK_o5ZF2s,3440
35
+ hyperbrowser-0.21.0.dist-info/WHEEL,sha256=IYZQI976HJqqOpQU6PHkJ8fb3tMNBFjg-Cn-pwAbaFM,88
36
+ hyperbrowser-0.21.0.dist-info/RECORD,,