appwrite-lab
Zero-click Appwrite test environments.
Allows you to spin up versioned Appwrite deployments for easy testing via CLI or through code, that can be ran in a sequence of E2E tests.
Installation
pip install appwrite-lab
Appwrite Lab features
- Spin up ephemeral Appwrite instances with Docker/Podman
- Automatically grab API keys (for programmatic access)
- Environment syncing (with
appwrite.json) - Clean teardowns
- Test suite
Appwrite Lab (in progress)
- Appwrite data population
CLI Usage
Help with appwrite-lab CLI
appwrite-lab --help
or
awlab --help
To get started spinning up a lab instance, use:
awlab new lab test --version 1.7.4
Note: This might take a few minutes the first time as its downloading all of the necessary images to launch Appwrite.
Example of additional args:
Additional arguments can be found here.
awlab new lab --help
awlab new lab test --version 1.7.4 --port 8005 --email test@example.com --password xxxxxxx12
To teardown
awlab stop test
Listing Appwrite Labs
awlab list labs
Sync an Appwrite lab from your prod lab schema
Run in the same folder where your appwrite.json is located to sync all resources:
awlab sync test
or sync a specific resource:
awlab sync test --resource functions
Python usage
Creating a lab
from appwrite_lab import Labs
from appwrite_lab.automations.models import AppwriteLabCreation
labs = Labs()
lab_res = labs.new(
name="test",
version="1.7.4",
auth=AppwriteLabCreation(
admin_email="test@example.com",
admin_password="xxxxxxx12",
project_id=None, # for auto gen
project_name=None, # for auto gen
)
port=8005
)
assert lab_res.data
Random generation that's compliant
from appwrite_lab.models import AppwriteLabCreation
auth = AppwriteLabCreation.generate()
Syncing a lab
from appwrite_lab import Labs
from appwrite_lab.automations.models import Expiration
Labs().sync_with_appwrite_config(
name="test",
appwrite_json="appwrite.json", # if not directly in folder
sync_type="all",
expiration=Expiration.THIRTY_DAYS,
)
Known Troubleshooting
Podman support and Selinux
Since I am mimicking the compose file that Appwrite provides, it was not designed to work rootless, but I have adjusted to work also on Fedora. You will need to turn selinux off for now to use.
Metadata
Release files for appwrite-lab 0.1.5
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| appwrite_lab-0.1.5.tar.gz | 28.7 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| appwrite_lab-0.1.5-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 66.5 kB
Release files / appwrite_lab-0.1.5.tar.gz
| Download URL | appwrite_lab-0.1.5.tar.gz |
|---|---|
| Size | 28.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
ea8d9e9e7c6f506de4bc5790234287f7f80dba1bc0557c04238c232696932208
|
|
BLAKE2b-256 checksum How to use checksums |
ffe38c4d5bb45661d24868e28a3ba2563f4a841f2224d68c0274f181201382d5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Release files / appwrite_lab-0.1.5-py3-none-any.whl
| Download URL | appwrite_lab-0.1.5-py3-none-any.whl |
|---|---|
| Size | 37.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
4579cb432c50f05a605d29ace9ef9b6372fa1226139279d0dbdcdbb2f6e9cff5
|
|
BLAKE2b-256 checksum How to use checksums |
a75f2ce8b6a5732517149fe3fcdecb163912a8af25f14f212f3b7f1ccc25eaab
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|