Skip to content

Commit a2361b4

Browse files
author
stlc-bot
committed
Build SDK
Stainless-Generated-From: 91b0c0958177127b83d6956c56f28e17748b85fe
1 parent 727751b commit a2361b4

2 files changed

Lines changed: 19 additions & 20 deletions

File tree

‎README.md‎

Lines changed: 18 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
# Context Dev Python API library
1+
# Context.dev Python SDK API library
22

33
<!-- prettier-ignore -->
44
[![PyPI version](https://img.shields.io/pypi/v/context.dev.svg?label=pypi%20(stable))](https://pypi.org/project/context.dev/)
55

6-
The Context Dev Python library provides convenient access to the Context Dev REST API from any Python 3.9+
6+
The Context.dev Python SDK library provides convenient access to the Context Dev REST API from any Python 3.9+
77
application. The library includes type definitions for all request params and response fields,
88
and offers both synchronous and asynchronous clients powered by [httpx](https://github.com/encode/httpx).
99

@@ -32,11 +32,11 @@ client = ContextDev(
3232
api_key=os.environ.get("CONTEXT_DEV_API_KEY"), # This is the default and can be omitted
3333
)
3434

35-
brand = client.brand.retrieve(
36-
domain="REPLACE_ME",
37-
type="by_domain",
35+
page = client.web.scrape(
36+
formats={"markdown": True},
37+
url="https://example.com",
3838
)
39-
print(brand.request_id)
39+
print(page.request_id)
4040
```
4141

4242
While you can provide an `api_key` keyword argument,
@@ -59,11 +59,11 @@ client = AsyncContextDev(
5959

6060

6161
async def main() -> None:
62-
brand = await client.brand.retrieve(
63-
domain="REPLACE_ME",
64-
type="by_domain",
62+
page = await client.web.scrape(
63+
formats={"markdown": True},
64+
url="https://example.com",
6565
)
66-
print(brand.request_id)
66+
print(page.request_id)
6767

6868

6969
asyncio.run(main())
@@ -96,11 +96,11 @@ async def main() -> None:
9696
api_key=os.environ.get("CONTEXT_DEV_API_KEY"), # This is the default and can be omitted
9797
http_client=DefaultAioHttpClient(),
9898
) as client:
99-
brand = await client.brand.retrieve(
100-
domain="REPLACE_ME",
101-
type="by_domain",
99+
page = await client.web.scrape(
100+
formats={"markdown": True},
101+
url="https://example.com",
102102
)
103-
print(brand.request_id)
103+
print(page.request_id)
104104

105105

106106
asyncio.run(main())
@@ -124,12 +124,11 @@ from context.dev import ContextDev
124124

125125
client = ContextDev()
126126

127-
brand = client.brand.retrieve(
128-
domain="xxx",
129-
type="by_domain",
130-
timeout_opts={"milliseconds": 1000},
127+
response = client.web.scrape(
128+
formats={"markdown": True},
129+
url="https://example.com",
131130
)
132-
print(brand.timeout_opts)
131+
print(response.formats)
133132
```
134133

135134
## Handling errors

‎uv.lock‎

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)