Last active
October 25, 2024 09:09
-
-
Save bizrockman/13bb04afa1b69a0662f4ad29f4b57c3a to your computer and use it in GitHub Desktop.
Create an appwrite Client in Python
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from appwrite.client import Client | |
from dotenv import load_dotenv | |
def init_appwrite_client() -> Client: | |
''' | |
Init Appwrite client and return Databases object | |
''' | |
client = Client() | |
client.set_endpoint(os.getenv("APPWRITE_ENDPOINT")) | |
client.set_project(os.getenv("APPWRITE_PROJECT_ID")) | |
client.set_key(os.getenv("APPWRITE_API_KEY")) | |
#client.set_self_signed(True) | |
return client | |
load_dotenv() | |
appwrite_client: Client = init_appwrite_client() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment