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.
- cartography/__init__.py +100 -0
- cartography/_base_client.py +1995 -0
- cartography/_client.py +444 -0
- cartography/_compat.py +219 -0
- cartography/_constants.py +14 -0
- cartography/_exceptions.py +108 -0
- cartography/_files.py +123 -0
- cartography/_models.py +829 -0
- cartography/_qs.py +150 -0
- cartography/_resource.py +43 -0
- cartography/_response.py +832 -0
- cartography/_streaming.py +333 -0
- cartography/_types.py +219 -0
- cartography/_utils/__init__.py +57 -0
- cartography/_utils/_logs.py +25 -0
- cartography/_utils/_proxy.py +65 -0
- cartography/_utils/_reflection.py +42 -0
- cartography/_utils/_resources_proxy.py +24 -0
- cartography/_utils/_streams.py +12 -0
- cartography/_utils/_sync.py +86 -0
- cartography/_utils/_transform.py +447 -0
- cartography/_utils/_typing.py +151 -0
- cartography/_utils/_utils.py +422 -0
- cartography/_version.py +4 -0
- cartography/lib/.keep +4 -0
- cartography/py.typed +0 -0
- cartography/resources/__init__.py +89 -0
- cartography/resources/api_info.py +135 -0
- cartography/resources/crawl.py +279 -0
- cartography/resources/download.py +376 -0
- cartography/resources/health.py +143 -0
- cartography/resources/scrape.py +331 -0
- cartography/resources/workflows/__init__.py +33 -0
- cartography/resources/workflows/request/__init__.py +33 -0
- cartography/resources/workflows/request/crawl.py +295 -0
- cartography/resources/workflows/request/request.py +221 -0
- cartography/resources/workflows/workflows.py +274 -0
- cartography/types/__init__.py +23 -0
- cartography/types/api_info_retrieve_response.py +8 -0
- cartography/types/bulk_download_result.py +23 -0
- cartography/types/bulk_scrape_result.py +19 -0
- cartography/types/crawl_create_graph_params.py +46 -0
- cartography/types/crawl_create_graph_response.py +37 -0
- cartography/types/download_create_bulk_params.py +37 -0
- cartography/types/download_create_bulk_response.py +41 -0
- cartography/types/download_create_single_params.py +32 -0
- cartography/types/download_create_single_response.py +21 -0
- cartography/types/downloader_type.py +7 -0
- cartography/types/health_check_response.py +8 -0
- cartography/types/scrape_engine_param.py +28 -0
- cartography/types/scrape_scrape_bulk_params.py +33 -0
- cartography/types/scrape_scrape_bulk_response.py +41 -0
- cartography/types/scrape_scrape_single_params.py +17 -0
- cartography/types/scrape_scrape_single_response.py +23 -0
- cartography/types/wait_until.py +7 -0
- cartography/types/workflow_describe_response.py +8 -0
- cartography/types/workflow_results_response.py +8 -0
- cartography/types/workflows/__init__.py +6 -0
- cartography/types/workflows/request/__init__.py +9 -0
- cartography/types/workflows/request/crawl_create_bulk_params.py +14 -0
- cartography/types/workflows/request/crawl_create_bulk_response.py +22 -0
- cartography/types/workflows/request/crawl_create_params.py +32 -0
- cartography/types/workflows/request/crawl_request_param.py +32 -0
- cartography/types/workflows/request/workflow_result.py +11 -0
- cartography/types/workflows/request_create_download_params.py +18 -0
- cartography/types/workflows/request_create_download_response.py +8 -0
- cartography_client-0.0.1.dist-info/METADATA +399 -0
- cartography_client-0.0.1.dist-info/RECORD +70 -0
- cartography_client-0.0.1.dist-info/WHEEL +4 -0
- cartography_client-0.0.1.dist-info/licenses/LICENSE +201 -0
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
from typing import Dict, List, Optional
|
|
4
|
+
|
|
5
|
+
from .._models import BaseModel
|
|
6
|
+
from .bulk_download_result import BulkDownloadResult
|
|
7
|
+
|
|
8
|
+
__all__ = ["DownloadCreateBulkResponse", "Results"]
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
class Results(BaseModel):
|
|
12
|
+
cached: Optional[List[BulkDownloadResult]] = None
|
|
13
|
+
|
|
14
|
+
failed: Optional[List[BulkDownloadResult]] = None
|
|
15
|
+
|
|
16
|
+
save_failed: Optional[List[BulkDownloadResult]] = None
|
|
17
|
+
|
|
18
|
+
success: Optional[List[BulkDownloadResult]] = None
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
class DownloadCreateBulkResponse(BaseModel):
|
|
22
|
+
cached_count: int
|
|
23
|
+
|
|
24
|
+
crawl_id: str
|
|
25
|
+
|
|
26
|
+
failed_count: int
|
|
27
|
+
|
|
28
|
+
results: Results
|
|
29
|
+
"""Grouped results by status"""
|
|
30
|
+
|
|
31
|
+
save_failed_count: int
|
|
32
|
+
|
|
33
|
+
success_count: int
|
|
34
|
+
|
|
35
|
+
timestamp: str
|
|
36
|
+
|
|
37
|
+
total_downloads_attempted: int
|
|
38
|
+
|
|
39
|
+
total_urls: int
|
|
40
|
+
|
|
41
|
+
debug_frame: Optional[List[Dict[str, object]]] = None
|
|
@@ -0,0 +1,32 @@
|
|
|
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 Optional
|
|
6
|
+
from typing_extensions import Required, Annotated, TypedDict
|
|
7
|
+
|
|
8
|
+
from .._utils import PropertyInfo
|
|
9
|
+
from .wait_until import WaitUntil
|
|
10
|
+
from .downloader_type import DownloaderType
|
|
11
|
+
|
|
12
|
+
__all__ = ["DownloadCreateSingleParams"]
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
class DownloadCreateSingleParams(TypedDict, total=False):
|
|
16
|
+
s3_bucket: Required[str]
|
|
17
|
+
"""S3 bucket for storage"""
|
|
18
|
+
|
|
19
|
+
url: Required[str]
|
|
20
|
+
"""URL to download"""
|
|
21
|
+
|
|
22
|
+
downloader_type: DownloaderType
|
|
23
|
+
"""Available downloader types"""
|
|
24
|
+
|
|
25
|
+
s3_key: Optional[str]
|
|
26
|
+
"""S3 key for the file"""
|
|
27
|
+
|
|
28
|
+
api_timeout: Annotated[int, PropertyInfo(alias="timeout")]
|
|
29
|
+
"""Timeout in milliseconds"""
|
|
30
|
+
|
|
31
|
+
wait_until: WaitUntil
|
|
32
|
+
"""When to consider download complete"""
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
from typing import Optional
|
|
4
|
+
|
|
5
|
+
from .._models import BaseModel
|
|
6
|
+
|
|
7
|
+
__all__ = ["DownloadCreateSingleResponse"]
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
class DownloadCreateSingleResponse(BaseModel):
|
|
11
|
+
download_url: str
|
|
12
|
+
|
|
13
|
+
s3_bucket: str
|
|
14
|
+
|
|
15
|
+
s3_key: str
|
|
16
|
+
|
|
17
|
+
success: bool
|
|
18
|
+
|
|
19
|
+
error: Optional[str] = None
|
|
20
|
+
|
|
21
|
+
job_id: Optional[str] = None
|
|
@@ -0,0 +1,28 @@
|
|
|
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, Optional
|
|
6
|
+
from typing_extensions import Literal, Required, TypedDict
|
|
7
|
+
|
|
8
|
+
__all__ = ["ScrapeEngineParam"]
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
class ScrapeEngineParam(TypedDict, total=False):
|
|
12
|
+
engine_type: Required[Literal["scrapingbee", "zenrows", "fleet", "async_fleet"]]
|
|
13
|
+
"""Available engine types"""
|
|
14
|
+
|
|
15
|
+
headers: Optional[Dict[str, str]]
|
|
16
|
+
"""Custom headers"""
|
|
17
|
+
|
|
18
|
+
proxy: Optional[str]
|
|
19
|
+
"""Proxy URL"""
|
|
20
|
+
|
|
21
|
+
screenshot: Optional[bool]
|
|
22
|
+
"""Take screenshot (Playwright only)"""
|
|
23
|
+
|
|
24
|
+
timeout: Optional[int]
|
|
25
|
+
"""Timeout in milliseconds"""
|
|
26
|
+
|
|
27
|
+
wait_for: Optional[str]
|
|
28
|
+
"""CSS selector to wait for (Playwright only)"""
|
|
@@ -0,0 +1,33 @@
|
|
|
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 List, Iterable
|
|
6
|
+
from typing_extensions import Required, TypedDict
|
|
7
|
+
|
|
8
|
+
from .scrape_engine_param import ScrapeEngineParam
|
|
9
|
+
|
|
10
|
+
__all__ = ["ScrapeScrapeBulkParams"]
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
class ScrapeScrapeBulkParams(TypedDict, total=False):
|
|
14
|
+
crawl_id: Required[str]
|
|
15
|
+
"""Unique identifier for this crawl"""
|
|
16
|
+
|
|
17
|
+
engines: Required[Iterable[ScrapeEngineParam]]
|
|
18
|
+
"""List of engines to use"""
|
|
19
|
+
|
|
20
|
+
s3_bucket: Required[str]
|
|
21
|
+
"""S3 bucket for checkpointing"""
|
|
22
|
+
|
|
23
|
+
urls: Required[List[str]]
|
|
24
|
+
"""List of URLs to scrape"""
|
|
25
|
+
|
|
26
|
+
batch_size: int
|
|
27
|
+
"""URLs per batch"""
|
|
28
|
+
|
|
29
|
+
debug: bool
|
|
30
|
+
"""Enable debug information"""
|
|
31
|
+
|
|
32
|
+
max_workers: int
|
|
33
|
+
"""Maximum concurrent workers"""
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
from typing import Dict, List, Optional
|
|
4
|
+
|
|
5
|
+
from .._models import BaseModel
|
|
6
|
+
from .bulk_scrape_result import BulkScrapeResult
|
|
7
|
+
|
|
8
|
+
__all__ = ["ScrapeScrapeBulkResponse", "Results"]
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
class Results(BaseModel):
|
|
12
|
+
cached: Optional[List[BulkScrapeResult]] = None
|
|
13
|
+
|
|
14
|
+
failed: Optional[List[BulkScrapeResult]] = None
|
|
15
|
+
|
|
16
|
+
save_failed: Optional[List[BulkScrapeResult]] = None
|
|
17
|
+
|
|
18
|
+
success: Optional[List[BulkScrapeResult]] = None
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
class ScrapeScrapeBulkResponse(BaseModel):
|
|
22
|
+
cached_count: int
|
|
23
|
+
|
|
24
|
+
crawl_id: str
|
|
25
|
+
|
|
26
|
+
failed_count: int
|
|
27
|
+
|
|
28
|
+
results: Results
|
|
29
|
+
"""Grouped results by status"""
|
|
30
|
+
|
|
31
|
+
save_failed_count: int
|
|
32
|
+
|
|
33
|
+
success_count: int
|
|
34
|
+
|
|
35
|
+
timestamp: str
|
|
36
|
+
|
|
37
|
+
total_pages_visited: int
|
|
38
|
+
|
|
39
|
+
total_urls: int
|
|
40
|
+
|
|
41
|
+
debug_frame: Optional[List[Dict[str, object]]] = None
|
|
@@ -0,0 +1,17 @@
|
|
|
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 Iterable
|
|
6
|
+
from typing_extensions import Required, TypedDict
|
|
7
|
+
|
|
8
|
+
from .scrape_engine_param import ScrapeEngineParam
|
|
9
|
+
|
|
10
|
+
__all__ = ["ScrapeScrapeSingleParams"]
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
class ScrapeScrapeSingleParams(TypedDict, total=False):
|
|
14
|
+
engines: Required[Iterable[ScrapeEngineParam]]
|
|
15
|
+
"""List of engines to use"""
|
|
16
|
+
|
|
17
|
+
url: Required[str]
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
from typing import Optional
|
|
4
|
+
|
|
5
|
+
from .._models import BaseModel
|
|
6
|
+
|
|
7
|
+
__all__ = ["ScrapeScrapeSingleResponse"]
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
class ScrapeScrapeSingleResponse(BaseModel):
|
|
11
|
+
composite_hash: Optional[str] = None
|
|
12
|
+
|
|
13
|
+
content: Optional[str] = None
|
|
14
|
+
|
|
15
|
+
content_hash: Optional[str] = None
|
|
16
|
+
|
|
17
|
+
status_code: Optional[int] = None
|
|
18
|
+
|
|
19
|
+
url: str
|
|
20
|
+
|
|
21
|
+
url_hash: Optional[str] = None
|
|
22
|
+
|
|
23
|
+
error: Optional[str] = None
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
from .request_create_download_params import RequestCreateDownloadParams as RequestCreateDownloadParams
|
|
6
|
+
from .request_create_download_response import RequestCreateDownloadResponse as RequestCreateDownloadResponse
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
from .workflow_result import WorkflowResult as WorkflowResult
|
|
6
|
+
from .crawl_create_params import CrawlCreateParams as CrawlCreateParams
|
|
7
|
+
from .crawl_request_param import CrawlRequestParam as CrawlRequestParam
|
|
8
|
+
from .crawl_create_bulk_params import CrawlCreateBulkParams as CrawlCreateBulkParams
|
|
9
|
+
from .crawl_create_bulk_response import CrawlCreateBulkResponse as CrawlCreateBulkResponse
|
|
@@ -0,0 +1,14 @@
|
|
|
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 Iterable
|
|
6
|
+
from typing_extensions import Required, TypedDict
|
|
7
|
+
|
|
8
|
+
from .crawl_request_param import CrawlRequestParam
|
|
9
|
+
|
|
10
|
+
__all__ = ["CrawlCreateBulkParams"]
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
class CrawlCreateBulkParams(TypedDict, total=False):
|
|
14
|
+
jobs: Required[Iterable[CrawlRequestParam]]
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
from typing import List, Optional
|
|
4
|
+
|
|
5
|
+
from ...._models import BaseModel
|
|
6
|
+
from .workflow_result import WorkflowResult
|
|
7
|
+
|
|
8
|
+
__all__ = ["CrawlCreateBulkResponse", "Error"]
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
class Error(BaseModel):
|
|
12
|
+
error: str
|
|
13
|
+
|
|
14
|
+
url: Optional[str] = None
|
|
15
|
+
|
|
16
|
+
workflow_id: Optional[str] = None
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
class CrawlCreateBulkResponse(BaseModel):
|
|
20
|
+
results: List[WorkflowResult]
|
|
21
|
+
|
|
22
|
+
errors: Optional[List[Error]] = None
|
|
@@ -0,0 +1,32 @@
|
|
|
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
|
|
6
|
+
from typing_extensions import Required, TypedDict
|
|
7
|
+
|
|
8
|
+
__all__ = ["CrawlCreateParams"]
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
class CrawlCreateParams(TypedDict, total=False):
|
|
12
|
+
bucket_name: Required[str]
|
|
13
|
+
|
|
14
|
+
crawl_id: Required[str]
|
|
15
|
+
|
|
16
|
+
engines: Required[Iterable[Dict[str, object]]]
|
|
17
|
+
|
|
18
|
+
url: Required[str]
|
|
19
|
+
|
|
20
|
+
absolute_only: bool
|
|
21
|
+
|
|
22
|
+
batch_size: int
|
|
23
|
+
|
|
24
|
+
depth: int
|
|
25
|
+
|
|
26
|
+
keep_external: bool
|
|
27
|
+
|
|
28
|
+
max_urls: int
|
|
29
|
+
|
|
30
|
+
max_workers: int
|
|
31
|
+
|
|
32
|
+
visit_external: bool
|
|
@@ -0,0 +1,32 @@
|
|
|
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
|
|
6
|
+
from typing_extensions import Required, TypedDict
|
|
7
|
+
|
|
8
|
+
__all__ = ["CrawlRequestParam"]
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
class CrawlRequestParam(TypedDict, total=False):
|
|
12
|
+
bucket_name: Required[str]
|
|
13
|
+
|
|
14
|
+
crawl_id: Required[str]
|
|
15
|
+
|
|
16
|
+
engines: Required[Iterable[Dict[str, object]]]
|
|
17
|
+
|
|
18
|
+
url: Required[str]
|
|
19
|
+
|
|
20
|
+
absolute_only: bool
|
|
21
|
+
|
|
22
|
+
batch_size: int
|
|
23
|
+
|
|
24
|
+
depth: int
|
|
25
|
+
|
|
26
|
+
keep_external: bool
|
|
27
|
+
|
|
28
|
+
max_urls: int
|
|
29
|
+
|
|
30
|
+
max_workers: int
|
|
31
|
+
|
|
32
|
+
visit_external: bool
|
|
@@ -0,0 +1,18 @@
|
|
|
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 List
|
|
6
|
+
from typing_extensions import Required, TypedDict
|
|
7
|
+
|
|
8
|
+
__all__ = ["RequestCreateDownloadParams"]
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
class RequestCreateDownloadParams(TypedDict, total=False):
|
|
12
|
+
bucket_name: Required[str]
|
|
13
|
+
|
|
14
|
+
crawl_id: Required[str]
|
|
15
|
+
|
|
16
|
+
downloader_type: Required[str]
|
|
17
|
+
|
|
18
|
+
urls: Required[List[str]]
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
from typing import Dict
|
|
4
|
+
from typing_extensions import TypeAlias
|
|
5
|
+
|
|
6
|
+
__all__ = ["RequestCreateDownloadResponse"]
|
|
7
|
+
|
|
8
|
+
RequestCreateDownloadResponse: TypeAlias = Dict[str, object]
|