Skip to content

Commit 24b258b

Browse files
committed
feat(version): support 0.12.0
1 parent 306ca8d commit 24b258b

37 files changed

+869
-80
lines changed

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Copyright (c) 2021 Appwrite (https://appwrite.io) and individual contributors.
1+
Copyright (c) 2022 Appwrite (https://appwrite.io) and individual contributors.
22
All rights reserved.
33

44
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

README.md

Lines changed: 2 additions & 2 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.11.0-blue.svg?style=flat-square)
4+
![Version](https://img.shields.io/badge/api%20version-0.12.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?color=00acee&label=twitter&style=flat-square)](https://twitter.com/appwrite)
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.11.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.12.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

appwrite/client.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@
55
class Client:
66
def __init__(self):
77
self._self_signed = False
8-
self._endpoint = 'https://appwrite.io/v1'
8+
self._endpoint = 'https://HOSTNAME/v1'
99
self._global_headers = {
1010
'content-type': '',
1111
'x-sdk-version': 'appwrite:python:0.5.1',
12-
'X-Appwrite-Response-Format' : '0.11.0',
12+
'X-Appwrite-Response-Format' : '0.12.0',
1313
}
1414

1515
def set_self_signed(self, status=True):

appwrite/query.py

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
class Query:
2+
@staticmethod
3+
def equal(attribute, value):
4+
return Query.addQuery(attribute, "equal", value)
5+
6+
@staticmethod
7+
def notEqual(attribute, value):
8+
return Query.addQuery(attribute, "notEqual", value)
9+
10+
@staticmethod
11+
def lesser(attribute, value):
12+
return Query.addQuery(attribute, "lesser", value)
13+
14+
@staticmethod
15+
def lesserEqual(attribute, value):
16+
return Query.addQuery(attribute, "lesserEqual", value)
17+
18+
@staticmethod
19+
def greater(attribute, value):
20+
return Query.addQuery(attribute, "greater", value)
21+
22+
@staticmethod
23+
def greaterEqual(attribute, value):
24+
return Query.addQuery(attribute, "greaterEqual", value)
25+
26+
@staticmethod
27+
def search(attribute, value):
28+
return Query.addQuery(attribute, "search", value)
29+
30+
@staticmethod
31+
def addQuery(attribute, oper, value):
32+
if type(value) == list:
33+
return '{}.{}({})'.format(attribute,oper, ','.join(map(Query.parseValues, value)))
34+
else:
35+
return '{}.{}({})'.format(attribute,oper, Query.parseValues(value))
36+
37+
@staticmethod
38+
def parseValues(value):
39+
if type(value) == str:
40+
return '"{}"'.format(value)
41+
else:
42+
return value

appwrite/services/account.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,12 +48,18 @@ def update_email(self, email, password):
4848
'content-type': 'application/json',
4949
}, params)
5050

51-
def get_logs(self):
51+
def get_logs(self, limit = None, offset = None):
5252
"""Get Account Logs"""
5353

5454
params = {}
5555
path = '/account/logs'
5656

57+
if limit is not None:
58+
params['limit'] = limit
59+
60+
if offset is not None:
61+
params['offset'] = offset
62+
5763
return self.client.call('get', path, {
5864
'content-type': 'application/json',
5965
}, params)

0 commit comments

Comments
 (0)