Skip to content

Commit 279e383

Browse files
authored
Merge pull request #8 from context-dot-dev/release-please--branches--main--changes--next
release: 0.6.0
2 parents ddcd26a + effa030 commit 279e383

11 files changed

Lines changed: 384 additions & 7 deletions

File tree

‎.release-please-manifest.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
".": "0.5.0"
2+
".": "0.6.0"
33
}

‎.stats.yml‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
configured_endpoints: 20
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/context-dev%2Fcontext.dev-56a21db16ac3a797f86daca01a2ea115a0365db4b2f9d8accdec4f4d3ee2eb83.yml
3-
openapi_spec_hash: bfcef090896da96023c4485a3d69e350
4-
config_hash: 38268bb88fc4dcbb8f2f94dd138b5910
1+
configured_endpoints: 21
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/context-dev%2Fcontext.dev-97cdb78dc0d72e9df643a89660f2b0c9687f12c6e4d93f7767f6cfc1b4f2e4c7.yml
3+
openapi_spec_hash: 92fc94fd8865fabe78c2667490ca3884
4+
config_hash: 682b89b02a20f5d1c13e2c91ecbcf5ce

‎CHANGELOG.md‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
# Changelog
22

3+
## 0.6.0 (2026-04-04)
4+
5+
Full Changelog: [v0.5.0...v0.6.0](https://github.com/context-dot-dev/context-python-sdk/compare/v0.5.0...v0.6.0)
6+
7+
### Features
8+
9+
* **api:** manual updates ([e40b811](https://github.com/context-dot-dev/context-python-sdk/commit/e40b8117067dece6aaef3ca122b655f1808be1a3))
10+
311
## 0.5.0 (2026-04-03)
412

513
Full Changelog: [v0.4.0...v0.5.0](https://github.com/context-dot-dev/context-python-sdk/compare/v0.4.0...v0.5.0)

‎api.md‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ Types:
55
```python
66
from context.dev.types import (
77
WebScreenshotResponse,
8+
WebWebCrawlMdResponse,
89
WebWebScrapeHTMLResponse,
910
WebWebScrapeImagesResponse,
1011
WebWebScrapeMdResponse,
@@ -15,6 +16,7 @@ from context.dev.types import (
1516
Methods:
1617

1718
- <code title="get /brand/screenshot">client.web.<a href="./src/context/dev/resources/web.py">screenshot</a>(\*\*<a href="src/context/dev/types/web_screenshot_params.py">params</a>) -> <a href="./src/context/dev/types/web_screenshot_response.py">WebScreenshotResponse</a></code>
19+
- <code title="post /web/crawl">client.web.<a href="./src/context/dev/resources/web.py">web_crawl_md</a>(\*\*<a href="src/context/dev/types/web_web_crawl_md_params.py">params</a>) -> <a href="./src/context/dev/types/web_web_crawl_md_response.py">WebWebCrawlMdResponse</a></code>
1820
- <code title="get /web/scrape/html">client.web.<a href="./src/context/dev/resources/web.py">web_scrape_html</a>(\*\*<a href="src/context/dev/types/web_web_scrape_html_params.py">params</a>) -> <a href="./src/context/dev/types/web_web_scrape_html_response.py">WebWebScrapeHTMLResponse</a></code>
1921
- <code title="get /web/scrape/images">client.web.<a href="./src/context/dev/resources/web.py">web_scrape_images</a>(\*\*<a href="src/context/dev/types/web_web_scrape_images_params.py">params</a>) -> <a href="./src/context/dev/types/web_web_scrape_images_response.py">WebWebScrapeImagesResponse</a></code>
2022
- <code title="get /web/scrape/markdown">client.web.<a href="./src/context/dev/resources/web.py">web_scrape_md</a>(\*\*<a href="src/context/dev/types/web_web_scrape_md_params.py">params</a>) -> <a href="./src/context/dev/types/web_web_scrape_md_response.py">WebWebScrapeMdResponse</a></code>

‎pyproject.toml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "context.dev"
3-
version = "0.5.0"
3+
version = "0.6.0"
44
description = "The official Python library for the context.dev API"
55
dynamic = ["readme"]
66
license = "Apache-2.0"

‎src/context/dev/_version.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
22

33
__title__ = "context.dev"
4-
__version__ = "0.5.0" # x-release-please-version
4+
__version__ = "0.6.0" # x-release-please-version

‎src/context/dev/resources/web.py‎

Lines changed: 166 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88

99
from ..types import (
1010
web_screenshot_params,
11+
web_web_crawl_md_params,
1112
web_web_scrape_md_params,
1213
web_web_scrape_html_params,
1314
web_web_scrape_images_params,
@@ -25,6 +26,7 @@
2526
)
2627
from .._base_client import make_request_options
2728
from ..types.web_screenshot_response import WebScreenshotResponse
29+
from ..types.web_web_crawl_md_response import WebWebCrawlMdResponse
2830
from ..types.web_web_scrape_md_response import WebWebScrapeMdResponse
2931
from ..types.web_web_scrape_html_response import WebWebScrapeHTMLResponse
3032
from ..types.web_web_scrape_images_response import WebWebScrapeImagesResponse
@@ -119,6 +121,82 @@ def screenshot(
119121
cast_to=WebScreenshotResponse,
120122
)
121123

124+
def web_crawl_md(
125+
self,
126+
*,
127+
url: str,
128+
follow_subdomains: bool | Omit = omit,
129+
include_images: bool | Omit = omit,
130+
include_links: bool | Omit = omit,
131+
max_depth: int | Omit = omit,
132+
max_pages: int | Omit = omit,
133+
shorten_base64_images: bool | Omit = omit,
134+
url_regex: str | Omit = omit,
135+
use_main_content_only: bool | Omit = omit,
136+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
137+
# The extra values given here take precedence over values defined on the client or passed to this method.
138+
extra_headers: Headers | None = None,
139+
extra_query: Query | None = None,
140+
extra_body: Body | None = None,
141+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
142+
) -> WebWebCrawlMdResponse:
143+
"""
144+
Performs a crawl starting from a given URL, extracts page content as Markdown,
145+
and returns results for all crawled pages. Only follows links within the same
146+
domain as the starting URL. Costs 1 credit per successful page crawled.
147+
148+
Args:
149+
url: The starting URL for the crawl (must include http:// or https:// protocol)
150+
151+
follow_subdomains: When true, follow links on subdomains of the starting URL's domain (e.g.
152+
docs.example.com when starting from example.com). www and apex are always
153+
treated as equivalent.
154+
155+
include_images: Include image references in the Markdown output
156+
157+
include_links: Preserve hyperlinks in the Markdown output
158+
159+
max_depth: Maximum link depth from the starting URL (0 = only the starting page)
160+
161+
max_pages: Maximum number of pages to crawl. Hard cap: 500.
162+
163+
shorten_base64_images: Truncate base64-encoded image data in the Markdown output
164+
165+
url_regex: Regex pattern. Only URLs matching this pattern will be followed and scraped.
166+
167+
use_main_content_only: Extract only the main content, stripping headers, footers, sidebars, and
168+
navigation
169+
170+
extra_headers: Send extra headers
171+
172+
extra_query: Add additional query parameters to the request
173+
174+
extra_body: Add additional JSON properties to the request
175+
176+
timeout: Override the client-level default timeout for this request, in seconds
177+
"""
178+
return self._post(
179+
"/web/crawl",
180+
body=maybe_transform(
181+
{
182+
"url": url,
183+
"follow_subdomains": follow_subdomains,
184+
"include_images": include_images,
185+
"include_links": include_links,
186+
"max_depth": max_depth,
187+
"max_pages": max_pages,
188+
"shorten_base64_images": shorten_base64_images,
189+
"url_regex": url_regex,
190+
"use_main_content_only": use_main_content_only,
191+
},
192+
web_web_crawl_md_params.WebWebCrawlMdParams,
193+
),
194+
options=make_request_options(
195+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
196+
),
197+
cast_to=WebWebCrawlMdResponse,
198+
)
199+
122200
def web_scrape_html(
123201
self,
124202
*,
@@ -394,6 +472,82 @@ async def screenshot(
394472
cast_to=WebScreenshotResponse,
395473
)
396474

475+
async def web_crawl_md(
476+
self,
477+
*,
478+
url: str,
479+
follow_subdomains: bool | Omit = omit,
480+
include_images: bool | Omit = omit,
481+
include_links: bool | Omit = omit,
482+
max_depth: int | Omit = omit,
483+
max_pages: int | Omit = omit,
484+
shorten_base64_images: bool | Omit = omit,
485+
url_regex: str | Omit = omit,
486+
use_main_content_only: bool | Omit = omit,
487+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
488+
# The extra values given here take precedence over values defined on the client or passed to this method.
489+
extra_headers: Headers | None = None,
490+
extra_query: Query | None = None,
491+
extra_body: Body | None = None,
492+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
493+
) -> WebWebCrawlMdResponse:
494+
"""
495+
Performs a crawl starting from a given URL, extracts page content as Markdown,
496+
and returns results for all crawled pages. Only follows links within the same
497+
domain as the starting URL. Costs 1 credit per successful page crawled.
498+
499+
Args:
500+
url: The starting URL for the crawl (must include http:// or https:// protocol)
501+
502+
follow_subdomains: When true, follow links on subdomains of the starting URL's domain (e.g.
503+
docs.example.com when starting from example.com). www and apex are always
504+
treated as equivalent.
505+
506+
include_images: Include image references in the Markdown output
507+
508+
include_links: Preserve hyperlinks in the Markdown output
509+
510+
max_depth: Maximum link depth from the starting URL (0 = only the starting page)
511+
512+
max_pages: Maximum number of pages to crawl. Hard cap: 500.
513+
514+
shorten_base64_images: Truncate base64-encoded image data in the Markdown output
515+
516+
url_regex: Regex pattern. Only URLs matching this pattern will be followed and scraped.
517+
518+
use_main_content_only: Extract only the main content, stripping headers, footers, sidebars, and
519+
navigation
520+
521+
extra_headers: Send extra headers
522+
523+
extra_query: Add additional query parameters to the request
524+
525+
extra_body: Add additional JSON properties to the request
526+
527+
timeout: Override the client-level default timeout for this request, in seconds
528+
"""
529+
return await self._post(
530+
"/web/crawl",
531+
body=await async_maybe_transform(
532+
{
533+
"url": url,
534+
"follow_subdomains": follow_subdomains,
535+
"include_images": include_images,
536+
"include_links": include_links,
537+
"max_depth": max_depth,
538+
"max_pages": max_pages,
539+
"shorten_base64_images": shorten_base64_images,
540+
"url_regex": url_regex,
541+
"use_main_content_only": use_main_content_only,
542+
},
543+
web_web_crawl_md_params.WebWebCrawlMdParams,
544+
),
545+
options=make_request_options(
546+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
547+
),
548+
cast_to=WebWebCrawlMdResponse,
549+
)
550+
397551
async def web_scrape_html(
398552
self,
399553
*,
@@ -590,6 +744,9 @@ def __init__(self, web: WebResource) -> None:
590744
self.screenshot = to_raw_response_wrapper(
591745
web.screenshot,
592746
)
747+
self.web_crawl_md = to_raw_response_wrapper(
748+
web.web_crawl_md,
749+
)
593750
self.web_scrape_html = to_raw_response_wrapper(
594751
web.web_scrape_html,
595752
)
@@ -611,6 +768,9 @@ def __init__(self, web: AsyncWebResource) -> None:
611768
self.screenshot = async_to_raw_response_wrapper(
612769
web.screenshot,
613770
)
771+
self.web_crawl_md = async_to_raw_response_wrapper(
772+
web.web_crawl_md,
773+
)
614774
self.web_scrape_html = async_to_raw_response_wrapper(
615775
web.web_scrape_html,
616776
)
@@ -632,6 +792,9 @@ def __init__(self, web: WebResource) -> None:
632792
self.screenshot = to_streamed_response_wrapper(
633793
web.screenshot,
634794
)
795+
self.web_crawl_md = to_streamed_response_wrapper(
796+
web.web_crawl_md,
797+
)
635798
self.web_scrape_html = to_streamed_response_wrapper(
636799
web.web_scrape_html,
637800
)
@@ -653,6 +816,9 @@ def __init__(self, web: AsyncWebResource) -> None:
653816
self.screenshot = async_to_streamed_response_wrapper(
654817
web.screenshot,
655818
)
819+
self.web_crawl_md = async_to_streamed_response_wrapper(
820+
web.web_crawl_md,
821+
)
656822
self.web_scrape_html = async_to_streamed_response_wrapper(
657823
web.web_scrape_html,
658824
)

‎src/context/dev/types/__init__.py‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,11 @@
99
from .brand_retrieve_response import BrandRetrieveResponse as BrandRetrieveResponse
1010
from .utility_prefetch_params import UtilityPrefetchParams as UtilityPrefetchParams
1111
from .web_screenshot_response import WebScreenshotResponse as WebScreenshotResponse
12+
from .web_web_crawl_md_params import WebWebCrawlMdParams as WebWebCrawlMdParams
1213
from .web_web_scrape_md_params import WebWebScrapeMdParams as WebWebScrapeMdParams
1314
from .ai_extract_product_params import AIExtractProductParams as AIExtractProductParams
1415
from .utility_prefetch_response import UtilityPrefetchResponse as UtilityPrefetchResponse
16+
from .web_web_crawl_md_response import WebWebCrawlMdResponse as WebWebCrawlMdResponse
1517
from .ai_extract_products_params import AIExtractProductsParams as AIExtractProductsParams
1618
from .style_extract_fonts_params import StyleExtractFontsParams as StyleExtractFontsParams
1719
from .web_web_scrape_html_params import WebWebScrapeHTMLParams as WebWebScrapeHTMLParams
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2+
3+
from __future__ import annotations
4+
5+
from typing_extensions import Required, Annotated, TypedDict
6+
7+
from .._utils import PropertyInfo
8+
9+
__all__ = ["WebWebCrawlMdParams"]
10+
11+
12+
class WebWebCrawlMdParams(TypedDict, total=False):
13+
url: Required[str]
14+
"""The starting URL for the crawl (must include http:// or https:// protocol)"""
15+
16+
follow_subdomains: Annotated[bool, PropertyInfo(alias="followSubdomains")]
17+
"""When true, follow links on subdomains of the starting URL's domain (e.g.
18+
19+
docs.example.com when starting from example.com). www and apex are always
20+
treated as equivalent.
21+
"""
22+
23+
include_images: Annotated[bool, PropertyInfo(alias="includeImages")]
24+
"""Include image references in the Markdown output"""
25+
26+
include_links: Annotated[bool, PropertyInfo(alias="includeLinks")]
27+
"""Preserve hyperlinks in the Markdown output"""
28+
29+
max_depth: Annotated[int, PropertyInfo(alias="maxDepth")]
30+
"""Maximum link depth from the starting URL (0 = only the starting page)"""
31+
32+
max_pages: Annotated[int, PropertyInfo(alias="maxPages")]
33+
"""Maximum number of pages to crawl. Hard cap: 500."""
34+
35+
shorten_base64_images: Annotated[bool, PropertyInfo(alias="shortenBase64Images")]
36+
"""Truncate base64-encoded image data in the Markdown output"""
37+
38+
url_regex: Annotated[str, PropertyInfo(alias="urlRegex")]
39+
"""Regex pattern. Only URLs matching this pattern will be followed and scraped."""
40+
41+
use_main_content_only: Annotated[bool, PropertyInfo(alias="useMainContentOnly")]
42+
"""
43+
Extract only the main content, stripping headers, footers, sidebars, and
44+
navigation
45+
"""
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2+
3+
from typing import List
4+
5+
from pydantic import Field as FieldInfo
6+
7+
from .._models import BaseModel
8+
9+
__all__ = ["WebWebCrawlMdResponse", "Metadata", "Result", "ResultMetadata"]
10+
11+
12+
class Metadata(BaseModel):
13+
max_crawl_depth: int = FieldInfo(alias="maxCrawlDepth")
14+
"""Maximum crawl depth reached during the crawl"""
15+
16+
num_failed: int = FieldInfo(alias="numFailed")
17+
"""Number of pages that failed to crawl"""
18+
19+
num_succeeded: int = FieldInfo(alias="numSucceeded")
20+
"""Number of pages successfully crawled"""
21+
22+
num_urls: int = FieldInfo(alias="numUrls")
23+
"""Total number of URLs crawled"""
24+
25+
26+
class ResultMetadata(BaseModel):
27+
crawl_depth: int = FieldInfo(alias="crawlDepth")
28+
"""Depth relative to the start URL. 0 = start URL, 1 = one link away."""
29+
30+
status_code: int = FieldInfo(alias="statusCode")
31+
"""HTTP status code of the response"""
32+
33+
success: bool
34+
"""true if the page was fetched and parsed successfully"""
35+
36+
title: str
37+
"""The page's <title> content (empty string if unavailable)"""
38+
39+
url: str
40+
"""The URL that was fetched"""
41+
42+
43+
class Result(BaseModel):
44+
markdown: str
45+
"""Extracted page content as Markdown (empty string on failure)"""
46+
47+
metadata: ResultMetadata
48+
49+
50+
class WebWebCrawlMdResponse(BaseModel):
51+
metadata: Metadata
52+
53+
results: List[Result]

0 commit comments

Comments
 (0)