impit 0.7.3__cp311-cp311-macosx_10_12_x86_64.whl → 0.9.0__cp311-cp311-macosx_10_12_x86_64.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.
impit/__init__.py CHANGED
@@ -41,6 +41,7 @@ from .impit import (
41
41
  patch,
42
42
  post,
43
43
  put,
44
+ stream,
44
45
  trace,
45
46
  )
46
47
 
@@ -87,6 +88,7 @@ __all__ = [
87
88
  'patch',
88
89
  'post',
89
90
  'put',
91
+ 'stream',
90
92
  'trace',
91
93
  ]
92
94
 
Binary file
impit/impit.pyi CHANGED
@@ -370,6 +370,11 @@ class Response:
370
370
  class Client:
371
371
  """Synchronous HTTP client with browser impersonation capabilities.
372
372
 
373
+ .. note::
374
+ You can reuse the :class:`Client` instance to make multiple requests.
375
+
376
+ All requests made by the same client will share the same configuration, resources (e.g., cookie jar and connection pool), and other settings.
377
+
373
378
  Args:
374
379
  browser: Browser to impersonate (`"chrome"` or `"firefox"`).
375
380
 
@@ -696,6 +701,11 @@ class Client:
696
701
  class AsyncClient:
697
702
  """Asynchronous HTTP client with browser impersonation capabilities.
698
703
 
704
+ .. note::
705
+ You can reuse the :class:`Client` instance to make multiple requests.
706
+
707
+ All requests made by the same client will share the same configuration, resources (e.g., cookie jar and connection pool), and other settings.
708
+
699
709
  Args:
700
710
  browser: Browser to impersonate (`"chrome"` or `"firefox"`).
701
711
 
@@ -1018,6 +1028,40 @@ class AsyncClient:
1018
1028
  """
1019
1029
 
1020
1030
 
1031
+ def stream(
1032
+ method: str,
1033
+ url: str,
1034
+ content: bytes | bytearray | list[int] | None = None,
1035
+ data: dict[str, str] | None = None,
1036
+ headers: dict[str, str] | None = None,
1037
+ timeout: float | None = None,
1038
+ force_http3: bool | None = None,
1039
+ follow_redirects: bool | None = None,
1040
+ max_redirects: int | None = None,
1041
+ cookie_jar: CookieJar | None = None,
1042
+ cookies: Cookies | None = None,
1043
+ proxy: str | None = None,
1044
+ ) -> AbstractContextManager[Response]:
1045
+ """Make a streaming request without creating a client instance.
1046
+
1047
+ Args:
1048
+ method: HTTP method (e.g., "get", "post")
1049
+ url: URL to request
1050
+ content: Raw content to send
1051
+ data: Form data to send in request body
1052
+ headers: HTTP headers
1053
+ timeout: Request timeout in seconds
1054
+ force_http3: Force HTTP/3 protocol
1055
+ follow_redirects: Whether to follow redirects (default: False)
1056
+ max_redirects: Maximum number of redirects to follow (default: 20)
1057
+ cookie_jar: Cookie jar to store cookies in.
1058
+ cookies: httpx-compatible cookies object.
1059
+ proxy: Proxy URL to use to make the request.
1060
+
1061
+ Returns:
1062
+ Response object
1063
+ """
1064
+
1021
1065
  def get(
1022
1066
  url: str,
1023
1067
  content: bytes | bytearray | list[int] | None = None,
@@ -1025,6 +1069,11 @@ def get(
1025
1069
  headers: dict[str, str] | None = None,
1026
1070
  timeout: float | None = None,
1027
1071
  force_http3: bool | None = None,
1072
+ follow_redirects: bool | None = None,
1073
+ max_redirects: int | None = None,
1074
+ cookie_jar: CookieJar | None = None,
1075
+ cookies: Cookies | None = None,
1076
+ proxy: str | None = None,
1028
1077
  ) -> Response:
1029
1078
  """Make a GET request without creating a client instance.
1030
1079
 
@@ -1035,6 +1084,11 @@ def get(
1035
1084
  headers: HTTP headers
1036
1085
  timeout: Request timeout in seconds
1037
1086
  force_http3: Force HTTP/3 protocol
1087
+ follow_redirects: Whether to follow redirects (default: False)
1088
+ max_redirects: Maximum number of redirects to follow (default: 20)
1089
+ cookie_jar: Cookie jar to store cookies in.
1090
+ cookies: httpx-compatible cookies object.
1091
+ proxy: Proxy URL to use to make the request.
1038
1092
 
1039
1093
  Returns:
1040
1094
  Response object
@@ -1048,6 +1102,11 @@ def post(
1048
1102
  headers: dict[str, str] | None = None,
1049
1103
  timeout: float | None = None,
1050
1104
  force_http3: bool | None = None,
1105
+ follow_redirects: bool | None = None,
1106
+ max_redirects: int | None = None,
1107
+ cookie_jar: CookieJar | None = None,
1108
+ cookies: Cookies | None = None,
1109
+ proxy: str | None = None,
1051
1110
  ) -> Response:
1052
1111
  """Make a POST request without creating a client instance.
1053
1112
 
@@ -1058,6 +1117,11 @@ def post(
1058
1117
  headers: HTTP headers
1059
1118
  timeout: Request timeout in seconds
1060
1119
  force_http3: Force HTTP/3 protocol
1120
+ follow_redirects: Whether to follow redirects (default: False)
1121
+ max_redirects: Maximum number of redirects to follow (default: 20)
1122
+ cookie_jar: Cookie jar to store cookies in.
1123
+ cookies: httpx-compatible cookies object.
1124
+ proxy: Proxy URL to use to make the request.
1061
1125
 
1062
1126
  Returns:
1063
1127
  Response object
@@ -1071,6 +1135,11 @@ def put(
1071
1135
  headers: dict[str, str] | None = None,
1072
1136
  timeout: float | None = None,
1073
1137
  force_http3: bool | None = None,
1138
+ follow_redirects: bool | None = None,
1139
+ max_redirects: int | None = None,
1140
+ cookie_jar: CookieJar | None = None,
1141
+ cookies: Cookies | None = None,
1142
+ proxy: str | None = None,
1074
1143
  ) -> Response:
1075
1144
  """Make a PUT request without creating a client instance.
1076
1145
 
@@ -1081,6 +1150,11 @@ def put(
1081
1150
  headers: HTTP headers
1082
1151
  timeout: Request timeout in seconds
1083
1152
  force_http3: Force HTTP/3 protocol
1153
+ follow_redirects: Whether to follow redirects (default: False)
1154
+ max_redirects: Maximum number of redirects to follow (default: 20)
1155
+ cookie_jar: Cookie jar to store cookies in.
1156
+ cookies: httpx-compatible cookies object.
1157
+ proxy: Proxy URL to use to make the request.
1084
1158
 
1085
1159
  Returns:
1086
1160
  Response object
@@ -1094,6 +1168,11 @@ def patch(
1094
1168
  headers: dict[str, str] | None = None,
1095
1169
  timeout: float | None = None,
1096
1170
  force_http3: bool | None = None,
1171
+ follow_redirects: bool | None = None,
1172
+ max_redirects: int | None = None,
1173
+ cookie_jar: CookieJar | None = None,
1174
+ cookies: Cookies | None = None,
1175
+ proxy: str | None = None,
1097
1176
  ) -> Response:
1098
1177
  """Make a PATCH request without creating a client instance.
1099
1178
 
@@ -1104,6 +1183,11 @@ def patch(
1104
1183
  headers: HTTP headers
1105
1184
  timeout: Request timeout in seconds
1106
1185
  force_http3: Force HTTP/3 protocol
1186
+ follow_redirects: Whether to follow redirects (default: False)
1187
+ max_redirects: Maximum number of redirects to follow (default: 20)
1188
+ cookie_jar: Cookie jar to store cookies in.
1189
+ cookies: httpx-compatible cookies object.
1190
+ proxy: Proxy URL to use to make the request.
1107
1191
 
1108
1192
  Returns:
1109
1193
  Response object
@@ -1117,6 +1201,11 @@ def delete(
1117
1201
  headers: dict[str, str] | None = None,
1118
1202
  timeout: float | None = None,
1119
1203
  force_http3: bool | None = None,
1204
+ follow_redirects: bool | None = None,
1205
+ max_redirects: int | None = None,
1206
+ cookie_jar: CookieJar | None = None,
1207
+ cookies: Cookies | None = None,
1208
+ proxy: str | None = None,
1120
1209
  ) -> Response:
1121
1210
  """Make a DELETE request without creating a client instance.
1122
1211
 
@@ -1127,6 +1216,11 @@ def delete(
1127
1216
  headers: HTTP headers
1128
1217
  timeout: Request timeout in seconds
1129
1218
  force_http3: Force HTTP/3 protocol
1219
+ follow_redirects: Whether to follow redirects (default: False)
1220
+ max_redirects: Maximum number of redirects to follow (default: 20)
1221
+ cookie_jar: Cookie jar to store cookies in.
1222
+ cookies: httpx-compatible cookies object.
1223
+ proxy: Proxy URL to use to make the request.
1130
1224
 
1131
1225
  Returns:
1132
1226
  Response object
@@ -1140,6 +1234,11 @@ def head(
1140
1234
  headers: dict[str, str] | None = None,
1141
1235
  timeout: float | None = None,
1142
1236
  force_http3: bool | None = None,
1237
+ follow_redirects: bool | None = None,
1238
+ max_redirects: int | None = None,
1239
+ cookie_jar: CookieJar | None = None,
1240
+ cookies: Cookies | None = None,
1241
+ proxy: str | None = None,
1143
1242
  ) -> Response:
1144
1243
  """Make a HEAD request without creating a client instance.
1145
1244
 
@@ -1150,6 +1249,11 @@ def head(
1150
1249
  headers: HTTP headers
1151
1250
  timeout: Request timeout in seconds
1152
1251
  force_http3: Force HTTP/3 protocol
1252
+ follow_redirects: Whether to follow redirects (default: False)
1253
+ max_redirects: Maximum number of redirects to follow (default: 20)
1254
+ cookie_jar: Cookie jar to store cookies in.
1255
+ cookies: httpx-compatible cookies object.
1256
+ proxy: Proxy URL to use to make the request.
1153
1257
 
1154
1258
  Returns:
1155
1259
  Response object
@@ -1163,6 +1267,11 @@ def options(
1163
1267
  headers: dict[str, str] | None = None,
1164
1268
  timeout: float | None = None,
1165
1269
  force_http3: bool | None = None,
1270
+ follow_redirects: bool | None = None,
1271
+ max_redirects: int | None = None,
1272
+ cookie_jar: CookieJar | None = None,
1273
+ cookies: Cookies | None = None,
1274
+ proxy: str | None = None,
1166
1275
  ) -> Response:
1167
1276
  """Make an OPTIONS request without creating a client instance.
1168
1277
 
@@ -1173,6 +1282,11 @@ def options(
1173
1282
  headers: HTTP headers
1174
1283
  timeout: Request timeout in seconds (overrides default timeout)
1175
1284
  force_http3: Force HTTP/3 protocol
1285
+ follow_redirects: Whether to follow redirects (default: False)
1286
+ max_redirects: Maximum number of redirects to follow (default: 20)
1287
+ cookie_jar: Cookie jar to store cookies in.
1288
+ cookies: httpx-compatible cookies object.
1289
+ proxy: Proxy URL to use to make the request.
1176
1290
  """
1177
1291
 
1178
1292
 
@@ -1183,6 +1297,11 @@ def trace(
1183
1297
  headers: dict[str, str] | None = None,
1184
1298
  timeout: float | None = None,
1185
1299
  force_http3: bool | None = None,
1300
+ follow_redirects: bool | None = None,
1301
+ max_redirects: int | None = None,
1302
+ cookie_jar: CookieJar | None = None,
1303
+ cookies: Cookies | None = None,
1304
+ proxy: str | None = None,
1186
1305
  ) -> Response:
1187
1306
  """Make a TRACE request without creating a client instance.
1188
1307
 
@@ -1193,4 +1312,9 @@ def trace(
1193
1312
  headers: HTTP headers
1194
1313
  timeout: Request timeout in seconds (overrides default timeout)
1195
1314
  force_http3: Force HTTP/3 protocol
1315
+ follow_redirects: Whether to follow redirects (default: False)
1316
+ max_redirects: Maximum number of redirects to follow (default: 20)
1317
+ cookie_jar: Cookie jar to store cookies in.
1318
+ cookies: httpx-compatible cookies object.
1319
+ proxy: Proxy URL to use to make the request.
1196
1320
  """
@@ -1,20 +1,21 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: impit
3
- Version: 0.7.3
3
+ Version: 0.9.0
4
4
  Classifier: Development Status :: 4 - Beta
5
+ Classifier: Environment :: Console
5
6
  Classifier: Intended Audience :: Developers
6
7
  Classifier: License :: OSI Approved :: Apache Software License
7
8
  Classifier: Operating System :: OS Independent
8
- Classifier: Programming Language :: Python :: 3.9
9
9
  Classifier: Programming Language :: Python :: 3.10
10
10
  Classifier: Programming Language :: Python :: 3.11
11
11
  Classifier: Programming Language :: Python :: 3.12
12
12
  Classifier: Programming Language :: Python :: 3.13
13
+ Classifier: Programming Language :: Python :: 3.14
13
14
  Classifier: Topic :: Software Development :: Libraries
14
15
  Summary: A library for making HTTP requests through browser impersonation
15
16
  Keywords: apify,http,requests,browser,impersonation
16
17
  Author: Jindřich Bär
17
- Requires-Python: >=3.9
18
+ Requires-Python: >=3.10
18
19
  Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM
19
20
  Project-URL: Homepage, https://apify.github.io/impit/python
20
21
  Project-URL: Apify homepage, https://apify.com
@@ -0,0 +1,8 @@
1
+ impit-0.9.0.dist-info/METADATA,sha256=rUem-pBLg6yAp-5ARgqksLUOut5yrVmou21VKAv3Qy0,2833
2
+ impit-0.9.0.dist-info/WHEEL,sha256=fb1PHnp33bNOlM6iPdAf3wvJKWsrWoTBMsTNn1iCL6s,107
3
+ impit/__init__.py,sha256=uZsD0XMFOt7QwVUgNcnVQkDF85y9n5slxoxR0wim7ug,1664
4
+ impit/cookies.py,sha256=bfNPkMk2Y0bG-RqqMMJxIfvCMZp_fDclYAnSlsCwkIg,7009
5
+ impit/impit.cpython-311-darwin.so,sha256=ZG7OLD42Y2fPpWBckTkuzUJ4jxeHLCyUCGieIffLA2U,8352480
6
+ impit/impit.pyi,sha256=IxLCuSkx3mHQcwcSS65lveoM5QYvMeJcU-Mhhdelyng,45730
7
+ impit/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
8
+ impit-0.9.0.dist-info/RECORD,,
@@ -1,4 +1,4 @@
1
1
  Wheel-Version: 1.0
2
- Generator: maturin (1.9.6)
2
+ Generator: maturin (1.10.0)
3
3
  Root-Is-Purelib: false
4
4
  Tag: cp311-cp311-macosx_10_12_x86_64
@@ -1,8 +0,0 @@
1
- impit-0.7.3.dist-info/METADATA,sha256=XrAYQ0y1VNDlToVmYZoqbePHy2TGMnTobH7zuYo9lFs,2796
2
- impit-0.7.3.dist-info/WHEEL,sha256=p_Yquq5Pk0aa0if4rX4yfMDTA_PSQbCXzFftM7T46yU,106
3
- impit/__init__.py,sha256=4xyRTEr58yC1QvHGe_gmTvKbKDX2iLjPQxNevetIXw0,1638
4
- impit/cookies.py,sha256=bfNPkMk2Y0bG-RqqMMJxIfvCMZp_fDclYAnSlsCwkIg,7009
5
- impit/impit.cpython-311-darwin.so,sha256=HzsDf2HVuypujkaG_mqLWf7sr5Tdg5s1K16RURLQzIY,8314948
6
- impit/impit.pyi,sha256=kII1iMqf1HMHR3evwdhOieNKAHWARDQiSJ_rQ545Q7Q,40126
7
- impit/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
8
- impit-0.7.3.dist-info/RECORD,,