You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CHANGELOG.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
# Change Log
2
2
3
-
## 16.0.0rc1
3
+
## 16.0.0
4
4
5
5
* Breaking change: All service methods now return typed Pydantic models instead of `Dict[str, Any]`
6
6
* Breaking change: Models with dynamic fields (e.g., `Row`, `Document`) now store user-defined data in a typed `.data` property instead of direct attribute access
Copy file name to clipboardExpand all lines: README.md
+3-63Lines changed: 3 additions & 63 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -49,16 +49,10 @@ client = Client()
49
49
### Make Your First Request
50
50
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.
51
51
52
-
All service methods return typed Pydantic models, so you can access response fields as attributes:
53
-
54
52
```python
55
53
users = Users(client)
56
54
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
55
+
result = users.create(ID.unique(), email="email@example.com", phone="+123456789", password="password", name="Walter O'Brien")
62
56
```
63
57
64
58
### Full Example
@@ -78,60 +72,7 @@ client = Client()
78
72
79
73
users = Users(client)
80
74
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
85
-
```
86
-
87
-
### Type Safety with Models
88
-
89
-
The Appwrite Python SDK provides type safety when working with database rows through generic methods. Methods like `get_row`, `list_rows`, and others accept a `model_type` parameter that allows you to specify your custom Pydantic model for full type safety.
90
-
91
-
```python
92
-
from pydantic import BaseModel
93
-
from datetime import datetime
94
-
from typing import Optional
95
-
from appwrite.client import Client
96
-
from appwrite.services.tables_db import TablesDB
97
-
98
-
# Define your custom model matching your table schema
99
-
classPost(BaseModel):
100
-
postId: int
101
-
authorId: int
102
-
title: str
103
-
content: str
104
-
createdAt: datetime
105
-
updatedAt: datetime
106
-
isPublished: bool
107
-
excerpt: Optional[str] =None
108
-
109
-
client = Client()
110
-
# ... configure your client ...
111
-
112
-
tables_db = TablesDB(client)
113
-
114
-
# Fetch a single row with type safety
115
-
row = tables_db.get_row(
116
-
database_id="your-database-id",
117
-
table_id="your-table-id",
118
-
row_id="your-row-id",
119
-
model_type=Post # Pass your custom model type
120
-
)
121
-
122
-
print(row.data.title) # Fully typed - IDE autocomplete works
123
-
print(row.data.postId) # int type, not Any
124
-
print(row.data.createdAt) # datetime type
125
-
126
-
# Fetch multiple rows with type safety
127
-
result = tables_db.list_rows(
128
-
database_id="your-database-id",
129
-
table_id="your-table-id",
130
-
model_type=Post
131
-
)
132
-
133
-
for row in result.rows:
134
-
print(f"{row.data.title} by {row.data.authorId}")
75
+
result = users.create(ID.unique(), email="email@example.com", phone="+123456789", password="password", name="Walter O'Brien")
135
76
```
136
77
137
78
### Error Handling
@@ -140,8 +81,7 @@ The Appwrite Python SDK raises `AppwriteException` object with `message`, `code`
140
81
```python
141
82
users = Users(client)
142
83
try:
143
-
user = users.create(ID.unique(), email="email@example.com", phone="+123456789", password="password", name="Walter O'Brien")
144
-
print(user.name)
84
+
result = users.create(ID.unique(), email="email@example.com", phone="+123456789", password="password", name="Walter O'Brien")
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"
Copy file name to clipboardExpand all lines: setup.py
+2-2Lines changed: 2 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -8,7 +8,7 @@
8
8
setuptools.setup(
9
9
name='appwrite',
10
10
packages=setuptools.find_packages(),
11
-
version='16.0.0rc1',
11
+
version='16.0.0',
12
12
license='BSD-3-Clause',
13
13
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',
0 commit comments