Appwrite Annotations
A Python library for defining and annotating class attributes with custom metadata for appwrite.
Appwrite Annotations is a Python package that simplifies the creation of collections and attributes in Appwrite. Instead of manually creating collections and attributes through the Appwrite dashboard, users can now simply write Python model classes with custom annotations. This package allows users to define collections and attributes in their code, and with a single script execution, all the collections and attributes will be automatically created in Appwrite.
Why Use Appwrite Annotations?
When building an app with Appwrite, defining collections and their attributes is a time-consuming process. Typically, developers:
- Write the front-end data model classes.
- Then, they navigate to the Appwrite dashboard to manually create collections and add attributes.
This package eliminates that repetitive process. With Appwrite Annotations, you only need to annotate your Python model classes, and the package will handle the rest, creating the corresponding collections and attributes in Appwrite. You just need to run a script as given below:
Key Features
- Automatically create collections and attributes in Appwrite based on Python class annotations.
- Support for a variety of attribute types, including
String,Integer,Float,Boolean,Datetime,Enum,Relationship,Email, andIP Address. - Define validation rules, default values, and constraints directly in your model classes.
- Handle both simple and complex attributes like arrays and relationships between collections.
Installation
pip install appwrite_annotations
How It Works
1. Define Your Model Classes
Write your model classes in Python and annotate their attributes using the provided classes from Appwrite Annotations.
2. Run the Script
Once the model classes are written, run the provided script to automatically sync your data models with Appwrite. The script will create collections and attributes based on the annotations in your Python classes.
Example Usage
1. Define Your Model Classe
from appwrite_annotations import StringAttribute, IntegerAttribute, BooleanAttribute
@dataclass
class Student:
student_id: IntegerAttribute = IntegerAttribute(attribute_key="studentId", required=True)
name: StringAttribute = StringAttribute(attribute_key="name", required=True, size=100)
age: IntegerAttribute = IntegerAttribute(attribute_key="age", required=True, min=18, max=100)
is_active: BooleanAttribute = BooleanAttribute(attribute_key="isActive", default=True)
Developed by Zia Ur Rahman
Metadata
Release files for appwrite-annotations 0.5.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| appwrite_annotations-0.5.0.tar.gz | 8.1 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| appwrite_annotations-0.5.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 20.3 kB
Release files / appwrite_annotations-0.5.0.tar.gz
| Download URL | appwrite_annotations-0.5.0.tar.gz |
|---|---|
| Size | 8.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
e96f66dd46c28555589e9505686962abde8980d268427353dd91126309d17828
|
|
BLAKE2b-256 checksum How to use checksums |
e0825282c99da44ce1974d3d884d98b1fc4381606251019cb53ee4db440bbeb0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.1 CPython/3.11.4
|
Release files / appwrite_annotations-0.5.0-py3-none-any.whl
| Download URL | appwrite_annotations-0.5.0-py3-none-any.whl |
|---|---|
| Size | 12.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
899e26d4aef22246d2c1d27b8e73cc498444712bd2a1bd4744a4ec3ee179e72b
|
|
BLAKE2b-256 checksum How to use checksums |
9345237b012156358b0d93b845a41a8a8b1a1a2786ec218f4e2588b92c8b18d7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.1 CPython/3.11.4
|
Security for appwrite-annotations 0.5.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.