Skip to content

feat: Python SDK update for version 20.1.0#148

Merged
abnegate merged 1 commit into
mainfrom
dev
Jun 5, 2026
Merged

feat: Python SDK update for version 20.1.0#148
abnegate merged 1 commit into
mainfrom
dev

Conversation

@ChiragAgg5k
Copy link
Copy Markdown
Member

This PR contains updates to the Python SDK for version 20.1.0.

What's Changed

  • Added: createSesProvider and updateSesProvider to messaging
  • Added: updateOAuth2Server to project for OAuth2 server settings
  • Added: updatePasswordStrengthPolicy and PolicyPasswordStrength to project
  • Added: getAuditsDB health check to health
  • Added: password-strength to ProjectPolicyId
  • Added: apps.read and apps.write to ProjectKeyScopes

@greptile-apps
Copy link
Copy Markdown

greptile-apps Bot commented Jun 5, 2026

Greptile Summary

This PR updates the Python SDK to version 20.1.0, adding new API surface and a cross-cutting architectural change that moves the project-ID header from a global client header to a per-request header injected in every service method.

  • New features: create_ses_provider / update_ses_provider in messaging; update_o_auth2_server in project; update_password_strength_policy returning the new PolicyPasswordStrength model; get_audits_db in health; PASSWORD_STRENGTH added to ProjectPolicyId; APPS_READ / APPS_WRITE added to ProjectKeyScopes.
  • Architectural change: client.set_project() no longer writes x-appwrite-project to _global_headers; the value is now stored in _config and read back per-call via get_config('project') in every service method.
  • Project model: nine new OAuth2 server fields added and region field position updated to match the revised API response schema.

Confidence Score: 4/5

The SDK update is internally consistent and all 23 service files were updated together, but the change to project-ID header propagation deserves a second look before merging.

The set_project method no longer writes to _global_headers, so any caller using client.call() directly will silently drop the project header. Additionally, from urllib.parse import quote was added to every service file but is unused throughout.

appwrite/client.py for the set_project global-header removal, and all service files for the unused quote import.

Important Files Changed

Filename Overview
appwrite/client.py Version bumped to 20.1.0; set_project now stores value only in _config rather than _global_headers; get_config accessor added; all other setter methods also mirror values into _config.
appwrite/services/messaging.py Added create_ses_provider and update_ses_provider methods; unused quote import added; all existing methods updated with per-request X-Appwrite-Project header.
appwrite/services/project.py Added update_o_auth2_server and update_password_strength_policy; all existing methods updated with per-request project header; unused quote import added.
appwrite/services/health.py Added get_audits_db returning HealthStatusList; consistent with other health check methods; unused quote import added.
appwrite/models/policy_password_strength.py New model for password-strength policy with fields for $id, min, uppercase, lowercase, number, and symbols; follows existing policy model patterns.
appwrite/models/project.py Added nine new OAuth2 server fields; region field position moved earlier; billinglimits stays Optional.

Reviews (1): Last reviewed commit: "chore: update Python SDK to 20.1.0" | Re-trigger Greptile

@@ -1,4 +1,5 @@
from ..service import Service
from urllib.parse import quote
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Unused import across all 23 service files

from urllib.parse import quote is added to every updated service file but quote( is never called anywhere in the codebase. Running a global search across all service files yields zero usages. This adds dead code to every service module. The pattern appears in account.py, activities.py, advisor.py, and 20 other services.

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

Comment thread appwrite/client.py
Comment on lines 59 to 63
self._global_headers['x-appwrite-key'] = value
self._config['key'] = value
return self

def set_jwt(self, value):
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 set_project no longer writes to global headers

set_project previously called self._global_headers['x-appwrite-project'] = value, so the project ID was automatically included in every request via the {**self._global_headers, **headers} merge in call(). After this change it only stores the value in self._config. Any call made through client.call() directly — bypassing a service class — will now silently omit the X-Appwrite-Project header even after set_project was called. All generated service methods were updated to inject the header explicitly, so the normal SDK path works correctly, but existing code that calls client.call() directly will regress.

@abnegate abnegate merged commit b7c2f75 into main Jun 5, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants