Skip to content

Commit 64dd2a7

Browse files
committed
Update SDK for Appwrite 0.5.0
1 parent 7c88c73 commit 64dd2a7

File tree

124 files changed

+348
-1590
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

124 files changed

+348
-1590
lines changed

README.md

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

33
![License](https://img.shields.io/github/license/appwrite/sdk-for-python.svg?v=1)
4-
![Version](https://img.shields.io/badge/api%20version-0.4.0-blue.svg?v=1)
4+
![Version](https://img.shields.io/badge/api%20version-0.5.0-blue.svg?v=1)
55

6-
**WORK IN PROGRESS - NOT READY FOR USAGE - Want to help us improve this client SDK? Send a pull request to Appwrite [SDK generator repository](https://github.com/appwrite/sdk-generator).**
6+
**This SDK is compatible with Appwrite server version . For older versions, please check previous releases.**
77

88
Appwrite backend as a service cuts up to 70% of the time and costs required for building a modern application. We abstract and simplify common development tasks behind a REST APIs, to help you develop your app in a fast and secure way. For full API documentation and tutorials go to [https://appwrite.io/docs](https://appwrite.io/docs)
99

appwrite/client.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,13 @@ def add_header(self, key, value):
2323
return self
2424

2525
def set_project(self, value):
26-
"""Your Appwrite project ID"""
26+
"""Your project ID"""
2727

2828
self._global_headers['x-appwrite-project'] = value.lower()
2929
return self
3030

3131
def set_key(self, value):
32-
"""Your Appwrite project secret key"""
32+
"""Your secret API key"""
3333

3434
self._global_headers['x-appwrite-key'] = value.lower()
3535
return self

appwrite/services/account.py

Lines changed: 0 additions & 103 deletions
This file was deleted.

appwrite/services/auth.py

Lines changed: 0 additions & 120 deletions
This file was deleted.

appwrite/services/database.py

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ def list_collections(self, search='', limit=25, offset=0, order_type='ASC'):
1010
"""List Collections"""
1111

1212
params = {}
13-
path = '/database'
13+
path = '/database/collections'
1414
params['search'] = search
1515
params['limit'] = limit
1616
params['offset'] = offset
@@ -24,7 +24,7 @@ def create_collection(self, name, read, write, rules):
2424
"""Create Collection"""
2525

2626
params = {}
27-
path = '/database'
27+
path = '/database/collections'
2828
params['name'] = name
2929
params['read'] = read
3030
params['write'] = write
@@ -38,7 +38,7 @@ def get_collection(self, collection_id):
3838
"""Get Collection"""
3939

4040
params = {}
41-
path = '/database/{collectionId}'
41+
path = '/database/collections/{collectionId}'
4242
path = path.replace('{collectionId}', collection_id)
4343

4444
return self.client.call('get', path, {
@@ -49,7 +49,7 @@ def update_collection(self, collection_id, name, read, write, rules=[]):
4949
"""Update Collection"""
5050

5151
params = {}
52-
path = '/database/{collectionId}'
52+
path = '/database/collections/{collectionId}'
5353
path = path.replace('{collectionId}', collection_id)
5454
params['name'] = name
5555
params['read'] = read
@@ -64,18 +64,18 @@ def delete_collection(self, collection_id):
6464
"""Delete Collection"""
6565

6666
params = {}
67-
path = '/database/{collectionId}'
67+
path = '/database/collections/{collectionId}'
6868
path = path.replace('{collectionId}', collection_id)
6969

7070
return self.client.call('delete', path, {
7171
'content-type': 'application/json',
7272
}, params)
7373

74-
def list_documents(self, collection_id, filters=[], offset=0, limit=50, order_field='$uid', order_type='ASC', order_cast='string', search='', first=0, last=0):
74+
def list_documents(self, collection_id, filters=[], offset=0, limit=50, order_field='$id', order_type='ASC', order_cast='string', search='', first=0, last=0):
7575
"""List Documents"""
7676

7777
params = {}
78-
path = '/database/{collectionId}/documents'
78+
path = '/database/collections/{collectionId}/documents'
7979
path = path.replace('{collectionId}', collection_id)
8080
params['filters'] = filters
8181
params['offset'] = offset
@@ -95,7 +95,7 @@ def create_document(self, collection_id, data, read, write, parent_document='',
9595
"""Create Document"""
9696

9797
params = {}
98-
path = '/database/{collectionId}/documents'
98+
path = '/database/collections/{collectionId}/documents'
9999
path = path.replace('{collectionId}', collection_id)
100100
params['data'] = data
101101
params['read'] = read
@@ -112,7 +112,7 @@ def get_document(self, collection_id, document_id):
112112
"""Get Document"""
113113

114114
params = {}
115-
path = '/database/{collectionId}/documents/{documentId}'
115+
path = '/database/collections/{collectionId}/documents/{documentId}'
116116
path = path.replace('{collectionId}', collection_id)
117117
path = path.replace('{documentId}', document_id)
118118

@@ -124,7 +124,7 @@ def update_document(self, collection_id, document_id, data, read, write):
124124
"""Update Document"""
125125

126126
params = {}
127-
path = '/database/{collectionId}/documents/{documentId}'
127+
path = '/database/collections/{collectionId}/documents/{documentId}'
128128
path = path.replace('{collectionId}', collection_id)
129129
path = path.replace('{documentId}', document_id)
130130
params['data'] = data
@@ -139,7 +139,7 @@ def delete_document(self, collection_id, document_id):
139139
"""Delete Document"""
140140

141141
params = {}
142-
path = '/database/{collectionId}/documents/{documentId}'
142+
path = '/database/collections/{collectionId}/documents/{documentId}'
143143
path = path.replace('{collectionId}', collection_id)
144144
path = path.replace('{documentId}', document_id)
145145

appwrite/services/locale.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ class Locale(Service):
66
def __init__(self, client):
77
super(Locale, self).__init__(client)
88

9-
def get_locale(self):
9+
def get(self):
1010
"""Get User Locale"""
1111

1212
params = {}

0 commit comments

Comments
 (0)