Skip to content

Commit 27bc1c3

Browse files
committed
update: bump to 2.0.0b3 with latest changes
1 parent 607b5db commit 27bc1c3

File tree

4 files changed

+24
-15
lines changed

4 files changed

+24
-15
lines changed

README.md

Lines changed: 18 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ poetry add webflow
2727
Simply import `Webflow` and start making calls to our API.
2828

2929
```python
30-
from webflow.client import Webflow
30+
from webflow import Webflow
3131

3232
client = Webflow(
3333
access_token="YOUR_ACCESS_TOKEN"
@@ -40,7 +40,8 @@ The SDK also exports an async client so that you can make non-blocking
4040
calls to our API.
4141

4242
```python
43-
from webflow.client import AsyncWebflow
43+
import asyncio
44+
from webflow import AsyncWebflow
4445

4546
client = AsyncWebflow(
4647
access_token="YOUR_ACCESS_TOKEN"
@@ -95,7 +96,7 @@ access_token = get_access_token(
9596
Instantiate the client using your `access_token`.
9697

9798
```python
98-
from webflow.client import Webflow
99+
from webflow import Webflow
99100

100101
client = Webflow(
101102
access_token=access_token
@@ -112,14 +113,17 @@ guide you!
112113
All errors thrown by the SDK will be subclasses of [`ApiError`](./src/webflow/core/api_error.py).
113114

114115
```python
115-
import webflow
116+
from webflow import Webflow, BadRequestError
117+
from webflow.core.api_error import ApiError
118+
119+
client = Webflow(access_token="YOUR_ACCESS_TOKEN")
116120

117121
try:
118-
client.sites.get(...)
119-
except webflow.core.ApiError as e: # Handle all errors
122+
client.sites.get("site-id")
123+
except BadRequestError as e: # Handle specific error
120124
print(e.status_code)
121125
print(e.body)
122-
except webflow.BadRequestError as e: # Handle specific error
126+
except ApiError as e: # Handle all API errors
123127
print(e.status_code)
124128
print(e.body)
125129
```
@@ -131,25 +135,25 @@ By default, requests time out after 60 seconds. You can configure this with a
131135
timeout option, which accepts a float.
132136

133137
```python
134-
from webflow.client import Webflow
138+
from webflow import Webflow
135139

136140
client = Webflow(
137-
# 20 seconds
138-
timeout=20.0,
141+
access_token="YOUR_ACCESS_TOKEN",
142+
timeout=20.0, # 20 seconds
139143
)
140144
```
141145

142146
### Custom HTTP client
143147
You can override the httpx client to customize it for your use-case. Some common use-cases
144-
include support for proxies and transports.
148+
include support for proxies, transports, or custom base URLs.
145149

146150
```python
147151
import httpx
148-
149-
from webflow.client import Webflow
152+
from webflow import Webflow
150153

151154
client = Webflow(
152-
http_client=httpx.Client(
155+
access_token="YOUR_ACCESS_TOKEN",
156+
httpx_client=httpx.Client(
153157
proxies="http://my.test.proxy.example.com",
154158
transport=httpx.HTTPTransport(local_address="0.0.0.0"),
155159
),

pyproject.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "webflow"
3-
version = "1.2.1"
3+
version = "2.0.0b3"
44
description = ""
55
readme = "README.md"
66
authors = []
@@ -33,6 +33,7 @@ Repository = 'https://github.com/webflow/webflow-python'
3333
[tool.poetry.dependencies]
3434
python = "^3.8"
3535
httpx = ">=0.21.2"
36+
httpcore = ">=1.0.9"
3637
pydantic = ">= 1.9.2"
3738
pydantic-core = "^2.18.2"
3839
typing_extensions = ">= 4.0.0"

src/webflow/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -277,6 +277,7 @@
277277
WorkspaceMembership,
278278
WorkspaceMembershipAuditLogItem,
279279
WorkspaceMembershipAuditLogItemEventSubType,
280+
OauthScope,
280281
)
281282
from .errors import (
282283
BadRequestError,
@@ -473,6 +474,7 @@
473474
"NotEnterprisePlanSite",
474475
"NotEnterprisePlanWorkspace",
475476
"NotFoundError",
477+
"OauthScope",
476478
"OptionField",
477479
"Order",
478480
"OrderAddress",

src/webflow/types/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -304,6 +304,7 @@
304304
from .workspace_membership import WorkspaceMembership
305305
from .workspace_membership_audit_log_item import WorkspaceMembershipAuditLogItem
306306
from .workspace_membership_audit_log_item_event_sub_type import WorkspaceMembershipAuditLogItemEventSubType
307+
from .oauth_scope import OauthScope
307308

308309
__all__ = [
309310
"AccessGroup",
@@ -429,6 +430,7 @@
429430
"Node_TextInput",
430431
"NotEnterprisePlanSite",
431432
"NotEnterprisePlanWorkspace",
433+
"OauthScope",
432434
"OptionField",
433435
"Order",
434436
"OrderAddress",

0 commit comments

Comments
 (0)