cartography-client 0.0.1__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 cartography-client might be problematic. Click here for more details.

Files changed (70) hide show
  1. cartography/__init__.py +100 -0
  2. cartography/_base_client.py +1995 -0
  3. cartography/_client.py +444 -0
  4. cartography/_compat.py +219 -0
  5. cartography/_constants.py +14 -0
  6. cartography/_exceptions.py +108 -0
  7. cartography/_files.py +123 -0
  8. cartography/_models.py +829 -0
  9. cartography/_qs.py +150 -0
  10. cartography/_resource.py +43 -0
  11. cartography/_response.py +832 -0
  12. cartography/_streaming.py +333 -0
  13. cartography/_types.py +219 -0
  14. cartography/_utils/__init__.py +57 -0
  15. cartography/_utils/_logs.py +25 -0
  16. cartography/_utils/_proxy.py +65 -0
  17. cartography/_utils/_reflection.py +42 -0
  18. cartography/_utils/_resources_proxy.py +24 -0
  19. cartography/_utils/_streams.py +12 -0
  20. cartography/_utils/_sync.py +86 -0
  21. cartography/_utils/_transform.py +447 -0
  22. cartography/_utils/_typing.py +151 -0
  23. cartography/_utils/_utils.py +422 -0
  24. cartography/_version.py +4 -0
  25. cartography/lib/.keep +4 -0
  26. cartography/py.typed +0 -0
  27. cartography/resources/__init__.py +89 -0
  28. cartography/resources/api_info.py +135 -0
  29. cartography/resources/crawl.py +279 -0
  30. cartography/resources/download.py +376 -0
  31. cartography/resources/health.py +143 -0
  32. cartography/resources/scrape.py +331 -0
  33. cartography/resources/workflows/__init__.py +33 -0
  34. cartography/resources/workflows/request/__init__.py +33 -0
  35. cartography/resources/workflows/request/crawl.py +295 -0
  36. cartography/resources/workflows/request/request.py +221 -0
  37. cartography/resources/workflows/workflows.py +274 -0
  38. cartography/types/__init__.py +23 -0
  39. cartography/types/api_info_retrieve_response.py +8 -0
  40. cartography/types/bulk_download_result.py +23 -0
  41. cartography/types/bulk_scrape_result.py +19 -0
  42. cartography/types/crawl_create_graph_params.py +46 -0
  43. cartography/types/crawl_create_graph_response.py +37 -0
  44. cartography/types/download_create_bulk_params.py +37 -0
  45. cartography/types/download_create_bulk_response.py +41 -0
  46. cartography/types/download_create_single_params.py +32 -0
  47. cartography/types/download_create_single_response.py +21 -0
  48. cartography/types/downloader_type.py +7 -0
  49. cartography/types/health_check_response.py +8 -0
  50. cartography/types/scrape_engine_param.py +28 -0
  51. cartography/types/scrape_scrape_bulk_params.py +33 -0
  52. cartography/types/scrape_scrape_bulk_response.py +41 -0
  53. cartography/types/scrape_scrape_single_params.py +17 -0
  54. cartography/types/scrape_scrape_single_response.py +23 -0
  55. cartography/types/wait_until.py +7 -0
  56. cartography/types/workflow_describe_response.py +8 -0
  57. cartography/types/workflow_results_response.py +8 -0
  58. cartography/types/workflows/__init__.py +6 -0
  59. cartography/types/workflows/request/__init__.py +9 -0
  60. cartography/types/workflows/request/crawl_create_bulk_params.py +14 -0
  61. cartography/types/workflows/request/crawl_create_bulk_response.py +22 -0
  62. cartography/types/workflows/request/crawl_create_params.py +32 -0
  63. cartography/types/workflows/request/crawl_request_param.py +32 -0
  64. cartography/types/workflows/request/workflow_result.py +11 -0
  65. cartography/types/workflows/request_create_download_params.py +18 -0
  66. cartography/types/workflows/request_create_download_response.py +8 -0
  67. cartography_client-0.0.1.dist-info/METADATA +399 -0
  68. cartography_client-0.0.1.dist-info/RECORD +70 -0
  69. cartography_client-0.0.1.dist-info/WHEEL +4 -0
  70. cartography_client-0.0.1.dist-info/licenses/LICENSE +201 -0
@@ -0,0 +1,135 @@
1
+ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ from __future__ import annotations
4
+
5
+ import httpx
6
+
7
+ from .._types import NOT_GIVEN, Body, Query, Headers, NotGiven
8
+ from .._compat import cached_property
9
+ from .._resource import SyncAPIResource, AsyncAPIResource
10
+ from .._response import (
11
+ to_raw_response_wrapper,
12
+ to_streamed_response_wrapper,
13
+ async_to_raw_response_wrapper,
14
+ async_to_streamed_response_wrapper,
15
+ )
16
+ from .._base_client import make_request_options
17
+ from ..types.api_info_retrieve_response import APIInfoRetrieveResponse
18
+
19
+ __all__ = ["APIInfoResource", "AsyncAPIInfoResource"]
20
+
21
+
22
+ class APIInfoResource(SyncAPIResource):
23
+ @cached_property
24
+ def with_raw_response(self) -> APIInfoResourceWithRawResponse:
25
+ """
26
+ This property can be used as a prefix for any HTTP method call to return
27
+ the raw response object instead of the parsed content.
28
+
29
+ For more information, see https://www.github.com/evrimai/cartography-client#accessing-raw-response-data-eg-headers
30
+ """
31
+ return APIInfoResourceWithRawResponse(self)
32
+
33
+ @cached_property
34
+ def with_streaming_response(self) -> APIInfoResourceWithStreamingResponse:
35
+ """
36
+ An alternative to `.with_raw_response` that doesn't eagerly read the response body.
37
+
38
+ For more information, see https://www.github.com/evrimai/cartography-client#with_streaming_response
39
+ """
40
+ return APIInfoResourceWithStreamingResponse(self)
41
+
42
+ def retrieve(
43
+ self,
44
+ *,
45
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
46
+ # The extra values given here take precedence over values defined on the client or passed to this method.
47
+ extra_headers: Headers | None = None,
48
+ extra_query: Query | None = None,
49
+ extra_body: Body | None = None,
50
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
51
+ ) -> APIInfoRetrieveResponse:
52
+ """Root endpoint with API information"""
53
+ return self._get(
54
+ "/",
55
+ options=make_request_options(
56
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
57
+ ),
58
+ cast_to=APIInfoRetrieveResponse,
59
+ )
60
+
61
+
62
+ class AsyncAPIInfoResource(AsyncAPIResource):
63
+ @cached_property
64
+ def with_raw_response(self) -> AsyncAPIInfoResourceWithRawResponse:
65
+ """
66
+ This property can be used as a prefix for any HTTP method call to return
67
+ the raw response object instead of the parsed content.
68
+
69
+ For more information, see https://www.github.com/evrimai/cartography-client#accessing-raw-response-data-eg-headers
70
+ """
71
+ return AsyncAPIInfoResourceWithRawResponse(self)
72
+
73
+ @cached_property
74
+ def with_streaming_response(self) -> AsyncAPIInfoResourceWithStreamingResponse:
75
+ """
76
+ An alternative to `.with_raw_response` that doesn't eagerly read the response body.
77
+
78
+ For more information, see https://www.github.com/evrimai/cartography-client#with_streaming_response
79
+ """
80
+ return AsyncAPIInfoResourceWithStreamingResponse(self)
81
+
82
+ async def retrieve(
83
+ self,
84
+ *,
85
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
86
+ # The extra values given here take precedence over values defined on the client or passed to this method.
87
+ extra_headers: Headers | None = None,
88
+ extra_query: Query | None = None,
89
+ extra_body: Body | None = None,
90
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
91
+ ) -> APIInfoRetrieveResponse:
92
+ """Root endpoint with API information"""
93
+ return await self._get(
94
+ "/",
95
+ options=make_request_options(
96
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
97
+ ),
98
+ cast_to=APIInfoRetrieveResponse,
99
+ )
100
+
101
+
102
+ class APIInfoResourceWithRawResponse:
103
+ def __init__(self, api_info: APIInfoResource) -> None:
104
+ self._api_info = api_info
105
+
106
+ self.retrieve = to_raw_response_wrapper(
107
+ api_info.retrieve,
108
+ )
109
+
110
+
111
+ class AsyncAPIInfoResourceWithRawResponse:
112
+ def __init__(self, api_info: AsyncAPIInfoResource) -> None:
113
+ self._api_info = api_info
114
+
115
+ self.retrieve = async_to_raw_response_wrapper(
116
+ api_info.retrieve,
117
+ )
118
+
119
+
120
+ class APIInfoResourceWithStreamingResponse:
121
+ def __init__(self, api_info: APIInfoResource) -> None:
122
+ self._api_info = api_info
123
+
124
+ self.retrieve = to_streamed_response_wrapper(
125
+ api_info.retrieve,
126
+ )
127
+
128
+
129
+ class AsyncAPIInfoResourceWithStreamingResponse:
130
+ def __init__(self, api_info: AsyncAPIInfoResource) -> None:
131
+ self._api_info = api_info
132
+
133
+ self.retrieve = async_to_streamed_response_wrapper(
134
+ api_info.retrieve,
135
+ )
@@ -0,0 +1,279 @@
1
+ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ from __future__ import annotations
4
+
5
+ from typing import Dict, Iterable, Optional
6
+
7
+ import httpx
8
+
9
+ from ..types import crawl_create_graph_params
10
+ from .._types import NOT_GIVEN, Body, Query, Headers, NotGiven
11
+ from .._utils import maybe_transform, async_maybe_transform
12
+ from .._compat import cached_property
13
+ from .._resource import SyncAPIResource, AsyncAPIResource
14
+ from .._response import (
15
+ to_raw_response_wrapper,
16
+ to_streamed_response_wrapper,
17
+ async_to_raw_response_wrapper,
18
+ async_to_streamed_response_wrapper,
19
+ )
20
+ from .._base_client import make_request_options
21
+ from ..types.crawl_create_graph_response import CrawlCreateGraphResponse
22
+
23
+ __all__ = ["CrawlResource", "AsyncCrawlResource"]
24
+
25
+
26
+ class CrawlResource(SyncAPIResource):
27
+ @cached_property
28
+ def with_raw_response(self) -> CrawlResourceWithRawResponse:
29
+ """
30
+ This property can be used as a prefix for any HTTP method call to return
31
+ the raw response object instead of the parsed content.
32
+
33
+ For more information, see https://www.github.com/evrimai/cartography-client#accessing-raw-response-data-eg-headers
34
+ """
35
+ return CrawlResourceWithRawResponse(self)
36
+
37
+ @cached_property
38
+ def with_streaming_response(self) -> CrawlResourceWithStreamingResponse:
39
+ """
40
+ An alternative to `.with_raw_response` that doesn't eagerly read the response body.
41
+
42
+ For more information, see https://www.github.com/evrimai/cartography-client#with_streaming_response
43
+ """
44
+ return CrawlResourceWithStreamingResponse(self)
45
+
46
+ def create_graph(
47
+ self,
48
+ *,
49
+ crawl_id: str,
50
+ engines: Iterable[Dict[str, object]],
51
+ s3_bucket: str,
52
+ url: str,
53
+ absolute_only: bool | NotGiven = NOT_GIVEN,
54
+ batch_size: int | NotGiven = NOT_GIVEN,
55
+ debug: bool | NotGiven = NOT_GIVEN,
56
+ depth: Optional[int] | NotGiven = NOT_GIVEN,
57
+ keep_external: bool | NotGiven = NOT_GIVEN,
58
+ max_urls: int | NotGiven = NOT_GIVEN,
59
+ max_workers: int | NotGiven = NOT_GIVEN,
60
+ visit_external: bool | NotGiven = NOT_GIVEN,
61
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
62
+ # The extra values given here take precedence over values defined on the client or passed to this method.
63
+ extra_headers: Headers | None = None,
64
+ extra_query: Query | None = None,
65
+ extra_body: Body | None = None,
66
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
67
+ ) -> CrawlCreateGraphResponse:
68
+ """
69
+ Create a crawl graph by recursively crawling from a root URL
70
+
71
+ This endpoint crawls a website starting from the given URL up to the specified
72
+ depth, extracting links and building a graph structure. Results are checkpointed
73
+ to S3.
74
+
75
+ Requires permission: crawl:write
76
+
77
+ Args:
78
+ crawl_id: Unique identifier for this crawl
79
+
80
+ engines: List of engines to use
81
+
82
+ s3_bucket: S3 bucket for checkpointing
83
+
84
+ url: Root URL to start crawling from
85
+
86
+ absolute_only: Only extract absolute URLs
87
+
88
+ batch_size: URLs per batch
89
+
90
+ debug: Enable debug information
91
+
92
+ depth: Maximum crawl depth
93
+
94
+ keep_external: Keep external URLs in results
95
+
96
+ max_urls: Maximum URLs to crawl
97
+
98
+ max_workers: Maximum concurrent workers
99
+
100
+ visit_external: Visit external URLs
101
+
102
+ extra_headers: Send extra headers
103
+
104
+ extra_query: Add additional query parameters to the request
105
+
106
+ extra_body: Add additional JSON properties to the request
107
+
108
+ timeout: Override the client-level default timeout for this request, in seconds
109
+ """
110
+ return self._post(
111
+ "/crawl/graph",
112
+ body=maybe_transform(
113
+ {
114
+ "crawl_id": crawl_id,
115
+ "engines": engines,
116
+ "s3_bucket": s3_bucket,
117
+ "url": url,
118
+ "absolute_only": absolute_only,
119
+ "batch_size": batch_size,
120
+ "debug": debug,
121
+ "depth": depth,
122
+ "keep_external": keep_external,
123
+ "max_urls": max_urls,
124
+ "max_workers": max_workers,
125
+ "visit_external": visit_external,
126
+ },
127
+ crawl_create_graph_params.CrawlCreateGraphParams,
128
+ ),
129
+ options=make_request_options(
130
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
131
+ ),
132
+ cast_to=CrawlCreateGraphResponse,
133
+ )
134
+
135
+
136
+ class AsyncCrawlResource(AsyncAPIResource):
137
+ @cached_property
138
+ def with_raw_response(self) -> AsyncCrawlResourceWithRawResponse:
139
+ """
140
+ This property can be used as a prefix for any HTTP method call to return
141
+ the raw response object instead of the parsed content.
142
+
143
+ For more information, see https://www.github.com/evrimai/cartography-client#accessing-raw-response-data-eg-headers
144
+ """
145
+ return AsyncCrawlResourceWithRawResponse(self)
146
+
147
+ @cached_property
148
+ def with_streaming_response(self) -> AsyncCrawlResourceWithStreamingResponse:
149
+ """
150
+ An alternative to `.with_raw_response` that doesn't eagerly read the response body.
151
+
152
+ For more information, see https://www.github.com/evrimai/cartography-client#with_streaming_response
153
+ """
154
+ return AsyncCrawlResourceWithStreamingResponse(self)
155
+
156
+ async def create_graph(
157
+ self,
158
+ *,
159
+ crawl_id: str,
160
+ engines: Iterable[Dict[str, object]],
161
+ s3_bucket: str,
162
+ url: str,
163
+ absolute_only: bool | NotGiven = NOT_GIVEN,
164
+ batch_size: int | NotGiven = NOT_GIVEN,
165
+ debug: bool | NotGiven = NOT_GIVEN,
166
+ depth: Optional[int] | NotGiven = NOT_GIVEN,
167
+ keep_external: bool | NotGiven = NOT_GIVEN,
168
+ max_urls: int | NotGiven = NOT_GIVEN,
169
+ max_workers: int | NotGiven = NOT_GIVEN,
170
+ visit_external: bool | NotGiven = NOT_GIVEN,
171
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
172
+ # The extra values given here take precedence over values defined on the client or passed to this method.
173
+ extra_headers: Headers | None = None,
174
+ extra_query: Query | None = None,
175
+ extra_body: Body | None = None,
176
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
177
+ ) -> CrawlCreateGraphResponse:
178
+ """
179
+ Create a crawl graph by recursively crawling from a root URL
180
+
181
+ This endpoint crawls a website starting from the given URL up to the specified
182
+ depth, extracting links and building a graph structure. Results are checkpointed
183
+ to S3.
184
+
185
+ Requires permission: crawl:write
186
+
187
+ Args:
188
+ crawl_id: Unique identifier for this crawl
189
+
190
+ engines: List of engines to use
191
+
192
+ s3_bucket: S3 bucket for checkpointing
193
+
194
+ url: Root URL to start crawling from
195
+
196
+ absolute_only: Only extract absolute URLs
197
+
198
+ batch_size: URLs per batch
199
+
200
+ debug: Enable debug information
201
+
202
+ depth: Maximum crawl depth
203
+
204
+ keep_external: Keep external URLs in results
205
+
206
+ max_urls: Maximum URLs to crawl
207
+
208
+ max_workers: Maximum concurrent workers
209
+
210
+ visit_external: Visit external URLs
211
+
212
+ extra_headers: Send extra headers
213
+
214
+ extra_query: Add additional query parameters to the request
215
+
216
+ extra_body: Add additional JSON properties to the request
217
+
218
+ timeout: Override the client-level default timeout for this request, in seconds
219
+ """
220
+ return await self._post(
221
+ "/crawl/graph",
222
+ body=await async_maybe_transform(
223
+ {
224
+ "crawl_id": crawl_id,
225
+ "engines": engines,
226
+ "s3_bucket": s3_bucket,
227
+ "url": url,
228
+ "absolute_only": absolute_only,
229
+ "batch_size": batch_size,
230
+ "debug": debug,
231
+ "depth": depth,
232
+ "keep_external": keep_external,
233
+ "max_urls": max_urls,
234
+ "max_workers": max_workers,
235
+ "visit_external": visit_external,
236
+ },
237
+ crawl_create_graph_params.CrawlCreateGraphParams,
238
+ ),
239
+ options=make_request_options(
240
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
241
+ ),
242
+ cast_to=CrawlCreateGraphResponse,
243
+ )
244
+
245
+
246
+ class CrawlResourceWithRawResponse:
247
+ def __init__(self, crawl: CrawlResource) -> None:
248
+ self._crawl = crawl
249
+
250
+ self.create_graph = to_raw_response_wrapper(
251
+ crawl.create_graph,
252
+ )
253
+
254
+
255
+ class AsyncCrawlResourceWithRawResponse:
256
+ def __init__(self, crawl: AsyncCrawlResource) -> None:
257
+ self._crawl = crawl
258
+
259
+ self.create_graph = async_to_raw_response_wrapper(
260
+ crawl.create_graph,
261
+ )
262
+
263
+
264
+ class CrawlResourceWithStreamingResponse:
265
+ def __init__(self, crawl: CrawlResource) -> None:
266
+ self._crawl = crawl
267
+
268
+ self.create_graph = to_streamed_response_wrapper(
269
+ crawl.create_graph,
270
+ )
271
+
272
+
273
+ class AsyncCrawlResourceWithStreamingResponse:
274
+ def __init__(self, crawl: AsyncCrawlResource) -> None:
275
+ self._crawl = crawl
276
+
277
+ self.create_graph = async_to_streamed_response_wrapper(
278
+ crawl.create_graph,
279
+ )