Skip to content

Add inc/dec #113

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
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.7.0-blue.svg?style=flat-square)
![Version](https://img.shields.io/badge/api%20version-1.7.4-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
2 changes: 2 additions & 0 deletions appwrite/enums/build_runtime.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ class BuildRuntime(Enum):
DART_3_1 = "dart-3.1"
DART_3_3 = "dart-3.3"
DART_3_5 = "dart-3.5"
DART_3_8 = "dart-3.8"
DOTNET_6_0 = "dotnet-6.0"
DOTNET_7_0 = "dotnet-7.0"
DOTNET_8_0 = "dotnet-8.0"
Expand All @@ -64,3 +65,4 @@ class BuildRuntime(Enum):
FLUTTER_3_24 = "flutter-3.24"
FLUTTER_3_27 = "flutter-3.27"
FLUTTER_3_29 = "flutter-3.29"
FLUTTER_3_32 = "flutter-3.32"
1 change: 1 addition & 0 deletions appwrite/enums/image_format.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ class ImageFormat(Enum):
WEBP = "webp"
HEIC = "heic"
AVIF = "avif"
GIF = "gif"
2 changes: 2 additions & 0 deletions appwrite/enums/runtime.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ class Runtime(Enum):
DART_3_1 = "dart-3.1"
DART_3_3 = "dart-3.3"
DART_3_5 = "dart-3.5"
DART_3_8 = "dart-3.8"
DOTNET_6_0 = "dotnet-6.0"
DOTNET_7_0 = "dotnet-7.0"
DOTNET_8_0 = "dotnet-8.0"
Expand All @@ -64,3 +65,4 @@ class Runtime(Enum):
FLUTTER_3_24 = "flutter-3.24"
FLUTTER_3_27 = "flutter-3.27"
FLUTTER_3_29 = "flutter-3.29"
FLUTTER_3_32 = "flutter-3.32"
31 changes: 31 additions & 0 deletions appwrite/services/account.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ def create(self, user_id: str, email: str, password: str, name: str = None) -> D
"""
Use this endpoint to allow a new user to register a new account in your project. After the user registration completes successfully, you can use the [/account/verfication](https://appwrite.io/docs/references/cloud/client-web/account#createVerification) route to start verifying the user email address. To allow the new user to login to their new account, you need to create a new [account session](https://appwrite.io/docs/references/cloud/client-web/account#createEmailSession).


Parameters
----------
user_id : str
Expand Down Expand Up @@ -84,6 +85,7 @@ def update_email(self, email: str, password: str) -> Dict[str, Any]:
This endpoint can also be used to convert an anonymous account to a normal one, by passing an email address and a new password.



Parameters
----------
email : str
Expand Down Expand Up @@ -122,6 +124,7 @@ def list_identities(self, queries: List[str] = None) -> Dict[str, Any]:
"""
Get the list of identities for the currently logged in user.


Parameters
----------
queries : List[str]
Expand Down Expand Up @@ -150,6 +153,7 @@ def delete_identity(self, identity_id: str) -> Dict[str, Any]:
"""
Delete an identity by its unique ID.


Parameters
----------
identity_id : str
Expand Down Expand Up @@ -204,6 +208,7 @@ def list_logs(self, queries: List[str] = None) -> Dict[str, Any]:
"""
Get the list of latest security activity logs for the currently logged in user. Each log returns user IP address, location and date and time of log.


Parameters
----------
queries : List[str]
Expand Down Expand Up @@ -232,6 +237,7 @@ def update_mfa(self, mfa: bool) -> Dict[str, Any]:
"""
Enable or disable MFA on an account.


Parameters
----------
mfa : bool
Expand Down Expand Up @@ -264,6 +270,7 @@ def create_mfa_authenticator(self, type: AuthenticatorType) -> Dict[str, Any]:
"""
Add an authenticator app to be used as an MFA factor. Verify the authenticator using the [verify authenticator](/docs/references/cloud/client-web/account#updateMfaAuthenticator) method.


Parameters
----------
type : AuthenticatorType
Expand Down Expand Up @@ -296,6 +303,7 @@ def update_mfa_authenticator(self, type: AuthenticatorType, otp: str) -> Dict[st
"""
Verify an authenticator app after adding it using the [add authenticator](/docs/references/cloud/client-web/account#createMfaAuthenticator) method.


Parameters
----------
type : AuthenticatorType
Expand Down Expand Up @@ -334,6 +342,7 @@ def delete_mfa_authenticator(self, type: AuthenticatorType) -> Dict[str, Any]:
"""
Delete an authenticator for a user by ID.


Parameters
----------
type : AuthenticatorType
Expand Down Expand Up @@ -366,6 +375,7 @@ def create_mfa_challenge(self, factor: AuthenticationFactor) -> Dict[str, Any]:
"""
Begin the process of MFA verification after sign-in. Finish the flow with [updateMfaChallenge](/docs/references/cloud/client-web/account#updateMfaChallenge) method.


Parameters
----------
factor : AuthenticationFactor
Expand Down Expand Up @@ -398,6 +408,7 @@ def update_mfa_challenge(self, challenge_id: str, otp: str) -> Dict[str, Any]:
"""
Complete the MFA challenge by providing the one-time password. Finish the process of MFA verification by providing the one-time password. To begin the flow, use [createMfaChallenge](/docs/references/cloud/client-web/account#createMfaChallenge) method.


Parameters
----------
challenge_id : str
Expand Down Expand Up @@ -522,6 +533,7 @@ def update_name(self, name: str) -> Dict[str, Any]:
"""
Update currently logged in user account name.


Parameters
----------
name : str
Expand Down Expand Up @@ -554,6 +566,7 @@ def update_password(self, password: str, old_password: str = None) -> Dict[str,
"""
Update currently logged in user password. For validation, user is required to pass in the new password, and the old password. For users created with OAuth, Team Invites and Magic URL, oldPassword is optional.


Parameters
----------
password : str
Expand Down Expand Up @@ -589,6 +602,7 @@ def update_phone(self, phone: str, password: str) -> Dict[str, Any]:
"""
Update the currently logged in user's phone number. After updating the phone number, the phone verification status will be reset. A confirmation SMS is not sent automatically, however you can use the [POST /account/verification/phone](https://appwrite.io/docs/references/cloud/client-web/account#createPhoneVerification) endpoint to send a confirmation SMS.


Parameters
----------
phone : str
Expand Down Expand Up @@ -648,6 +662,7 @@ def update_prefs(self, prefs: dict) -> Dict[str, Any]:
"""
Update currently logged in user account preferences. The object you pass is stored as is, and replaces any previous value. The maximum allowed prefs size is 64kB and throws error if exceeded.


Parameters
----------
prefs : dict
Expand Down Expand Up @@ -680,6 +695,7 @@ def create_recovery(self, email: str, url: str) -> Dict[str, Any]:
"""
Sends the user an email with a temporary secret key for password reset. When the user clicks the confirmation link he is redirected back to your app password reset URL with the secret key and email address values attached to the URL query string. Use the query string params to submit a request to the [PUT /account/recovery](https://appwrite.io/docs/references/cloud/client-web/account#updateRecovery) endpoint to complete the process. The verification link sent to the user's email address is valid for 1 hour.


Parameters
----------
email : str
Expand Down Expand Up @@ -720,6 +736,7 @@ def update_recovery(self, user_id: str, secret: str, password: str) -> Dict[str,

Please note that in order to avoid a [Redirect Attack](https://github.com/OWASP/CheatSheetSeries/blob/master/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md) the only valid redirect URLs are the ones from domains you have set when adding your platforms in the console interface.


Parameters
----------
user_id : str
Expand Down Expand Up @@ -831,6 +848,7 @@ def create_email_password_session(self, email: str, password: str) -> Dict[str,

A user is limited to 10 active sessions at a time by default. [Learn more about session limits](https://appwrite.io/docs/authentication-security#limits).


Parameters
----------
email : str
Expand Down Expand Up @@ -869,6 +887,7 @@ 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.


Parameters
----------
user_id : str
Expand Down Expand Up @@ -907,6 +926,7 @@ 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.


Parameters
----------
user_id : str
Expand Down Expand Up @@ -945,6 +965,7 @@ def create_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.


Parameters
----------
user_id : str
Expand Down Expand Up @@ -983,6 +1004,7 @@ def get_session(self, session_id: str) -> Dict[str, Any]:
"""
Use this endpoint to get a logged in user's session using a Session ID. Inputting 'current' will return the current session being used.


Parameters
----------
session_id : str
Expand Down Expand Up @@ -1014,6 +1036,7 @@ def update_session(self, session_id: str) -> Dict[str, Any]:
"""
Use this endpoint to extend a session's length. Extending a session is useful when session expiry is short. If the session was created using an OAuth provider, this endpoint refreshes the access token from the provider.


Parameters
----------
session_id : str
Expand Down Expand Up @@ -1046,6 +1069,7 @@ def delete_session(self, session_id: str) -> Dict[str, Any]:
"""
Logout the user. Use 'current' as the session ID to logout on this device, use a session ID to logout on another device. If you're looking to logout the user on all devices, use [Delete Sessions](https://appwrite.io/docs/references/cloud/client-web/account#deleteSessions) instead.


Parameters
----------
session_id : str
Expand Down Expand Up @@ -1102,6 +1126,7 @@ def create_email_token(self, user_id: str, email: str, phrase: bool = None) -> D

A user is limited to 10 active sessions at a time by default. [Learn more about session limits](https://appwrite.io/docs/authentication-security#limits).


Parameters
----------
user_id : str
Expand Down Expand Up @@ -1146,6 +1171,7 @@ def create_magic_url_token(self, user_id: str, email: str, url: str = None, phra
A user is limited to 10 active sessions at a time by default. [Learn more about session limits](https://appwrite.io/docs/authentication-security#limits).



Parameters
----------
user_id : str
Expand Down Expand Up @@ -1194,6 +1220,7 @@ def create_o_auth2_token(self, provider: OAuthProvider, success: str = None, fai

A user is limited to 10 active sessions at a time by default. [Learn more about session limits](https://appwrite.io/docs/authentication-security#limits).


Parameters
----------
provider : OAuthProvider
Expand Down Expand Up @@ -1236,6 +1263,7 @@ def create_phone_token(self, user_id: str, phone: str) -> Dict[str, Any]:

A user is limited to 10 active sessions at a time by default. [Learn more about session limits](https://appwrite.io/docs/authentication-security#limits).


Parameters
----------
user_id : str
Expand Down Expand Up @@ -1277,6 +1305,7 @@ def create_verification(self, url: str) -> Dict[str, Any]:
Please note that in order to avoid a [Redirect Attack](https://github.com/OWASP/CheatSheetSeries/blob/master/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md), the only valid redirect URLs are the ones from domains you have set when adding your platforms in the console interface.



Parameters
----------
url : str
Expand Down Expand Up @@ -1309,6 +1338,7 @@ def update_verification(self, user_id: str, secret: str) -> Dict[str, Any]:
"""
Use this endpoint to complete the user email verification process. Use both the **userId** and **secret** parameters that were attached to your app URL to verify the user email ownership. If confirmed this route will return a 200 status code.


Parameters
----------
user_id : str
Expand Down Expand Up @@ -1369,6 +1399,7 @@ def update_phone_verification(self, user_id: str, secret: str) -> Dict[str, Any]
"""
Use this endpoint to complete the user phone verification process. Use the **userId** and **secret** that were sent to your user's phone number to verify the user email ownership. If confirmed this route will return a 200 status code.


Parameters
----------
user_id : str
Expand Down
7 changes: 7 additions & 0 deletions appwrite/services/avatars.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ def get_browser(self, code: Browser, width: float = None, height: float = None,

When one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px.


Parameters
----------
code : Browser
Expand Down Expand Up @@ -59,6 +60,7 @@ def get_credit_card(self, code: CreditCard, width: float = None, height: float =
When one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px.



Parameters
----------
code : CreditCard
Expand Down Expand Up @@ -101,6 +103,7 @@ def get_favicon(self, url: str) -> bytes:

This endpoint does not follow HTTP redirects.


Parameters
----------
url : str
Expand Down Expand Up @@ -135,6 +138,7 @@ def get_flag(self, code: Flag, width: float = None, height: float = None, qualit
When one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px.



Parameters
----------
code : Flag
Expand Down Expand Up @@ -179,6 +183,7 @@ def get_image(self, url: str, width: float = None, height: float = None) -> byte

This endpoint does not follow HTTP redirects.


Parameters
----------
url : str
Expand Down Expand Up @@ -221,6 +226,7 @@ def get_initials(self, name: str = None, width: float = None, height: float = No
When one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px.



Parameters
----------
name : str
Expand Down Expand Up @@ -259,6 +265,7 @@ def get_qr(self, text: str, size: float = None, margin: float = None, download:
Converts a given plain text to a QR code image. You can use the query parameters to change the size and style of the resulting image.



Parameters
----------
text : str
Expand Down
Loading