Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
".": "2.3.3-rc1"
".": "2.4.0-rc1"
}
2 changes: 1 addition & 1 deletion .stats.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
configured_endpoints: 33
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/writerai%2Fwriter-ea6ec4b34f6b7fdecc564f59b2e31482eee05830bf8dc1f389461b158de1548e.yml
openapi_spec_hash: ea89c1faed473908be2740efe6da255f
config_hash: 886645f89dc98f04b8931eaf02854e5f
config_hash: 247c2ce23a36ef7446d356308329c87b
31 changes: 31 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,36 @@
# Changelog

## 2.4.0-rc1 (2026-01-12)

Full Changelog: [v2.3.3-rc1...v2.4.0-rc1](https://github.com/writer/writer-python/compare/v2.3.3-rc1...v2.4.0-rc1)

### Features

* **api:** manual updates ([26cd543](https://github.com/writer/writer-python/commit/26cd543764608a8d44ac5415a89ea98953672e08))
* **api:** manual updates ([f95b625](https://github.com/writer/writer-python/commit/f95b6253dbc413b744cc5943c383b2ecbc0ccd44))


### Bug Fixes

* **types:** allow pyright to infer TypedDict types within SequenceNotStr ([d1f6535](https://github.com/writer/writer-python/commit/d1f6535dcef1167e31b53c4e0c030e9f7459821b))
* use async_to_httpx_files in patch method ([a6fbc3c](https://github.com/writer/writer-python/commit/a6fbc3c52c4afe6ce8ce234ac5c9d8464bae2463))


### Chores

* add missing docstrings ([a3c938c](https://github.com/writer/writer-python/commit/a3c938c5ad76f43870d9f48145d5a10a7757bcd1))
* **docs:** use environment variables for authentication in code snippets ([534af15](https://github.com/writer/writer-python/commit/534af15961290aaae496780d712eaffa82d569e8))
* **internal:** add `--fix` argument to lint script ([4b3b067](https://github.com/writer/writer-python/commit/4b3b06799d69c1bf79a1cc92b3d4083a1f0317bc))
* **internal:** add missing files argument to base client ([9672ca2](https://github.com/writer/writer-python/commit/9672ca2a93a1f8b2545da624a88109e9d7f7bcc3))
* **internal:** codegen related update ([ddab89d](https://github.com/writer/writer-python/commit/ddab89ddfaf2901c80213110584ed6509001c96b))
* speedup initial import ([4ae973c](https://github.com/writer/writer-python/commit/4ae973c1bd3100e4a071f18f0d46ab22684eb9ef))
* update lockfile ([abd7b3d](https://github.com/writer/writer-python/commit/abd7b3dd4ab2ab0f64359a806fd8aafc16f476dc))


### Documentation

* prominently feature MCP server setup in root SDK readmes ([8ed50d2](https://github.com/writer/writer-python/commit/8ed50d2ee1c708254dc4d8c34fc563eed7b946dd))

## 2.3.3-rc1 (2025-12-01)

Full Changelog: [v2.3.2...v2.3.3-rc1](https://github.com/writer/writer-python/compare/v2.3.2...v2.3.3-rc1)
Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@
same "printed page" as the copyright notice for easier
identification within third-party archives.

Copyright 2025 Writer
Copyright 2026 Writer

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
18 changes: 14 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,15 @@ of Writer into your projects.

It is generated with [Stainless](https://www.stainless.com/).

## MCP Server

Use the Writer MCP Server to enable AI assistants to interact with this API, allowing them to explore endpoints, make test requests, and use documentation to help integrate this SDK into your application.

[![Add to Cursor](https://cursor.com/deeplink/mcp-install-dark.svg)](https://cursor.com/en-US/install-mcp?name=writer-sdk-mcp&config=eyJjb21tYW5kIjoibnB4IiwiYXJncyI6WyIteSIsIndyaXRlci1zZGstbWNwIl19)
[![Install in VS Code](https://img.shields.io/badge/_-Add_to_VS_Code-blue?style=for-the-badge&logo=data:image/svg%2bxml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGZpbGw9Im5vbmUiIHZpZXdCb3g9IjAgMCA0MCA0MCI+PHBhdGggZmlsbD0iI0VFRSIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNMzAuMjM1IDM5Ljg4NGEyLjQ5MSAyLjQ5MSAwIDAgMS0xLjc4MS0uNzNMMTIuNyAyNC43OGwtMy40NiAyLjYyNC0zLjQwNiAyLjU4MmExLjY2NSAxLjY2NSAwIDAgMS0xLjA4Mi4zMzggMS42NjQgMS42NjQgMCAwIDEtMS4wNDYtLjQzMWwtMi4yLTJhMS42NjYgMS42NjYgMCAwIDEgMC0yLjQ2M0w3LjQ1OCAyMCA0LjY3IDE3LjQ1MyAxLjUwNyAxNC41N2ExLjY2NSAxLjY2NSAwIDAgMSAwLTIuNDYzbDIuMi0yYTEuNjY1IDEuNjY1IDAgMCAxIDIuMTMtLjA5N2w2Ljg2MyA1LjIwOUwyOC40NTIuODQ0YTIuNDg4IDIuNDg4IDAgMCAxIDEuODQxLS43MjljLjM1MS4wMDkuNjk5LjA5MSAxLjAxOS4yNDVsOC4yMzYgMy45NjFhMi41IDIuNSAwIDAgMSAxLjQxNSAyLjI1M3YuMDk5LS4wNDVWMzMuMzd2LS4wNDUuMDk1YTIuNTAxIDIuNTAxIDAgMCAxLTEuNDE2IDIuMjU3bC04LjIzNSAzLjk2MWEyLjQ5MiAyLjQ5MiAwIDAgMS0xLjA3Ny4yNDZabS43MTYtMjguOTQ3LTExLjk0OCA5LjA2MiAxMS45NTIgOS4wNjUtLjAwNC0xOC4xMjdaIi8+PC9zdmc+)](https://vscode.stainless.com/mcp/%7B%22name%22%3A%22writer-sdk-mcp%22%2C%22command%22%3A%22npx%22%2C%22args%22%3A%5B%22-y%22%2C%22writer-sdk-mcp%22%5D%7D)

> Note: You may need to set environment variables in your MCP client.

## Documentation

The REST API documentation can be found on [dev.writer.com](https://dev.writer.com/api-guides/introduction). The full API of this library can be found in [api.md](api.md).
Expand Down Expand Up @@ -122,14 +131,15 @@ pip install --pre writer-sdk[aiohttp]
Then you can enable it by instantiating the client with `http_client=DefaultAioHttpClient()`:

```python
import os
import asyncio
from writerai import DefaultAioHttpClient
from writerai import AsyncWriter


async def main() -> None:
async with AsyncWriter(
api_key="My API Key",
api_key=os.environ.get("WRITER_API_KEY"), # This is the default and can be omitted
http_client=DefaultAioHttpClient(),
) as client:
chat_completion = await client.chat.chat(
Expand Down Expand Up @@ -373,9 +383,9 @@ Error codes are as follows:

### Retries

The library automatically retries certain errors two times by default, with a short exponential backoff.
Connection errors (for example, due to a network connectivity problem), `408 Request Timeout`, `409 Conflict`,
`429 Rate Limit`, and `>=500 Internal errors` are all retried by default.
Certain errors are automatically retried 7 times by default, with a short exponential backoff.
Connection errors (for example, due to a network connectivity problem), 408 Request Timeout, 409 Conflict,
429 Rate Limit, and >=500 Internal errors are all retried by default.

You can use the `max_retries` option to configure or disable retry settings:

Expand Down
16 changes: 9 additions & 7 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,22 +1,24 @@
[project]
name = "writer-sdk"
version = "2.3.3-rc1"
version = "2.4.0-rc1"
description = "The official Python library for the writer API"
dynamic = ["readme"]
license = "Apache-2.0"
authors = [
{ name = "Writer", email = "dev-feedback@writer.com" },
]

dependencies = [
"httpx>=0.23.0, <1",
"pydantic>=1.9.0, <3",
"typing-extensions>=4.10, <5",
"anyio>=3.5.0, <5",
"distro>=1.7.0, <2",
"sniffio",
"httpx>=0.23.0, <1",
"pydantic>=1.9.0, <3",
"typing-extensions>=4.10, <5",
"anyio>=3.5.0, <5",
"distro>=1.7.0, <2",
"sniffio",
"cached-property; python_version < '3.8'",
"jiter>=0.4.0, <1",
]

requires-python = ">= 3.9"
classifiers = [
"Typing :: Typed",
Expand Down
113 changes: 59 additions & 54 deletions requirements-dev.lock
Original file line number Diff line number Diff line change
Expand Up @@ -12,44 +12,47 @@
-e file:.
aiohappyeyeballs==2.6.1
# via aiohttp
aiohttp==3.12.8
aiohttp==3.13.2
# via httpx-aiohttp
# via writer-sdk
aiosignal==1.3.2
aiosignal==1.4.0
# via aiohttp
annotated-types==0.6.0
annotated-types==0.7.0
# via pydantic
anyio==4.4.0
anyio==4.12.0
# via httpx
# via writer-sdk
argcomplete==3.1.2
argcomplete==3.6.3
# via nox
asttokens==3.0.0
# via inline-snapshot
async-timeout==5.0.1
# via aiohttp
attrs==25.3.0
attrs==25.4.0
# via aiohttp
certifi==2023.7.22
# via nox
backports-asyncio-runner==1.2.0
# via pytest-asyncio
certifi==2025.11.12
# via httpcore
# via httpx
colorlog==6.7.0
colorlog==6.10.1
# via nox
dirty-equals==0.6.0
distlib==0.3.7
dependency-groups==1.3.1
# via nox
dirty-equals==0.11
distlib==0.4.0
# via virtualenv
distro==1.8.0
distro==1.9.0
# via writer-sdk
exceptiongroup==1.2.2
exceptiongroup==1.3.1
# via anyio
# via pytest
execnet==2.1.1
execnet==2.1.2
# via pytest-xdist
executing==2.2.0
# via inline-snapshot
filelock==3.12.4
filelock==3.19.1
# via virtualenv
frozenlist==1.6.2
frozenlist==1.8.0
# via aiohttp
# via aiosignal
h11==0.16.0
Expand All @@ -62,12 +65,14 @@ httpx==0.28.1
# via writer-sdk
httpx-aiohttp==0.1.9
# via writer-sdk
idna==3.4
humanize==4.13.0
# via nox
idna==3.11
# via anyio
# via httpx
# via yarl
importlib-metadata==7.0.0
iniconfig==2.0.0
importlib-metadata==8.7.0
iniconfig==2.1.0
# via pytest
inline-snapshot==0.20.5
jiter==0.8.2
Expand All @@ -76,74 +81,74 @@ markdown-it-py==3.0.0
# via rich
mdurl==0.1.2
# via markdown-it-py
multidict==6.4.4
multidict==6.7.0
# via aiohttp
# via yarl
mypy==1.17.0
mypy-extensions==1.0.0
mypy-extensions==1.1.0
# via mypy
nest-asyncio==1.6.0
nodeenv==1.8.0
nodeenv==1.9.1
# via pyright
nox==2023.4.22
packaging==23.2
nox==2025.11.12
packaging==25.0
# via dependency-groups
# via nox
# via pytest
pathspec==0.12.1
# via mypy
platformdirs==3.11.0
platformdirs==4.4.0
# via virtualenv
pluggy==1.5.0
pluggy==1.6.0
# via pytest
propcache==0.3.1
propcache==0.4.1
# via aiohttp
# via yarl
pydantic==2.11.9
pydantic==2.12.5
# via writer-sdk
pydantic-core==2.33.2
pydantic-core==2.41.5
# via pydantic
pygments==2.18.0
pygments==2.19.2
# via pytest
# via rich
pyright==1.1.399
pytest==8.3.3
pytest==8.4.2
# via pytest-asyncio
# via pytest-xdist
pytest-asyncio==0.24.0
pytest-xdist==3.7.0
python-dateutil==2.8.2
pytest-asyncio==1.2.0
pytest-xdist==3.8.0
python-dateutil==2.9.0.post0
# via time-machine
pytz==2023.3.post1
# via dirty-equals
respx==0.22.0
rich==13.7.1
# via inline-snapshot
ruff==0.9.4
setuptools==68.2.2
# via nodeenv
six==1.16.0
rich==14.2.0
ruff==0.14.7
six==1.17.0
# via python-dateutil
sniffio==1.3.0
# via anyio
sniffio==1.3.1
# via writer-sdk
time-machine==2.9.0
tomli==2.0.2
# via inline-snapshot
time-machine==2.19.0
tomli==2.3.0
# via dependency-groups
# via mypy
# via nox
# via pytest
typing-extensions==4.12.2
typing-extensions==4.15.0
# via aiosignal
# via anyio
# via exceptiongroup
# via multidict
# via mypy
# via pydantic
# via pydantic-core
# via pyright
# via pytest-asyncio
# via typing-inspection
# via virtualenv
# via writer-sdk
typing-inspection==0.4.1
typing-inspection==0.4.2
# via pydantic
virtualenv==20.24.5
virtualenv==20.35.4
# via nox
yarl==1.20.0
yarl==1.22.0
# via aiohttp
zipp==3.17.0
zipp==3.23.0
# via importlib-metadata
Loading