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
4 changes: 2 additions & 2 deletions appwrite/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@ def __init__(self):
self._endpoint = 'https://cloud.appwrite.io/v1'
self._global_headers = {
'content-type': '',
'user-agent' : f'AppwritePythonSDK/12.0.0 ({platform.uname().system}; {platform.uname().version}; {platform.uname().machine})',
'user-agent' : f'AppwritePythonSDK/13.0.0 ({platform.uname().system}; {platform.uname().version}; {platform.uname().machine})',
'x-sdk-name': 'Python',
'x-sdk-platform': 'server',
'x-sdk-language': 'python',
'x-sdk-version': '12.0.0',
'x-sdk-version': '13.0.0',
'X-Appwrite-Response-Format' : '1.8.0',
}

Expand Down
2 changes: 1 addition & 1 deletion appwrite/enums/credit_card.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class CreditCard(Enum):
MASTERCARD = "mastercard"
NARANJA = "naranja"
TARJETA_SHOPPING = "targeta-shopping"
UNION_CHINA_PAY = "union-china-pay"
UNION_PAY = "unionpay"
VISA = "visa"
MIR = "mir"
MAESTRO = "maestro"
Expand Down
1 change: 1 addition & 0 deletions appwrite/enums/execution_method.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ class ExecutionMethod(Enum):
PATCH = "PATCH"
DELETE = "DELETE"
OPTIONS = "OPTIONS"
HEAD = "HEAD"
1 change: 1 addition & 0 deletions appwrite/enums/index_type.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ class IndexType(Enum):
KEY = "key"
FULLTEXT = "fulltext"
UNIQUE = "unique"
SPATIAL = "spatial"
56 changes: 56 additions & 0 deletions appwrite/query.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,10 @@ def created_before(value):
def created_after(value):
return str(Query("createdAfter", None, value))

@staticmethod
def created_between(start, end):
return str(Query("createdBetween", None, [start, end]))

@staticmethod
def updated_before(value):
return str(Query("updatedBefore", None, value))
Expand All @@ -135,10 +139,62 @@ def updated_before(value):
def updated_after(value):
return str(Query("updatedAfter", None, value))

@staticmethod
def updated_between(start, end):
return str(Query("updatedBetween", None, [start, end]))

@staticmethod
def or_queries(queries):
return str(Query("or", None, [json.loads(query) for query in queries]))

@staticmethod
def and_queries(queries):
return str(Query("and", None, [json.loads(query) for query in queries]))

@staticmethod
def distance_equal(attribute, values, distance, meters=True):
return str(Query("distanceEqual", attribute, [[values, distance, meters]]))

@staticmethod
def distance_not_equal(attribute, values, distance, meters=True):
return str(Query("distanceNotEqual", attribute, [[values, distance, meters]]))

@staticmethod
def distance_greater_than(attribute, values, distance, meters=True):
return str(Query("distanceGreaterThan", attribute, [[values, distance, meters]]))

@staticmethod
def distance_less_than(attribute, values, distance, meters=True):
return str(Query("distanceLessThan", attribute, [[values, distance, meters]]))

@staticmethod
def intersects(attribute, values):
return str(Query("intersects", attribute, [values]))

@staticmethod
def not_intersects(attribute, values):
return str(Query("notIntersects", attribute, [values]))

@staticmethod
def crosses(attribute, values):
return str(Query("crosses", attribute, [values]))

@staticmethod
def not_crosses(attribute, values):
return str(Query("notCrosses", attribute, [values]))

@staticmethod
def overlaps(attribute, values):
return str(Query("overlaps", attribute, [values]))

@staticmethod
def not_overlaps(attribute, values):
return str(Query("notOverlaps", attribute, [values]))

@staticmethod
def touches(attribute, values):
return str(Query("touches", attribute, [values]))

@staticmethod
def not_touches(attribute, values):
return str(Query("notTouches", attribute, [values]))
8 changes: 4 additions & 4 deletions appwrite/services/account.py
Original file line number Diff line number Diff line change
Expand Up @@ -869,8 +869,8 @@ def update_magic_url_session(self, user_id: str, secret: str) -> Dict[str, Any]:
"""
Use this endpoint to create a session from token. Provide the **userId** and **secret** parameters from the successful response of authentication flows initiated by token creation. For example, magic URL and phone login.

.. deprecated::
This API has been deprecated.
.. deprecated::1.6.0
This API has been deprecated since 1.6.0. Please use `account.create_session` instead.
Parameters
----------
user_id : str
Expand Down Expand Up @@ -909,8 +909,8 @@ def update_phone_session(self, user_id: str, secret: str) -> Dict[str, Any]:
"""
Use this endpoint to create a session from token. Provide the **userId** and **secret** parameters from the successful response of authentication flows initiated by token creation. For example, magic URL and phone login.

.. deprecated::
This API has been deprecated.
.. deprecated::1.6.0
This API has been deprecated since 1.6.0. Please use `account.create_session` instead.
Parameters
----------
user_id : str
Expand Down
2 changes: 1 addition & 1 deletion appwrite/services/avatars.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ def get_credit_card(self, code: CreditCard, width: float = None, height: float =
Parameters
----------
code : CreditCard
Credit Card Code. Possible values: amex, argencard, cabal, cencosud, diners, discover, elo, hipercard, jcb, mastercard, naranja, targeta-shopping, union-china-pay, visa, mir, maestro, rupay.
Credit Card Code. Possible values: amex, argencard, cabal, cencosud, diners, discover, elo, hipercard, jcb, mastercard, naranja, targeta-shopping, unionpay, visa, mir, maestro, rupay.
width : float
Image width. Pass an integer between 0 to 2000. Defaults to 100.
height : float
Expand Down
Loading