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 README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Appwrite Python SDK

![License](https://img.shields.io/github/license/appwrite/sdk-for-python.svg?style=flat-square)
![Version](https://img.shields.io/badge/api%20version-1.4.2-blue.svg?style=flat-square)
![Version](https://img.shields.io/badge/api%20version-1.4.12-blue.svg?style=flat-square)
[![Build Status](https://img.shields.io/travis/com/appwrite/sdk-generator?style=flat-square)](https://travis-ci.com/appwrite/sdk-generator)
[![Twitter Account](https://img.shields.io/twitter/follow/appwrite?color=00acee&label=twitter&style=flat-square)](https://twitter.com/appwrite)
[![Discord](https://img.shields.io/discord/564160730845151244?label=discord&style=flat-square)](https://appwrite.io/discord)
Expand Down
4 changes: 2 additions & 2 deletions appwrite/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ def __init__(self):
self._endpoint = 'https://HOSTNAME/v1'
self._global_headers = {
'content-type': '',
'user-agent' : 'AppwritePythonSDK/4.0.0 (${os.uname().sysname}; ${os.uname().version}; ${os.uname().machine})',
'user-agent' : 'AppwritePythonSDK/4.1.0 (${os.uname().sysname}; ${os.uname().version}; ${os.uname().machine})',
'x-sdk-name': 'Python',
'x-sdk-platform': 'server',
'x-sdk-language': 'python',
'x-sdk-version': '4.0.0',
'x-sdk-version': '4.1.0',
'X-Appwrite-Response-Format' : '1.4.0',
}

Expand Down
2 changes: 1 addition & 1 deletion appwrite/query.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ def is_not_null(attribute):

@staticmethod
def between(attribute, start, end):
return Query.add_query(attribute, "between", [start, end])
return f'between("{attribute}", {Query.parseValues(start)}, {Query.parseValues(end)})'

@staticmethod
def starts_with(attribute, value):
Expand Down
40 changes: 20 additions & 20 deletions appwrite/services/account.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ def __init__(self, client):
super(Account, self).__init__(client)

def get(self):
"""Get Account"""
"""Get account"""


api_path = '/account'
Expand All @@ -18,7 +18,7 @@ def get(self):
}, api_params)

def update_email(self, email, password):
"""Update Email"""
"""Update email"""


api_path = '/account/email'
Expand Down Expand Up @@ -67,7 +67,7 @@ def delete_identity(self, identity_id):
}, api_params)

def list_logs(self, queries = None):
"""List Logs"""
"""List logs"""


api_path = '/account/logs'
Expand All @@ -80,7 +80,7 @@ def list_logs(self, queries = None):
}, api_params)

def update_name(self, name):
"""Update Name"""
"""Update name"""


api_path = '/account/name'
Expand All @@ -96,7 +96,7 @@ def update_name(self, name):
}, api_params)

def update_password(self, password, old_password = None):
"""Update Password"""
"""Update password"""


api_path = '/account/password'
Expand All @@ -113,7 +113,7 @@ def update_password(self, password, old_password = None):
}, api_params)

def update_phone(self, phone, password):
"""Update Phone"""
"""Update phone"""


api_path = '/account/phone'
Expand All @@ -133,7 +133,7 @@ def update_phone(self, phone, password):
}, api_params)

def get_prefs(self):
"""Get Account Preferences"""
"""Get account preferences"""


api_path = '/account/prefs'
Expand All @@ -144,7 +144,7 @@ def get_prefs(self):
}, api_params)

def update_prefs(self, prefs):
"""Update Preferences"""
"""Update preferences"""


api_path = '/account/prefs'
Expand All @@ -160,7 +160,7 @@ def update_prefs(self, prefs):
}, api_params)

def create_recovery(self, email, url):
"""Create Password Recovery"""
"""Create password recovery"""


api_path = '/account/recovery'
Expand All @@ -180,7 +180,7 @@ def create_recovery(self, email, url):
}, api_params)

def update_recovery(self, user_id, secret, password, password_again):
"""Create Password Recovery (confirmation)"""
"""Create password recovery (confirmation)"""


api_path = '/account/recovery'
Expand Down Expand Up @@ -208,7 +208,7 @@ def update_recovery(self, user_id, secret, password, password_again):
}, api_params)

def list_sessions(self):
"""List Sessions"""
"""List sessions"""


api_path = '/account/sessions'
Expand All @@ -219,7 +219,7 @@ def list_sessions(self):
}, api_params)

def delete_sessions(self):
"""Delete Sessions"""
"""Delete sessions"""


api_path = '/account/sessions'
Expand All @@ -230,7 +230,7 @@ def delete_sessions(self):
}, api_params)

def get_session(self, session_id):
"""Get Session"""
"""Get session"""


api_path = '/account/sessions/{sessionId}'
Expand All @@ -246,7 +246,7 @@ def get_session(self, session_id):
}, api_params)

def update_session(self, session_id):
"""Update OAuth Session (Refresh Tokens)"""
"""Update OAuth session (refresh tokens)"""


api_path = '/account/sessions/{sessionId}'
Expand All @@ -262,7 +262,7 @@ def update_session(self, session_id):
}, api_params)

def delete_session(self, session_id):
"""Delete Session"""
"""Delete session"""


api_path = '/account/sessions/{sessionId}'
Expand All @@ -278,7 +278,7 @@ def delete_session(self, session_id):
}, api_params)

def update_status(self):
"""Update Status"""
"""Update status"""


api_path = '/account/status'
Expand All @@ -289,7 +289,7 @@ def update_status(self):
}, api_params)

def create_verification(self, url):
"""Create Email Verification"""
"""Create email verification"""


api_path = '/account/verification'
Expand All @@ -305,7 +305,7 @@ def create_verification(self, url):
}, api_params)

def update_verification(self, user_id, secret):
"""Create Email Verification (confirmation)"""
"""Create email verification (confirmation)"""


api_path = '/account/verification'
Expand All @@ -325,7 +325,7 @@ def update_verification(self, user_id, secret):
}, api_params)

def create_phone_verification(self):
"""Create Phone Verification"""
"""Create phone verification"""


api_path = '/account/verification/phone'
Expand All @@ -336,7 +336,7 @@ def create_phone_verification(self):
}, api_params)

def update_phone_verification(self, user_id, secret):
"""Create Phone Verification (confirmation)"""
"""Create phone verification (confirmation)"""


api_path = '/account/verification/phone'
Expand Down
14 changes: 7 additions & 7 deletions appwrite/services/avatars.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ def __init__(self, client):
super(Avatars, self).__init__(client)

def get_browser(self, code, width = None, height = None, quality = None):
"""Get Browser Icon"""
"""Get browser icon"""


api_path = '/avatars/browsers/{code}'
Expand All @@ -26,7 +26,7 @@ def get_browser(self, code, width = None, height = None, quality = None):
}, api_params)

def get_credit_card(self, code, width = None, height = None, quality = None):
"""Get Credit Card Icon"""
"""Get credit card icon"""


api_path = '/avatars/credit-cards/{code}'
Expand All @@ -45,7 +45,7 @@ def get_credit_card(self, code, width = None, height = None, quality = None):
}, api_params)

def get_favicon(self, url):
"""Get Favicon"""
"""Get favicon"""


api_path = '/avatars/favicon'
Expand All @@ -61,7 +61,7 @@ def get_favicon(self, url):
}, api_params)

def get_flag(self, code, width = None, height = None, quality = None):
"""Get Country Flag"""
"""Get country flag"""


api_path = '/avatars/flags/{code}'
Expand All @@ -80,7 +80,7 @@ def get_flag(self, code, width = None, height = None, quality = None):
}, api_params)

def get_image(self, url, width = None, height = None):
"""Get Image from URL"""
"""Get image from URL"""


api_path = '/avatars/image'
Expand All @@ -98,7 +98,7 @@ def get_image(self, url, width = None, height = None):
}, api_params)

def get_initials(self, name = None, width = None, height = None, background = None):
"""Get User Initials"""
"""Get user initials"""


api_path = '/avatars/initials'
Expand All @@ -114,7 +114,7 @@ def get_initials(self, name = None, width = None, height = None, background = No
}, api_params)

def get_qr(self, text, size = None, margin = None, download = None):
"""Get QR Code"""
"""Get QR code"""


api_path = '/avatars/qr'
Expand Down
Loading