Skip to content

Commit 12c3797

Browse files
implement realtime feature
1 parent e76dd15 commit 12c3797

File tree

10 files changed

+113
-11
lines changed

10 files changed

+113
-11
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
# Appwrite Python SDK
22

33
![License](https://img.shields.io/github/license/appwrite/sdk-for-python.svg?style=flat-square)
4-
![Version](https://img.shields.io/badge/api%20version-0.9.0-blue.svg?style=flat-square)
4+
![Version](https://img.shields.io/badge/api%20version-0.10.0-blue.svg?style=flat-square)
55
[![Build Status](https://img.shields.io/travis/com/appwrite/sdk-generator?style=flat-square)](https://travis-ci.com/appwrite/sdk-generator)
66
[![Twitter Account](https://img.shields.io/twitter/follow/appwrite_io?color=00acee&label=twitter&style=flat-square)](https://twitter.com/appwrite_io)
77
[![Discord](https://img.shields.io/discord/564160730845151244?label=discord&style=flat-square)](https://appwrite.io/discord)
88

9-
**This SDK is compatible with Appwrite server version 0.9.x. For older versions, please check [previous releases](https://github.com/appwrite/sdk-for-python/releases).**
9+
**This SDK is compatible with Appwrite server version 0.10.x. For older versions, please check [previous releases](https://github.com/appwrite/sdk-for-python/releases).**
1010

1111
Appwrite is an open-source backend as a service server that abstract and simplify complex and repetitive development tasks behind a very simple to use REST API. Appwrite aims to help you develop your apps faster and in a more secure way. Use the Python SDK to integrate your app with the Appwrite server to easily start interacting with all of Appwrite backend APIs and tools. For full API documentation and tutorials go to [https://appwrite.io/docs](https://appwrite.io/docs)
1212

@@ -80,7 +80,7 @@ except AppwriteException as e:
8080
```
8181

8282
### Learn more
83-
You can use following resources to learn more and get help
83+
You can use the following resources to learn more and get help
8484
- 🚀 [Getting Started Tutorial](https://appwrite.io/docs/getting-started-for-server)
8585
- 📜 [Appwrite Docs](https://appwrite.io/docs)
8686
- 💬 [Discord Community](https://appwrite.io/discord)

appwrite/client.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ def __init__(self):
88
self._endpoint = 'https://appwrite.io/v1'
99
self._global_headers = {
1010
'content-type': '',
11-
'x-sdk-version': 'appwrite:python:0.4.0',
12-
'X-Appwrite-Response-Format' : '0.9.0',
11+
'x-sdk-version': 'appwrite:python:0.5.0',
12+
'X-Appwrite-Response-Format' : '0.10.0',
1313
}
1414

1515
def set_self_signed(self, status=True):

appwrite/services/account.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ def create_recovery(self, email, url):
142142
}, params)
143143

144144
def update_recovery(self, user_id, secret, password, password_again):
145-
"""Complete Password Recovery"""
145+
"""Create Password Recovery (confirmation)"""
146146

147147
if user_id is None:
148148
raise AppwriteException('Missing required parameter: "user_id"')
@@ -240,7 +240,7 @@ def create_verification(self, url):
240240
}, params)
241241

242242
def update_verification(self, user_id, secret):
243-
"""Complete Email Verification"""
243+
"""Create Email Verification (confirmation)"""
244244

245245
if user_id is None:
246246
raise AppwriteException('Missing required parameter: "user_id"')

appwrite/services/users.py

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,26 @@ def delete(self, user_id):
8181
'content-type': 'application/json',
8282
}, params)
8383

84+
def update_email(self, user_id, email):
85+
"""Update Email"""
86+
87+
if user_id is None:
88+
raise AppwriteException('Missing required parameter: "user_id"')
89+
90+
if email is None:
91+
raise AppwriteException('Missing required parameter: "email"')
92+
93+
params = {}
94+
path = '/users/{userId}/email'
95+
path = path.replace('{userId}', user_id)
96+
97+
if email is not None:
98+
params['email'] = email
99+
100+
return self.client.call('patch', path, {
101+
'content-type': 'application/json',
102+
}, params)
103+
84104
def get_logs(self, user_id):
85105
"""Get User Logs"""
86106

@@ -95,6 +115,46 @@ def get_logs(self, user_id):
95115
'content-type': 'application/json',
96116
}, params)
97117

118+
def update_name(self, user_id, name):
119+
"""Update Name"""
120+
121+
if user_id is None:
122+
raise AppwriteException('Missing required parameter: "user_id"')
123+
124+
if name is None:
125+
raise AppwriteException('Missing required parameter: "name"')
126+
127+
params = {}
128+
path = '/users/{userId}/name'
129+
path = path.replace('{userId}', user_id)
130+
131+
if name is not None:
132+
params['name'] = name
133+
134+
return self.client.call('patch', path, {
135+
'content-type': 'application/json',
136+
}, params)
137+
138+
def update_password(self, user_id, password):
139+
"""Update Password"""
140+
141+
if user_id is None:
142+
raise AppwriteException('Missing required parameter: "user_id"')
143+
144+
if password is None:
145+
raise AppwriteException('Missing required parameter: "password"')
146+
147+
params = {}
148+
path = '/users/{userId}/password'
149+
path = path.replace('{userId}', user_id)
150+
151+
if password is not None:
152+
params['password'] = password
153+
154+
return self.client.call('patch', path, {
155+
'content-type': 'application/json',
156+
}, params)
157+
98158
def get_prefs(self, user_id):
99159
"""Get User Preferences"""
100160

docs/examples/functions/create.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,4 @@ client = Client()
1111

1212
functions = Functions(client)
1313

14-
result = functions.create('[NAME]', [], 'java-11.0')
14+
result = functions.create('[NAME]', [], 'dotnet-5.0')

docs/examples/users/update-email.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
from appwrite.client import Client
2+
from appwrite.services.users import Users
3+
4+
client = Client()
5+
6+
(client
7+
.set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint
8+
.set_project('5df5acd0d48c2') # Your project ID
9+
.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key
10+
)
11+
12+
users = Users(client)
13+
14+
result = users.update_email('[USER_ID]', '[email protected]')

docs/examples/users/update-name.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
from appwrite.client import Client
2+
from appwrite.services.users import Users
3+
4+
client = Client()
5+
6+
(client
7+
.set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint
8+
.set_project('5df5acd0d48c2') # Your project ID
9+
.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key
10+
)
11+
12+
users = Users(client)
13+
14+
result = users.update_name('[USER_ID]', '[NAME]')
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
from appwrite.client import Client
2+
from appwrite.services.users import Users
3+
4+
client = Client()
5+
6+
(client
7+
.set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint
8+
.set_project('5df5acd0d48c2') # Your project ID
9+
.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key
10+
)
11+
12+
users = Users(client)
13+
14+
result = users.update_password('[USER_ID]', 'password')

requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
requests==2.25.1
1+
requests==2.26.0

setup.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,15 @@
33
setuptools.setup(
44
name = 'appwrite',
55
packages = ['appwrite', 'appwrite/services'],
6-
version = '0.4.0',
6+
version = '0.5.0',
77
license='BSD-3-Clause',
88
description = 'Appwrite is an open-source self-hosted backend server that abstract and simplify complex and repetitive development tasks behind a very simple REST API',
99
author = 'Appwrite Team',
1010
author_email = '[email protected]',
1111
maintainer = 'Appwrite Team',
1212
maintainer_email = '[email protected]',
1313
url = 'https://appwrite.io/support',
14-
download_url='https://github.com/appwrite/sdk-for-python/archive/0.4.0.tar.gz',
14+
download_url='https://github.com/appwrite/sdk-for-python/archive/0.5.0.tar.gz',
1515
# keywords = ['SOME', 'MEANINGFULL', 'KEYWORDS'],
1616
install_requires=[
1717
'requests',

0 commit comments

Comments
 (0)