cartography-client 0.9.2__py3-none-any.whl → 0.10.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.
- cartography/_streaming.py +4 -6
- cartography/_utils/_utils.py +1 -1
- cartography/_version.py +1 -1
- cartography/resources/download.py +6 -6
- cartography/resources/workflows/request/crawl.py +4 -0
- cartography/types/__init__.py +0 -1
- cartography/types/download_create_bulk_params.py +2 -3
- cartography/types/download_create_single_params.py +2 -3
- cartography/types/workflows/request/crawl_create_params.py +2 -0
- cartography/types/workflows/request/crawl_request_param.py +2 -0
- {cartography_client-0.9.2.dist-info → cartography_client-0.10.0.dist-info}/METADATA +2 -2
- {cartography_client-0.9.2.dist-info → cartography_client-0.10.0.dist-info}/RECORD +14 -15
- cartography/types/wait_until.py +0 -7
- {cartography_client-0.9.2.dist-info → cartography_client-0.10.0.dist-info}/WHEEL +0 -0
- {cartography_client-0.9.2.dist-info → cartography_client-0.10.0.dist-info}/licenses/LICENSE +0 -0
cartography/_streaming.py
CHANGED
|
@@ -57,9 +57,8 @@ class Stream(Generic[_T]):
|
|
|
57
57
|
for sse in iterator:
|
|
58
58
|
yield process_data(data=sse.json(), cast_to=cast_to, response=response)
|
|
59
59
|
|
|
60
|
-
#
|
|
61
|
-
|
|
62
|
-
...
|
|
60
|
+
# As we might not fully consume the response stream, we need to close it explicitly
|
|
61
|
+
response.close()
|
|
63
62
|
|
|
64
63
|
def __enter__(self) -> Self:
|
|
65
64
|
return self
|
|
@@ -121,9 +120,8 @@ class AsyncStream(Generic[_T]):
|
|
|
121
120
|
async for sse in iterator:
|
|
122
121
|
yield process_data(data=sse.json(), cast_to=cast_to, response=response)
|
|
123
122
|
|
|
124
|
-
#
|
|
125
|
-
|
|
126
|
-
...
|
|
123
|
+
# As we might not fully consume the response stream, we need to close it explicitly
|
|
124
|
+
await response.aclose()
|
|
127
125
|
|
|
128
126
|
async def __aenter__(self) -> Self:
|
|
129
127
|
return self
|
cartography/_utils/_utils.py
CHANGED
|
@@ -133,7 +133,7 @@ def is_given(obj: _T | NotGiven | Omit) -> TypeGuard[_T]:
|
|
|
133
133
|
# Type safe methods for narrowing types with TypeVars.
|
|
134
134
|
# The default narrowing for isinstance(obj, dict) is dict[unknown, unknown],
|
|
135
135
|
# however this cause Pyright to rightfully report errors. As we know we don't
|
|
136
|
-
# care about the contained types we can safely use `object` in
|
|
136
|
+
# care about the contained types we can safely use `object` in its place.
|
|
137
137
|
#
|
|
138
138
|
# There are two separate functions defined, `is_*` and `is_*_t` for different use cases.
|
|
139
139
|
# `is_*` is for when you're dealing with an unknown input
|
cartography/_version.py
CHANGED
|
@@ -3,10 +3,11 @@
|
|
|
3
3
|
from __future__ import annotations
|
|
4
4
|
|
|
5
5
|
from typing import Optional
|
|
6
|
+
from typing_extensions import Literal
|
|
6
7
|
|
|
7
8
|
import httpx
|
|
8
9
|
|
|
9
|
-
from ..types import
|
|
10
|
+
from ..types import DownloaderType, download_create_bulk_params, download_create_single_params
|
|
10
11
|
from .._types import Body, Omit, Query, Headers, NotGiven, SequenceNotStr, omit, not_given
|
|
11
12
|
from .._utils import maybe_transform, async_maybe_transform
|
|
12
13
|
from .._compat import cached_property
|
|
@@ -18,7 +19,6 @@ from .._response import (
|
|
|
18
19
|
async_to_streamed_response_wrapper,
|
|
19
20
|
)
|
|
20
21
|
from .._base_client import make_request_options
|
|
21
|
-
from ..types.wait_until import WaitUntil
|
|
22
22
|
from ..types.downloader_type import DownloaderType
|
|
23
23
|
from ..types.download_create_bulk_response import DownloadCreateBulkResponse
|
|
24
24
|
from ..types.download_create_single_response import DownloadCreateSingleResponse
|
|
@@ -56,7 +56,7 @@ class DownloadResource(SyncAPIResource):
|
|
|
56
56
|
debug: bool | Omit = omit,
|
|
57
57
|
downloader_type: DownloaderType | Omit = omit,
|
|
58
58
|
max_workers: int | Omit = omit,
|
|
59
|
-
wait_until:
|
|
59
|
+
wait_until: Literal["commit", "domcontentloaded", "load", "networkidle"] | Omit = omit,
|
|
60
60
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
61
61
|
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
62
62
|
extra_headers: Headers | None = None,
|
|
@@ -123,7 +123,7 @@ class DownloadResource(SyncAPIResource):
|
|
|
123
123
|
downloader_type: DownloaderType | Omit = omit,
|
|
124
124
|
s3_key: Optional[str] | Omit = omit,
|
|
125
125
|
timeout_ms: int | Omit = omit,
|
|
126
|
-
wait_until:
|
|
126
|
+
wait_until: Literal["commit", "domcontentloaded", "load", "networkidle"] | Omit = omit,
|
|
127
127
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
128
128
|
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
129
129
|
extra_headers: Headers | None = None,
|
|
@@ -207,7 +207,7 @@ class AsyncDownloadResource(AsyncAPIResource):
|
|
|
207
207
|
debug: bool | Omit = omit,
|
|
208
208
|
downloader_type: DownloaderType | Omit = omit,
|
|
209
209
|
max_workers: int | Omit = omit,
|
|
210
|
-
wait_until:
|
|
210
|
+
wait_until: Literal["commit", "domcontentloaded", "load", "networkidle"] | Omit = omit,
|
|
211
211
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
212
212
|
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
213
213
|
extra_headers: Headers | None = None,
|
|
@@ -274,7 +274,7 @@ class AsyncDownloadResource(AsyncAPIResource):
|
|
|
274
274
|
downloader_type: DownloaderType | Omit = omit,
|
|
275
275
|
s3_key: Optional[str] | Omit = omit,
|
|
276
276
|
timeout_ms: int | Omit = omit,
|
|
277
|
-
wait_until:
|
|
277
|
+
wait_until: Literal["commit", "domcontentloaded", "load", "networkidle"] | Omit = omit,
|
|
278
278
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
279
279
|
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
280
280
|
extra_headers: Headers | None = None,
|
|
@@ -68,6 +68,7 @@ class CrawlResource(SyncAPIResource):
|
|
|
68
68
|
stealth: bool | Omit = omit,
|
|
69
69
|
teardown: bool | Omit = omit,
|
|
70
70
|
visit_external: bool | Omit = omit,
|
|
71
|
+
wait_until: Optional[Literal["domcontentloaded", "load", "networkidle", "commit"]] | Omit = omit,
|
|
71
72
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
72
73
|
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
73
74
|
extra_headers: Headers | None = None,
|
|
@@ -109,6 +110,7 @@ class CrawlResource(SyncAPIResource):
|
|
|
109
110
|
"stealth": stealth,
|
|
110
111
|
"teardown": teardown,
|
|
111
112
|
"visit_external": visit_external,
|
|
113
|
+
"wait_until": wait_until,
|
|
112
114
|
},
|
|
113
115
|
crawl_create_params.CrawlCreateParams,
|
|
114
116
|
),
|
|
@@ -193,6 +195,7 @@ class AsyncCrawlResource(AsyncAPIResource):
|
|
|
193
195
|
stealth: bool | Omit = omit,
|
|
194
196
|
teardown: bool | Omit = omit,
|
|
195
197
|
visit_external: bool | Omit = omit,
|
|
198
|
+
wait_until: Optional[Literal["domcontentloaded", "load", "networkidle", "commit"]] | Omit = omit,
|
|
196
199
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
197
200
|
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
198
201
|
extra_headers: Headers | None = None,
|
|
@@ -234,6 +237,7 @@ class AsyncCrawlResource(AsyncAPIResource):
|
|
|
234
237
|
"stealth": stealth,
|
|
235
238
|
"teardown": teardown,
|
|
236
239
|
"visit_external": visit_external,
|
|
240
|
+
"wait_until": wait_until,
|
|
237
241
|
},
|
|
238
242
|
crawl_create_params.CrawlCreateParams,
|
|
239
243
|
),
|
cartography/types/__init__.py
CHANGED
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
|
|
3
3
|
from __future__ import annotations
|
|
4
4
|
|
|
5
|
-
from .wait_until import WaitUntil as WaitUntil
|
|
6
5
|
from .downloader_type import DownloaderType as DownloaderType
|
|
7
6
|
from .bulk_scrape_result import BulkScrapeResult as BulkScrapeResult
|
|
8
7
|
from .scrape_engine_param import ScrapeEngineParam as ScrapeEngineParam
|
|
@@ -2,10 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
from __future__ import annotations
|
|
4
4
|
|
|
5
|
-
from typing_extensions import Required, TypedDict
|
|
5
|
+
from typing_extensions import Literal, Required, TypedDict
|
|
6
6
|
|
|
7
7
|
from .._types import SequenceNotStr
|
|
8
|
-
from .wait_until import WaitUntil
|
|
9
8
|
from .downloader_type import DownloaderType
|
|
10
9
|
|
|
11
10
|
__all__ = ["DownloadCreateBulkParams"]
|
|
@@ -33,5 +32,5 @@ class DownloadCreateBulkParams(TypedDict, total=False):
|
|
|
33
32
|
max_workers: int
|
|
34
33
|
"""Maximum concurrent workers"""
|
|
35
34
|
|
|
36
|
-
wait_until:
|
|
35
|
+
wait_until: Literal["commit", "domcontentloaded", "load", "networkidle"]
|
|
37
36
|
"""When to consider downloads complete"""
|
|
@@ -3,9 +3,8 @@
|
|
|
3
3
|
from __future__ import annotations
|
|
4
4
|
|
|
5
5
|
from typing import Optional
|
|
6
|
-
from typing_extensions import Required, TypedDict
|
|
6
|
+
from typing_extensions import Literal, Required, TypedDict
|
|
7
7
|
|
|
8
|
-
from .wait_until import WaitUntil
|
|
9
8
|
from .downloader_type import DownloaderType
|
|
10
9
|
|
|
11
10
|
__all__ = ["DownloadCreateSingleParams"]
|
|
@@ -27,5 +26,5 @@ class DownloadCreateSingleParams(TypedDict, total=False):
|
|
|
27
26
|
timeout_ms: int
|
|
28
27
|
"""Timeout in milliseconds"""
|
|
29
28
|
|
|
30
|
-
wait_until:
|
|
29
|
+
wait_until: Literal["commit", "domcontentloaded", "load", "networkidle"]
|
|
31
30
|
"""When to consider download complete"""
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.3
|
|
2
2
|
Name: cartography-client
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.10.0
|
|
4
4
|
Summary: The official Python library for the cartography API
|
|
5
5
|
Project-URL: Homepage, https://github.com/evrimai/cartography-client
|
|
6
6
|
Project-URL: Repository, https://github.com/evrimai/cartography-client
|
|
@@ -30,7 +30,7 @@ Requires-Dist: sniffio
|
|
|
30
30
|
Requires-Dist: typing-extensions<5,>=4.10
|
|
31
31
|
Provides-Extra: aiohttp
|
|
32
32
|
Requires-Dist: aiohttp; extra == 'aiohttp'
|
|
33
|
-
Requires-Dist: httpx-aiohttp>=0.1.
|
|
33
|
+
Requires-Dist: httpx-aiohttp>=0.1.9; extra == 'aiohttp'
|
|
34
34
|
Description-Content-Type: text/markdown
|
|
35
35
|
|
|
36
36
|
# Cartography Python API library
|
|
@@ -9,9 +9,9 @@ cartography/_models.py,sha256=lKnskYPONAWDvWo8tmbbVk7HmG7UOsI0Nve0vSMmkRc,30452
|
|
|
9
9
|
cartography/_qs.py,sha256=craIKyvPktJ94cvf9zn8j8ekG9dWJzhWv0ob34lIOv4,4828
|
|
10
10
|
cartography/_resource.py,sha256=ofOCE9gyI5yng3FbynF2nNk2n-PfZEnNu89Kv2LGtR8,1130
|
|
11
11
|
cartography/_response.py,sha256=KTgC3XMyHfxd-QFOw0_eSSH_H9JjFLguHHnlMVgDmYY,28848
|
|
12
|
-
cartography/_streaming.py,sha256=
|
|
12
|
+
cartography/_streaming.py,sha256=XO7EUGGM7ERSgYVJQhETd7WS1ureciLY0RgRENBFz2M,10169
|
|
13
13
|
cartography/_types.py,sha256=YFt85qWn9Nlvv9y53EtaCdjHE_IYikov7aH6wGeRX3c,7241
|
|
14
|
-
cartography/_version.py,sha256=
|
|
14
|
+
cartography/_version.py,sha256=Wk5xpQwxLfe-h4wersrB1HM4yXkJ--zLQdK42fxJ2s4,164
|
|
15
15
|
cartography/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
16
16
|
cartography/_utils/__init__.py,sha256=7fch0GT9zpNnErbciSpUNa-SjTxxjY6kxHxKMOM4AGs,2305
|
|
17
17
|
cartography/_utils/_compat.py,sha256=D8gtAvjJQrDWt9upS0XaG9Rr5l1QhiAx_I_1utT_tt0,1195
|
|
@@ -24,28 +24,28 @@ cartography/_utils/_streams.py,sha256=SMC90diFFecpEg_zgDRVbdR3hSEIgVVij4taD-noML
|
|
|
24
24
|
cartography/_utils/_sync.py,sha256=TpGLrrhRNWTJtODNE6Fup3_k7zrWm1j2RlirzBwre-0,2862
|
|
25
25
|
cartography/_utils/_transform.py,sha256=NjCzmnfqYrsAikUHQig6N9QfuTVbKipuP3ur9mcNF-E,15951
|
|
26
26
|
cartography/_utils/_typing.py,sha256=N_5PPuFNsaygbtA_npZd98SVN1LQQvFTKL6bkWPBZGU,4786
|
|
27
|
-
cartography/_utils/_utils.py,sha256=
|
|
27
|
+
cartography/_utils/_utils.py,sha256=ugfUaneOK7I8h9b3656flwf5u_kthY0gvNuqvgOLoSU,12252
|
|
28
28
|
cartography/lib/.keep,sha256=wuNrz-5SXo3jJaJOJgz4vFHM41YH_g20F5cRQo0vLes,224
|
|
29
29
|
cartography/resources/__init__.py,sha256=jlfUMy6HtRCTxMrnyw27hYsZOYeF5v6-MlB4S-oyb7Q,2868
|
|
30
30
|
cartography/resources/api_info.py,sha256=WZXgtzne8_766e86iJUKQi3bi0-jhV3CYeT30dTnK8g,4996
|
|
31
31
|
cartography/resources/crawl.py,sha256=Ona7qR-HRnH1-cFHHGEmV9_OSd1bHl2-hWWHueaaF4Q,9865
|
|
32
|
-
cartography/resources/download.py,sha256=
|
|
32
|
+
cartography/resources/download.py,sha256=4MLXBEfylRXSv_5xy5wa5qGmAHgDWSyS__JpcVZmE-o,13550
|
|
33
33
|
cartography/resources/health.py,sha256=_uxnrWRBToHttDXJNv3uuaH8OQF0JvD-ZZ_Wqhc3B2Q,5019
|
|
34
34
|
cartography/resources/scrape.py,sha256=YFi1DQpUbwG1YXC6AZstaqe7_rK91qa0ntzBlSKlT2g,11623
|
|
35
35
|
cartography/resources/workflows/__init__.py,sha256=WF-IzwaW19ZKLOR8R3dEzhsDFEcoAmfygtqf8M7jNNw,1054
|
|
36
36
|
cartography/resources/workflows/workflows.py,sha256=-DRXNFW_SENImL0OKj73tJbKIIaN9i3lfZZgLi826oQ,10254
|
|
37
37
|
cartography/resources/workflows/request/__init__.py,sha256=u5ZP5HQC6UhVQ33WUgrN6ID8NoaKY_H6dNnpqTekp8w,1002
|
|
38
|
-
cartography/resources/workflows/request/crawl.py,sha256=
|
|
38
|
+
cartography/resources/workflows/request/crawl.py,sha256=eBeloSMpzRpEZmii6Ih_-kWYFgqYHbVP3DPARkhfNzc,12720
|
|
39
39
|
cartography/resources/workflows/request/request.py,sha256=Byofh0ykmMAXxfEKIn3afRrbRZMlBydoBYWCdv3svx8,8065
|
|
40
|
-
cartography/types/__init__.py,sha256=
|
|
40
|
+
cartography/types/__init__.py,sha256=1DyBFoie6OZ095RFP305h4RKC_OUaatKY0GDvtTdQZA,1711
|
|
41
41
|
cartography/types/api_info_retrieve_response.py,sha256=kdavk-S1UkgJaA8Ad9L-gl1DFVljhDk-afOLS5MV7EQ,246
|
|
42
42
|
cartography/types/bulk_download_result.py,sha256=YGqIZU2BwgiRt0wHHj-OUd2n7Ia0Ybo0kLotC7BE7-w,518
|
|
43
43
|
cartography/types/bulk_scrape_result.py,sha256=TOutkzQxTbEocwTBrRHaehU5M2OYYkLPXsf_U7DJj_k,361
|
|
44
44
|
cartography/types/crawl_create_graph_params.py,sha256=jmZhhVCoKg4zqF-XC3KcsrVq-E2UFBNZGDYEzAXrixE,1137
|
|
45
45
|
cartography/types/crawl_create_graph_response.py,sha256=GlUtSl8kSOC5_1-Aq3K-G1y5y91Y3lEtuRv2nRBKMu0,602
|
|
46
|
-
cartography/types/download_create_bulk_params.py,sha256=
|
|
46
|
+
cartography/types/download_create_bulk_params.py,sha256=0tfO72oD_Beqr7Pe2fVXp4NAp3Q-LTPxd277NVPtCRg,941
|
|
47
47
|
cartography/types/download_create_bulk_response.py,sha256=qP-jnoN6a2U0H7huWwFuMISHSJ-8SNk2AsPVurbw9mI,876
|
|
48
|
-
cartography/types/download_create_single_params.py,sha256=
|
|
48
|
+
cartography/types/download_create_single_params.py,sha256=EDaNfqNMxtFzoALhG5LmmtqF8YnXQvryVX7kSThUxhk,777
|
|
49
49
|
cartography/types/download_create_single_response.py,sha256=JhEM0u6R8pa6fi4YxKtx3I72dxMN39jyTvWPAnqokwM,386
|
|
50
50
|
cartography/types/downloader_type.py,sha256=rDIZFpfUU_AmDTtvOkZzu5FkBRJnK9CKo9U5Orgi3Hs,218
|
|
51
51
|
cartography/types/health_check_response.py,sha256=hdwdGJfXNVha1D3jcndSfLbakkpcWf9P2_V9PbE305U,238
|
|
@@ -54,7 +54,6 @@ cartography/types/scrape_scrape_bulk_params.py,sha256=-dyFHGlvXoYRLorGRuchEO73HS
|
|
|
54
54
|
cartography/types/scrape_scrape_bulk_response.py,sha256=cEWB4M37mFdqti8y2EKzq-RSUOwUuITt9dD0reL3XJ4,854
|
|
55
55
|
cartography/types/scrape_scrape_single_params.py,sha256=slcqjrNXj_acnMGgMgj9c2KCj0B-LIXmBoPb5vPRKFI,459
|
|
56
56
|
cartography/types/scrape_scrape_single_response.py,sha256=lsqkIaaoZbLCeY_mhpAy8e9DZ4fWDyfiE3dlhteCXCg,475
|
|
57
|
-
cartography/types/wait_until.py,sha256=TEbovezH15Hyhxg-5fei1zfIc5yUUA7_amXBzD3OumU,246
|
|
58
57
|
cartography/types/workflow_describe_response.py,sha256=xHan0hcgdRjbmhTwJqrKjLhNpb5Y9T7weSIlhtfP42Q,248
|
|
59
58
|
cartography/types/workflow_results_response.py,sha256=CxVPgyqoIGSCrnO8mnOAacjp7bvWeHmHZHy88Oh6DtY,246
|
|
60
59
|
cartography/types/workflows/__init__.py,sha256=tVY5RIEfyHvbVHmvq7wllO29udmJiZQxvOaggNTLpcc,335
|
|
@@ -63,10 +62,10 @@ cartography/types/workflows/request_create_download_response.py,sha256=8n05ENcmB
|
|
|
63
62
|
cartography/types/workflows/request/__init__.py,sha256=lXyknEexZDYnqVoqUMERnRuSlz4CixdFQXecKu8qGNc,505
|
|
64
63
|
cartography/types/workflows/request/crawl_create_bulk_params.py,sha256=tKJrecoRHVMF_T3okZAPCeaa8XGW5lMzoN1cku2kttc,393
|
|
65
64
|
cartography/types/workflows/request/crawl_create_bulk_response.py,sha256=jsxrgEsJ5sUKquwBVJqNXqGB8JFY3lEat1wNc-qJ7a4,479
|
|
66
|
-
cartography/types/workflows/request/crawl_create_params.py,sha256=
|
|
67
|
-
cartography/types/workflows/request/crawl_request_param.py,sha256=
|
|
65
|
+
cartography/types/workflows/request/crawl_create_params.py,sha256=VKjLZ2xsoKPFYs7Bc-KsGa4O5uN3cCbxNXXqgnYzVRQ,903
|
|
66
|
+
cartography/types/workflows/request/crawl_request_param.py,sha256=Qx_ObHtuzotrnGSEjWS2Gldmo9PO9qryx18P_cWRGVU,903
|
|
68
67
|
cartography/types/workflows/request/workflow_result.py,sha256=iIDSquvEHkrr_IDYhZqJDZgLvEugBKgSeQOnA9jPohQ,221
|
|
69
|
-
cartography_client-0.
|
|
70
|
-
cartography_client-0.
|
|
71
|
-
cartography_client-0.
|
|
72
|
-
cartography_client-0.
|
|
68
|
+
cartography_client-0.10.0.dist-info/METADATA,sha256=_CZQW9d9F3C73TKdPoNuIVicgNCdRB5cm47casy1i3o,13567
|
|
69
|
+
cartography_client-0.10.0.dist-info/WHEEL,sha256=C2FUgwZgiLbznR-k0b_5k3Ai_1aASOXDss3lzCUsUug,87
|
|
70
|
+
cartography_client-0.10.0.dist-info/licenses/LICENSE,sha256=0DZ926LAsHVU1OBPQaE_owbXJZ6foQ133RvErapSzt0,11341
|
|
71
|
+
cartography_client-0.10.0.dist-info/RECORD,,
|
cartography/types/wait_until.py
DELETED
|
File without changes
|
|
File without changes
|