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 .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v4
uses: actions/checkout@v6

- name: Set up Python
uses: actions/setup-python@v5
uses: actions/setup-python@v6
with:
python-version: '3.9'

Expand Down
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Change Log

## 18.1.0

* Added: Introduced `bigint` create/update APIs for legacy Databases attributes
* Added: Introduced `bigint` create/update APIs for `TablesDB` columns
* Updated: Extended key-list query filters with `key`, `resourceType`, `resourceId`, and `secret`

## 18.0.0

* [BREAKING] Renamed Webhook model fields: `security` → `tls`, `httpUser` → `authUsername`, `httpPass` → `authPassword`, `signatureKey` → `secret`
Expand Down
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.9.1-blue.svg?style=flat-square)
![Version](https://img.shields.io/badge/api%20version-1.9.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
18 changes: 15 additions & 3 deletions appwrite/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@ def __init__(self):
self._endpoint = 'https://cloud.appwrite.io/v1'
self._global_headers = {
'content-type': '',
'user-agent' : f'AppwritePythonSDK/18.0.0 ({platform.uname().system}; {platform.uname().version}; {platform.uname().machine})',
'user-agent' : f'AppwritePythonSDK/18.1.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': '18.0.0',
'X-Appwrite-Response-Format' : '1.9.1',
'x-sdk-version': '18.1.0',
'X-Appwrite-Response-Format' : '1.9.4',
}

def set_self_signed(self, status=True):
Expand Down Expand Up @@ -75,6 +75,18 @@ def set_forwarded_user_agent(self, value):
self._global_headers['x-forwarded-user-agent'] = value
return self

def set_dev_key(self, value):
"""Your secret dev API key"""

self._global_headers['x-appwrite-dev-key'] = value
return self

def set_cookie(self, value):
"""The user cookie to authenticate with. Used by SDKs that forward an incoming Cookie header in server-side runtimes."""

self._global_headers['cookie'] = value
return self

def set_impersonate_user_id(self, value):
"""Impersonate a user by ID on an already user-authenticated request. Requires the current request to be authenticated as a user with impersonator capability; X-Appwrite-Key alone is not sufficient. Impersonator users are intentionally granted users.read so they can discover a target before impersonation begins. Internal audit logs still attribute actions to the original impersonator and record the impersonated target only in internal audit payload data."""

Expand Down
36 changes: 36 additions & 0 deletions appwrite/encoders/value_class_encoder.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,15 @@
from ..enums.name import Name
from ..enums.message_priority import MessagePriority
from ..enums.smtp_encryption import SmtpEncryption
from ..enums.auth_method import AuthMethod
from ..enums.project_policy import ProjectPolicy
from ..enums.protocol_id import ProtocolId
from ..enums.service_id import ServiceId
from ..enums.secure import Secure
from ..enums.email_template_type import EmailTemplateType
from ..enums.email_template_locale import EmailTemplateLocale
from ..enums.status_code import StatusCode
from ..enums.proxy_resource_type import ProxyResourceType
from ..enums.framework import Framework
from ..enums.build_runtime import BuildRuntime
from ..enums.adapter import Adapter
Expand All @@ -44,6 +51,8 @@
from ..enums.platform_type import PlatformType
from ..enums.health_antivirus_status import HealthAntivirusStatus
from ..enums.health_check_status import HealthCheckStatus
from ..enums.proxy_rule_deployment_resource_type import ProxyRuleDeploymentResourceType
from ..enums.proxy_rule_status import ProxyRuleStatus
from ..enums.message_status import MessageStatus

class ValueClassEncoder(json.JSONEncoder):
Expand Down Expand Up @@ -123,12 +132,33 @@ def default(self, o):
if isinstance(o, SmtpEncryption):
return o.value

if isinstance(o, AuthMethod):
return o.value

if isinstance(o, ProjectPolicy):
return o.value

if isinstance(o, ProtocolId):
return o.value

if isinstance(o, ServiceId):
return o.value

if isinstance(o, Secure):
return o.value

if isinstance(o, EmailTemplateType):
return o.value

if isinstance(o, EmailTemplateLocale):
return o.value

if isinstance(o, StatusCode):
return o.value

if isinstance(o, ProxyResourceType):
return o.value

if isinstance(o, Framework):
return o.value

Expand Down Expand Up @@ -183,6 +213,12 @@ def default(self, o):
if isinstance(o, HealthCheckStatus):
return o.value

if isinstance(o, ProxyRuleDeploymentResourceType):
return o.value

if isinstance(o, ProxyRuleStatus):
return o.value

if isinstance(o, MessageStatus):
return o.value

Expand Down
10 changes: 10 additions & 0 deletions appwrite/enums/auth_method.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
from enum import Enum

class AuthMethod(Enum):
EMAIL_PASSWORD = "email-password"
MAGIC_URL = "magic-url"
EMAIL_OTP = "email-otp"
ANONYMOUS = "anonymous"
INVITES = "invites"
JWT = "jwt"
PHONE = "phone"
1 change: 1 addition & 0 deletions appwrite/enums/build_runtime.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ class BuildRuntime(Enum):
GO_1_24 = "go-1.24"
GO_1_25 = "go-1.25"
GO_1_26 = "go-1.26"
RUST_1_83 = "rust-1.83"
STATIC_1 = "static-1"
FLUTTER_3_24 = "flutter-3.24"
FLUTTER_3_27 = "flutter-3.27"
Expand Down
134 changes: 134 additions & 0 deletions appwrite/enums/email_template_locale.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,134 @@
from enum import Enum

class EmailTemplateLocale(Enum):
AF = "af"
AR_AE = "ar-ae"
AR_BH = "ar-bh"
AR_DZ = "ar-dz"
AR_EG = "ar-eg"
AR_IQ = "ar-iq"
AR_JO = "ar-jo"
AR_KW = "ar-kw"
AR_LB = "ar-lb"
AR_LY = "ar-ly"
AR_MA = "ar-ma"
AR_OM = "ar-om"
AR_QA = "ar-qa"
AR_SA = "ar-sa"
AR_SY = "ar-sy"
AR_TN = "ar-tn"
AR_YE = "ar-ye"
AS = "as"
AZ = "az"
BE = "be"
BG = "bg"
BH = "bh"
BN = "bn"
BS = "bs"
CA = "ca"
CS = "cs"
CY = "cy"
DA = "da"
DE = "de"
DE_AT = "de-at"
DE_CH = "de-ch"
DE_LI = "de-li"
DE_LU = "de-lu"
EL = "el"
EN = "en"
EN_AU = "en-au"
EN_BZ = "en-bz"
EN_CA = "en-ca"
EN_GB = "en-gb"
EN_IE = "en-ie"
EN_JM = "en-jm"
EN_NZ = "en-nz"
EN_TT = "en-tt"
EN_US = "en-us"
EN_ZA = "en-za"
EO = "eo"
ES = "es"
ES_AR = "es-ar"
ES_BO = "es-bo"
ES_CL = "es-cl"
ES_CO = "es-co"
ES_CR = "es-cr"
ES_DO = "es-do"
ES_EC = "es-ec"
ES_GT = "es-gt"
ES_HN = "es-hn"
ES_MX = "es-mx"
ES_NI = "es-ni"
ES_PA = "es-pa"
ES_PE = "es-pe"
ES_PR = "es-pr"
ES_PY = "es-py"
ES_SV = "es-sv"
ES_UY = "es-uy"
ES_VE = "es-ve"
ET = "et"
EU = "eu"
FA = "fa"
FI = "fi"
FO = "fo"
FR = "fr"
FR_BE = "fr-be"
FR_CA = "fr-ca"
FR_CH = "fr-ch"
FR_LU = "fr-lu"
GA = "ga"
GD = "gd"
HE = "he"
HI = "hi"
HR = "hr"
HU = "hu"
ID = "id"
IS = "is"
IT = "it"
IT_CH = "it-ch"
JA = "ja"
JI = "ji"
KO = "ko"
KU = "ku"
LT = "lt"
LV = "lv"
MK = "mk"
ML = "ml"
MS = "ms"
MT = "mt"
NB = "nb"
NE = "ne"
NL = "nl"
NL_BE = "nl-be"
NN = "nn"
NO = "no"
PA = "pa"
PL = "pl"
PT = "pt"
PT_BR = "pt-br"
RM = "rm"
RO = "ro"
RO_MD = "ro-md"
RU = "ru"
RU_MD = "ru-md"
SB = "sb"
SK = "sk"
SL = "sl"
SQ = "sq"
SR = "sr"
SV = "sv"
SV_FI = "sv-fi"
TH = "th"
TN = "tn"
TR = "tr"
TS = "ts"
UA = "ua"
UR = "ur"
VE = "ve"
VI = "vi"
XH = "xh"
ZH_CN = "zh-cn"
ZH_HK = "zh-hk"
ZH_SG = "zh-sg"
ZH_TW = "zh-tw"
ZU = "zu"
10 changes: 10 additions & 0 deletions appwrite/enums/email_template_type.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
from enum import Enum

class EmailTemplateType(Enum):
VERIFICATION = "verification"
MAGICSESSION = "magicSession"
RECOVERY = "recovery"
INVITATION = "invitation"
MFACHALLENGE = "mfaChallenge"
SESSIONALERT = "sessionAlert"
OTPSESSION = "otpSession"
5 changes: 5 additions & 0 deletions appwrite/enums/o_auth_provider.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,12 @@ class OAuthProvider(Enum):
ETSY = "etsy"
FACEBOOK = "facebook"
FIGMA = "figma"
FUSIONAUTH = "fusionauth"
GITHUB = "github"
GITLAB = "gitlab"
GOOGLE = "google"
KEYCLOAK = "keycloak"
KICK = "kick"
LINKEDIN = "linkedin"
MICROSOFT = "microsoft"
NOTION = "notion"
Expand All @@ -41,3 +44,5 @@ class OAuthProvider(Enum):
YANDEX = "yandex"
ZOHO = "zoho"
ZOOM = "zoom"
GITHUBIMAGINE = "githubImagine"
GOOGLEIMAGINE = "googleImagine"
12 changes: 12 additions & 0 deletions appwrite/enums/project_policy.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
from enum import Enum

class ProjectPolicy(Enum):
PASSWORD_DICTIONARY = "password-dictionary"
PASSWORD_HISTORY = "password-history"
PASSWORD_PERSONAL_DATA = "password-personal-data"
SESSION_ALERT = "session-alert"
SESSION_DURATION = "session-duration"
SESSION_INVALIDATION = "session-invalidation"
SESSION_LIMIT = "session-limit"
USER_LIMIT = "user-limit"
MEMBERSHIP_PRIVACY = "membership-privacy"
5 changes: 5 additions & 0 deletions appwrite/enums/proxy_resource_type.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
from enum import Enum

class ProxyResourceType(Enum):
SITE = "site"
FUNCTION = "function"
5 changes: 5 additions & 0 deletions appwrite/enums/proxy_rule_deployment_resource_type.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
from enum import Enum

class ProxyRuleDeploymentResourceType(Enum):
FUNCTION = "function"
SITE = "site"
6 changes: 6 additions & 0 deletions appwrite/enums/proxy_rule_status.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
from enum import Enum

class ProxyRuleStatus(Enum):
UNVERIFIED = "unverified"
VERIFYING = "verifying"
VERIFIED = "verified"
1 change: 1 addition & 0 deletions appwrite/enums/runtime.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ class Runtime(Enum):
GO_1_24 = "go-1.24"
GO_1_25 = "go-1.25"
GO_1_26 = "go-1.26"
RUST_1_83 = "rust-1.83"
STATIC_1 = "static-1"
FLUTTER_3_24 = "flutter-3.24"
FLUTTER_3_27 = "flutter-3.27"
Expand Down
Loading