Low maintenance activity. Last release 9 months ago, commits in 0 of the last 26 weeks. Weaker on commit activity and issue handling.
pip install webflowWebflow Python Library
The Webflow Python Library provides convenient access to the Webflow Data API from applications written in Python.
The library includes type definitions for all request and response fields, and offers both synchronous and asynchronous clients powered by httpx.
Documentation
Explore the API reference documentation here.
Installation
Add this dependency to your project's build file:
pip install webflow
# or
poetry add webflow
Usage
Simply import Webflow and start making calls to our API.
from webflow.client import Webflow
client = Webflow(
access_token="YOUR_ACCESS_TOKEN"
)
site = client.sites.get("site-id")
Async Client
The SDK also exports an async client so that you can make non-blocking calls to our API.
from webflow.client import AsyncWebflow
client = AsyncWebflow(
access_token="YOUR_ACCESS_TOKEN"
)
async def main() -> None:
site = await client.sites.get("site-id")
print("Received site", site)
asyncio.run(main())
OAuth
To implement OAuth, you'll need to register a Webflow App in your Workspace
Step 1: Authorize URL
The first step in OAuth is to generate an Authorization URL. Use this URL to fetch your Authorization Code. See the docs for more details.
from webflow.oauth import authorize_url
from webflow import OauthScope
url = authorize_url(
client_id="YOUR_CLIENT_ID",
scope=OauthScope.USERS_READ, # or [OauthScope.USERS_READ, OauthScope.USERS_WRITE]
state="1234567890", # optional
redirect_uri="https://my.server.com/oauth/callback", # optional
)
print(url)
