Skip to content

Commit b3f0015

Browse files
committed
chore: update Python SDK to 16.0.0
1 parent daebd11 commit b3f0015

5 files changed

Lines changed: 29 additions & 12 deletions

File tree

CHANGELOG.md

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,16 @@
11
# Change Log
22

3-
## 15.3.0
4-
5-
* Added `ActivityEvent` and `ActivityEventList` models to the public API
6-
* Updated README with `uv add appwrite` example
3+
## 16.0.0
4+
5+
* Breaking change: All service methods now return typed Pydantic models instead of `Dict[str, Any]`
6+
* Breaking change: Added `pydantic>=2,<3` as a required dependency
7+
* Breaking change: Minimum Python version raised from 3.5 to 3.9
8+
* Added `AppwriteModel` base class (Pydantic `BaseModel`) for all response models with `from_dict()` and `to_dict()` helpers
9+
* Added 130+ typed model classes under `appwrite/models/` (e.g., `Database`, `Collection`, `Document`, `User`, `Session`, `File`, `Bucket`, etc.)
10+
* Added `ActivityEvent` and `ActivityEventList` models and `Activities` service
11+
* Added `ValueClassEncoder` support for serializing `AppwriteModel` instances
12+
* Added `pyproject.toml` for modern Python packaging
13+
* Updated README with `uv add appwrite` installation example
714

815
## 15.2.0
916

README.md

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,16 @@ client = Client()
4949
### Make Your First Request
5050
Once your SDK object is set, create any of the Appwrite service objects and choose any request to send. Full documentation for any service method you would like to use can be found in your SDK documentation or in the [API References](https://appwrite.io/docs) section.
5151

52+
All service methods return typed Pydantic models, so you can access response fields as attributes:
53+
5254
```python
5355
users = Users(client)
5456

55-
result = users.create(ID.unique(), email = "email@example.com", phone = "+123456789", password = "password", name = "Walter O'Brien")
57+
user = users.create(ID.unique(), email = "email@example.com", phone = "+123456789", password = "password", name = "Walter O'Brien")
58+
59+
print(user.name) # "Walter O'Brien"
60+
print(user.email) # "email@example.com"
61+
print(user.id) # The generated user ID
5662
```
5763

5864
### Full Example
@@ -72,7 +78,10 @@ client = Client()
7278

7379
users = Users(client)
7480

75-
result = users.create(ID.unique(), email = "email@example.com", phone = "+123456789", password = "password", name = "Walter O'Brien")
81+
user = users.create(ID.unique(), email = "email@example.com", phone = "+123456789", password = "password", name = "Walter O'Brien")
82+
83+
print(user.name) # Access fields as attributes
84+
print(user.to_dict()) # Convert to dictionary if needed
7685
```
7786

7887
### Error Handling
@@ -81,7 +90,8 @@ The Appwrite Python SDK raises `AppwriteException` object with `message`, `code`
8190
```python
8291
users = Users(client)
8392
try:
84-
result = users.create(ID.unique(), email = "email@example.com", phone = "+123456789", password = "password", name = "Walter O'Brien")
93+
user = users.create(ID.unique(), email = "email@example.com", phone = "+123456789", password = "password", name = "Walter O'Brien")
94+
print(user.name)
8595
except AppwriteException as e:
8696
print(e.message)
8797
```

appwrite/client.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,11 @@ def __init__(self):
1515
self._endpoint = 'https://cloud.appwrite.io/v1'
1616
self._global_headers = {
1717
'content-type': '',
18-
'user-agent' : f'AppwritePythonSDK/15.3.0 ({platform.uname().system}; {platform.uname().version}; {platform.uname().machine})',
18+
'user-agent' : f'AppwritePythonSDK/16.0.0 ({platform.uname().system}; {platform.uname().version}; {platform.uname().machine})',
1919
'x-sdk-name': 'Python',
2020
'x-sdk-platform': 'server',
2121
'x-sdk-language': 'python',
22-
'x-sdk-version': '15.3.0',
22+
'x-sdk-version': '16.0.0',
2323
'X-Appwrite-Response-Format' : '1.8.0',
2424
}
2525

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
44

55
[project]
66
name = "appwrite"
7-
version = "15.3.0"
7+
version = "16.0.0"
88
description = "Appwrite is an open-source self-hosted backend server that abstracts and simplifies complex and repetitive development tasks behind a very simple REST API"
99
readme = "README.md"
1010
requires-python = ">=3.9"

setup.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
setuptools.setup(
99
name = 'appwrite',
1010
packages = setuptools.find_packages(),
11-
version = '15.3.0',
11+
version = '16.0.0',
1212
license='BSD-3-Clause',
1313
description = 'Appwrite is an open-source self-hosted backend server that abstracts and simplifies complex and repetitive development tasks behind a very simple REST API',
1414
long_description = long_description,
@@ -18,7 +18,7 @@
1818
maintainer = 'Appwrite Team',
1919
maintainer_email = 'team@appwrite.io',
2020
url = 'https://appwrite.io/support',
21-
download_url='https://github.com/appwrite/sdk-for-python/archive/15.3.0.tar.gz',
21+
download_url='https://github.com/appwrite/sdk-for-python/archive/16.0.0.tar.gz',
2222
install_requires=[
2323
'requests',
2424
'pydantic>=2,<3',

0 commit comments

Comments
 (0)