Skip to content

Commit df27804

Browse files
Merge pull request #57 from appwrite/dev
update to appwrite 1.3.0
2 parents 7ded6e2 + 97054a6 commit df27804

28 files changed

+646
-45
lines changed

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Copyright (c) 2022 Appwrite (https://appwrite.io) and individual contributors.
1+
Copyright (c) 2023 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-1.2.0-blue.svg?style=flat-square)
4+
![Version](https://img.shields.io/badge/api%20version-1.3.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 1.2.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 1.3.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: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ def __init__(self):
1414
'x-sdk-name': 'Python',
1515
'x-sdk-platform': 'server',
1616
'x-sdk-language': 'python',
17-
'x-sdk-version': '1.2.0',
17+
'x-sdk-version': '2.0.0',
1818
'X-Appwrite-Response-Format' : '1.0.0',
1919
}
2020

appwrite/query.py

Lines changed: 41 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,46 +1,70 @@
11
class Query:
22
@staticmethod
33
def equal(attribute, value):
4-
return Query.addQuery(attribute, "equal", value)
4+
return Query.add_query(attribute, "equal", value)
55

66
@staticmethod
7-
def notEqual(attribute, value):
8-
return Query.addQuery(attribute, "notEqual", value)
7+
def not_equal(attribute, value):
8+
return Query.add_query(attribute, "notEqual", value)
99

1010
@staticmethod
11-
def lessThan(attribute, value):
12-
return Query.addQuery(attribute, "lessThan", value)
11+
def less_than(attribute, value):
12+
return Query.add_query(attribute, "lessThan", value)
1313

1414
@staticmethod
15-
def lessThanEqual(attribute, value):
16-
return Query.addQuery(attribute, "lessThanEqual", value)
15+
def less_than_equal(attribute, value):
16+
return Query.add_query(attribute, "lessThanEqual", value)
1717

1818
@staticmethod
19-
def greaterThan(attribute, value):
20-
return Query.addQuery(attribute, "greaterThan", value)
19+
def greater_than(attribute, value):
20+
return Query.add_query(attribute, "greaterThan", value)
2121

2222
@staticmethod
23-
def greaterThanEqual(attribute, value):
24-
return Query.addQuery(attribute, "greaterThanEqual", value)
23+
def greater_than_equal(attribute, value):
24+
return Query.add_query(attribute, "greaterThanEqual", value)
25+
26+
@staticmethod
27+
def is_null(attribute):
28+
return f'isNull("{attribute}")'
29+
30+
@staticmethod
31+
def is_not_null(attribute):
32+
return f'isNotNull("{attribute}")'
33+
34+
@staticmethod
35+
def between(attribute, start, end):
36+
return Query.add_query(attribute, "between", [start, end])
37+
38+
@staticmethod
39+
def starts_with(attribute, value):
40+
return Query.add_query(attribute, "startsWith", value)
41+
42+
@staticmethod
43+
def ends_with(attribute, value):
44+
return Query.add_query(attribute, "endsWith", value)
45+
46+
@staticmethod
47+
def select(attributes):
48+
return f'select([{",".join(map(Query.parseValues, attributes))}])'
2549

2650
@staticmethod
2751
def search(attribute, value):
28-
return Query.addQuery(attribute, "search", value)
52+
return Query.add_query(attribute, "search", value)
2953

3054
@staticmethod
31-
def orderAsc(attribute):
55+
def order_asc(attribute):
3256
return f'orderAsc("{attribute}")'
3357

3458
@staticmethod
35-
def orderDesc(attribute):
59+
def order_desc(attribute):
3660
return f'orderDesc("{attribute}")'
3761

3862
@staticmethod
39-
def cursorBefore(id):
63+
def cursor_before(id):
4064
return f'cursorBefore("{id}")'
4165

4266
@staticmethod
43-
def cursorAfter(id):
67+
def cursor_after(id):
4468
return f'cursorAfter("{id}")'
4569

4670
@staticmethod
@@ -52,7 +76,7 @@ def offset(offset):
5276
return f'offset({offset})'
5377

5478
@staticmethod
55-
def addQuery(attribute, method, value):
79+
def add_query(attribute, method, value):
5680
if type(value) == list:
5781
return f'{method}("{attribute}", [{",".join(map(Query.parseValues, value))}])'
5882
else:

0 commit comments

Comments
 (0)