Skip to content

Commit d191105

Browse files
authored
Merge pull request #53 from context-dot-dev/release-please--branches--main--changes--next
release: 2.7.0
2 parents 0f2943f + df3bf8e commit d191105

21 files changed

Lines changed: 319 additions & 244 deletions

‎.release-please-manifest.json‎

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

‎.stats.yml‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 37
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/context-dev/context.dev-960cb623c7ec84bf4dc0f5945cbc19eec9cca48271071f400d96066eaa55dbd6.yml
3-
openapi_spec_hash: 84fd39e3f4dc964bf0c32d4e95da1b34
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/context-dev/context.dev-758c3a2fbd5b7be61c8e6e0ad2e6a5ec30695747bb675960d888c497647d13d7.yml
3+
openapi_spec_hash: 00002d90bde02f67e174368ae470c597
44
config_hash: 2bea1743c84d63bd61f8501a6ea63065

‎CHANGELOG.md‎

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

3+
## 2.7.0 (2026-08-01)
4+
5+
Full Changelog: [v2.6.0...v2.7.0](https://github.com/context-dot-dev/context-python-sdk/compare/v2.6.0...v2.7.0)
6+
7+
### Features
8+
9+
* **api:** api update ([da261be](https://github.com/context-dot-dev/context-python-sdk/commit/da261be4676883e2a8e85ca0b4b7be887a24e85b))
10+
* **api:** api update ([3688eab](https://github.com/context-dot-dev/context-python-sdk/commit/3688eab17dcc2546c3e9c7249d15be912354012c))
11+
* **api:** api update ([63b8964](https://github.com/context-dot-dev/context-python-sdk/commit/63b89645bfe4a82faeee952478ff7fe8f33e1c59))
12+
313
## 2.6.0 (2026-07-31)
414

515
Full Changelog: [v2.5.0...v2.6.0](https://github.com/context-dot-dev/context-python-sdk/compare/v2.5.0...v2.6.0)

‎api.md‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -140,8 +140,10 @@ Types:
140140

141141
```python
142142
from context.dev.types import (
143-
ErrorCount,
144-
Error,
143+
PageErrorCount,
144+
Failure,
145+
CrawlControls,
146+
Intake,
145147
BatchRetrieveResponse,
146148
BatchListResponse,
147149
BatchCancelResponse,

‎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 = "2.6.0"
3+
version = "2.7.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__ = "2.6.0" # x-release-please-version
4+
__version__ = "2.7.0" # x-release-please-version

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

Lines changed: 8 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -58,11 +58,8 @@ def retrieve(
5858
extra_body: Body | None = None,
5959
timeout: float | httpx.Timeout | None | NotGiven = not_given,
6060
) -> BatchRetrieveResponse:
61-
"""Check progress and get download links when the batch finishes.
62-
63-
Also returns the
64-
rejected-URL list and webhook signing secret from submission, so nothing is lost
65-
if the submit response was dropped.
61+
"""
62+
Check progress, and get download links once the batch finishes.
6663
6764
Args:
6865
batch_id: ID of the batch to retrieve or cancel.
@@ -202,9 +199,8 @@ def get_results(
202199
timeout: float | httpx.Timeout | None | NotGiven = not_given,
203200
) -> BatchGetResultsResponse:
204201
"""
205-
Page through the result records of a finished batch as JSON, in the same order
206-
as the downloadable result files. Use this instead of downloading and parsing
207-
the NDJSON files yourself.
202+
Page through a finished batch's results as JSON instead of downloading the
203+
NDJSON files.
208204
209205
Args:
210206
batch_id: ID of the batch to retrieve or cancel.
@@ -323,11 +319,8 @@ async def retrieve(
323319
extra_body: Body | None = None,
324320
timeout: float | httpx.Timeout | None | NotGiven = not_given,
325321
) -> BatchRetrieveResponse:
326-
"""Check progress and get download links when the batch finishes.
327-
328-
Also returns the
329-
rejected-URL list and webhook signing secret from submission, so nothing is lost
330-
if the submit response was dropped.
322+
"""
323+
Check progress, and get download links once the batch finishes.
331324
332325
Args:
333326
batch_id: ID of the batch to retrieve or cancel.
@@ -467,9 +460,8 @@ async def get_results(
467460
timeout: float | httpx.Timeout | None | NotGiven = not_given,
468461
) -> BatchGetResultsResponse:
469462
"""
470-
Page through the result records of a finished batch as JSON, in the same order
471-
as the downloadable result files. Use this instead of downloading and parsing
472-
the NDJSON files yourself.
463+
Page through a finished batch's results as JSON instead of downloading the
464+
NDJSON files.
473465
474466
Args:
475467
batch_id: ID of the batch to retrieve or cancel.

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

Lines changed: 16 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -620,9 +620,8 @@ def screenshot(
620620
color_scheme: Optional parameter to choose the site's visual theme in the screenshot. Use
621621
'light' or 'dark' when the site offers both appearances.
622622
623-
country: Two-letter ISO 3166-1 alpha-2 country code identifying a supported Context.dev
624-
residential proxy exit location. Must be one of Context.dev's supported
625-
countries. When provided, Context.dev fetches the target page from that country.
623+
country: Fetch the target page through a residential proxy in this country (ISO 3166-1
624+
alpha-2).
626625
627626
direct_url: A specific URL to screenshot directly, bypassing domain resolution (e.g.,
628627
'https://example.com/pricing'). When provided, the screenshot is taken of this
@@ -1280,9 +1279,8 @@ def web_crawl_md(
12801279
Args:
12811280
url: The starting URL for the crawl (must include http:// or https:// protocol)
12821281
1283-
country: Two-letter ISO 3166-1 alpha-2 country code identifying a supported Context.dev
1284-
residential proxy exit location. Must be one of Context.dev's supported
1285-
countries. When provided, Context.dev fetches the target page from that country.
1282+
country: Fetch the target page through a residential proxy in this country (ISO 3166-1
1283+
alpha-2).
12861284
12871285
exclude_selectors: CSS selectors to remove before each crawled page is converted to Markdown.
12881286
Applied after includeSelectors. Exclusion takes precedence: an element matching
@@ -1630,9 +1628,8 @@ def web_scrape_html(
16301628
content is captured. Requires a paid plan. Send a JSON array in the query
16311629
parameter. Maximum: 5 actions.
16321630
1633-
country: Two-letter ISO 3166-1 alpha-2 country code identifying a supported Context.dev
1634-
residential proxy exit location. Must be one of Context.dev's supported
1635-
countries. When provided, Context.dev fetches the target page from that country.
1631+
country: Fetch the target page through a residential proxy in this country (ISO 3166-1
1632+
alpha-2).
16361633
16371634
exclude_selectors: CSS selectors to remove from the result. Applied after includeSelectors.
16381635
Exclusion takes precedence: an element matching both is removed. Examples:
@@ -2071,9 +2068,8 @@ def web_scrape_md(
20712068
content is captured. Requires a paid plan. Send a JSON array in the query
20722069
parameter. Maximum: 5 actions.
20732070
2074-
country: Two-letter ISO 3166-1 alpha-2 country code identifying a supported Context.dev
2075-
residential proxy exit location. Must be one of Context.dev's supported
2076-
countries. When provided, Context.dev fetches the target page from that country.
2071+
country: Fetch the target page through a residential proxy in this country (ISO 3166-1
2072+
alpha-2).
20772073
20782074
exclude_selectors: CSS selectors to remove before conversion to Markdown. Applied after
20792075
includeSelectors. Exclusion takes precedence: an element matching both is
@@ -2824,9 +2820,8 @@ async def screenshot(
28242820
color_scheme: Optional parameter to choose the site's visual theme in the screenshot. Use
28252821
'light' or 'dark' when the site offers both appearances.
28262822
2827-
country: Two-letter ISO 3166-1 alpha-2 country code identifying a supported Context.dev
2828-
residential proxy exit location. Must be one of Context.dev's supported
2829-
countries. When provided, Context.dev fetches the target page from that country.
2823+
country: Fetch the target page through a residential proxy in this country (ISO 3166-1
2824+
alpha-2).
28302825
28312826
direct_url: A specific URL to screenshot directly, bypassing domain resolution (e.g.,
28322827
'https://example.com/pricing'). When provided, the screenshot is taken of this
@@ -3484,9 +3479,8 @@ async def web_crawl_md(
34843479
Args:
34853480
url: The starting URL for the crawl (must include http:// or https:// protocol)
34863481
3487-
country: Two-letter ISO 3166-1 alpha-2 country code identifying a supported Context.dev
3488-
residential proxy exit location. Must be one of Context.dev's supported
3489-
countries. When provided, Context.dev fetches the target page from that country.
3482+
country: Fetch the target page through a residential proxy in this country (ISO 3166-1
3483+
alpha-2).
34903484
34913485
exclude_selectors: CSS selectors to remove before each crawled page is converted to Markdown.
34923486
Applied after includeSelectors. Exclusion takes precedence: an element matching
@@ -3834,9 +3828,8 @@ async def web_scrape_html(
38343828
content is captured. Requires a paid plan. Send a JSON array in the query
38353829
parameter. Maximum: 5 actions.
38363830
3837-
country: Two-letter ISO 3166-1 alpha-2 country code identifying a supported Context.dev
3838-
residential proxy exit location. Must be one of Context.dev's supported
3839-
countries. When provided, Context.dev fetches the target page from that country.
3831+
country: Fetch the target page through a residential proxy in this country (ISO 3166-1
3832+
alpha-2).
38403833
38413834
exclude_selectors: CSS selectors to remove from the result. Applied after includeSelectors.
38423835
Exclusion takes precedence: an element matching both is removed. Examples:
@@ -4275,9 +4268,8 @@ async def web_scrape_md(
42754268
content is captured. Requires a paid plan. Send a JSON array in the query
42764269
parameter. Maximum: 5 actions.
42774270
4278-
country: Two-letter ISO 3166-1 alpha-2 country code identifying a supported Context.dev
4279-
residential proxy exit location. Must be one of Context.dev's supported
4280-
countries. When provided, Context.dev fetches the target page from that country.
4271+
country: Fetch the target page through a residential proxy in this country (ISO 3166-1
4272+
alpha-2).
42814273
42824274
exclude_selectors: CSS selectors to remove before conversion to Markdown. Applied after
42834275
includeSelectors. Exclusion takes precedence: an element matching both is

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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,10 @@
22

33
from __future__ import annotations
44

5-
from .error import Error as Error
6-
from .error_count import ErrorCount as ErrorCount
5+
from .intake import Intake as Intake
6+
from .failure import Failure as Failure
7+
from .crawl_controls import CrawlControls as CrawlControls
8+
from .page_error_count import PageErrorCount as PageErrorCount
79
from .webhook_delivery import WebhookDelivery as WebhookDelivery
810
from .batch_list_params import BatchListParams as BatchListParams
911
from .web_search_params import WebSearchParams as WebSearchParams

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

Lines changed: 37 additions & 79 deletions
Original file line numberDiff line numberDiff line change
@@ -3,89 +3,46 @@
33
from typing import List, Optional
44
from typing_extensions import Literal
55

6-
from .error import Error
6+
from .intake import Intake
77
from .._models import BaseModel
8-
from .error_count import ErrorCount
8+
from .crawl_controls import CrawlControls
9+
from .page_error_count import PageErrorCount
910

10-
__all__ = ["BatchCancelResponse", "Credits", "Input", "Progress", "Results", "ResultsFile", "Timing", "KeyMetadata"]
11+
__all__ = ["BatchCancelResponse", "Credits", "Progress", "Timing", "KeyMetadata"]
1112

1213

1314
class Credits(BaseModel):
14-
"""Reserved and used credits."""
15+
"""What this batch cost so far."""
1516

16-
charged: int
17-
"""Credits used by successful pages."""
17+
reserved: int
18+
"""Credits debited at submission.
1819
19-
estimated: int
20-
"""Credits reserved when the batch was accepted."""
21-
22-
23-
class Input(BaseModel):
24-
"""Submission counts."""
25-
26-
accepted: int
27-
"""Pages accepted, or the crawl page limit. Credits are reserved for this count."""
28-
29-
duplicates: int
30-
"""Duplicate URL and `itemId` pairs skipped. Always 0 for crawls."""
31-
32-
invalid: int
33-
"""Pages rejected during validation."""
34-
35-
submitted: int
36-
"""Pages submitted before validation. For a crawl, the page limit."""
20+
The unspent remainder is refunded once the batch settles — read
21+
`credits.refunded` from GET /batch/{batch_id} then.
22+
"""
3723

3824

3925
class Progress(BaseModel):
40-
"""Current processing counts. Use `status` to check completion."""
26+
"""How far the batch got before cancellation."""
4127

4228
failed: int
43-
"""Pages that could not be scraped."""
29+
"""Pages that could not be scraped before the request landed."""
4430

4531
pending: int
46-
"""Accepted pages not yet attempted.
47-
48-
Always 0 once the batch completes; a crawl can finish under its page limit when
49-
the site has no more reachable pages.
50-
"""
32+
"""Reserved pages that will now be skipped, and refunded when the batch settles."""
5133

5234
succeeded: int
53-
"""Pages scraped successfully."""
54-
55-
56-
class ResultsFile(BaseModel):
57-
bytes: int
58-
"""Compressed file size in bytes."""
59-
60-
items: int
61-
"""Results in this file."""
62-
63-
url: str
64-
"""Temporary URL for a gzipped NDJSON file."""
65-
66-
67-
class Results(BaseModel):
68-
"""Download links available when the batch finishes.
69-
70-
GET /batch/{batch_id}/results serves the same records as paginated JSON.
71-
"""
72-
73-
expires_at: str
74-
"""When the download URLs expire."""
75-
76-
files: List[ResultsFile]
77-
"""Result files. Order is not guaranteed."""
35+
"""Pages scraped successfully before the request landed."""
7836

7937

8038
class Timing(BaseModel):
81-
completed_at: Optional[str] = None
82-
"""When processing finished. Null while active."""
39+
"""There is no finish time yet — the batch is still winding down."""
8340

8441
created_at: str
8542
"""When the batch was created."""
8643

8744
started_at: Optional[str] = None
88-
"""When processing started. Null while queued."""
45+
"""When processing started. Null if it was cancelled while still queued."""
8946

9047

9148
class KeyMetadata(BaseModel):
@@ -100,42 +57,43 @@ class KeyMetadata(BaseModel):
10057

10158
class BatchCancelResponse(BaseModel):
10259
id: str
103-
"""Batch ID used to retrieve or cancel the job."""
60+
"""Batch ID."""
10461

105-
credits: Credits
106-
"""Reserved and used credits."""
62+
crawl: Optional[CrawlControls] = None
63+
"""
64+
The crawl controls as submitted, so the limits requested can be compared against
65+
what the crawl reached.
66+
"""
10767

108-
error: Optional[Error] = None
109-
"""Why the batch failed."""
68+
credits: Credits
69+
"""What this batch cost so far."""
11070

111-
errors: List[ErrorCount]
112-
"""Page failures grouped by error code."""
71+
format: Literal["markdown", "html"]
72+
"""What each page is returned as."""
11373

114-
input: Input
115-
"""Submission counts."""
74+
input: Intake
75+
"""What submission took in, and what it charged for."""
11676

11777
mode: Literal["scrape", "crawl"]
118-
"""How pages are selected."""
78+
"""How pages were selected."""
79+
80+
page_errors: List[PageErrorCount]
81+
"""Page failures so far, grouped by error code and sorted by count."""
11982

12083
progress: Progress
121-
"""Current processing counts. Use `status` to check completion."""
84+
"""How far the batch got before cancellation."""
12285

123-
results: Optional[Results] = None
124-
"""Download links available when the batch finishes.
86+
status: Literal["cancelling"]
87+
"""Always `cancelling`.
12588
126-
GET /batch/{batch_id}/results serves the same records as paginated JSON.
89+
Work already in flight finishes; the batch reaches `cancelled` shortly after.
12790
"""
12891

129-
status: Literal["queued", "running", "cancelling", "completed", "cancelled", "failed"]
130-
"""Current state. `completed`, `cancelled`, and `failed` are final."""
131-
13292
tags: List[str]
13393
"""Tags stored on the batch at submission."""
13494

13595
timing: Timing
136-
137-
type: Literal["markdown", "html"]
138-
"""Output format."""
96+
"""There is no finish time yet — the batch is still winding down."""
13997

14098
key_metadata: Optional[KeyMetadata] = None
14199
"""API key usage for this request."""

0 commit comments

Comments
 (0)