Skip to main content

Here is the updated full README.md with all relevant sections, including installation from PyPI and TestPyPI, publishing instructions, developer mode, and licensing.


📄 Final README.md for appwrite-sync

# appwrite-sync

**`appwrite-sync`** is a CLI tool to automate the creation and synchronization of Appwrite database collections from a JSON schema. It's designed for developers who want to version and manage their Appwrite collections in a clean and repeatable way—ideal for CI/CD, team collaboration, and structured schema design.

---

## 🚀 Features

- 🔁 Sync collections, attributes, relationships, and indexes
- 📁 Reads from a single `schema.json` definition
- ⚙️ Supports all common attribute types including `string`, `enum`, `relationship`
- ✅ Idempotent: avoids duplication and handles existing resources gracefully
- 🛠 CLI-first: easily scriptable and automatable
- 📦 Packaged and installable from PyPI

---

## 📦 Installation

### From PyPI

```bash
pip install appwrite-sync

From TestPyPI (optional testing)

pip install --index-url https://test.pypi.org/simple/ appwrite-sync

🧰 Usage

1. Initialize a Folder

Generate a sample .env file and schema.json template in your current directory:

appwrite-sync init

2. Configure .env

ENDPOINT=http://localhost/v1
PROJECT_ID=your-project-id
DB_ID=your-database-id
API_KEY=your-appwrite-api-key

3. Define Your Schema

Edit schema.json to define collections, attributes, and indexes. Example:

{
  "users": {
    "name": "Users",
    "attributes": {
      "email": {
        "type": "email",
        "required": true
      },
      "role": {
        "type": "enum",
        "required": true,
        "elements": ["admin", "user"]
      }
    },
    "indexes": [
      {
        "key": "unique_email",
        "type": "unique",
        "attributes": ["email"]
      }
    ]
  }
}

4. Sync to Appwrite

Make sure your .env is sourced:

source .env

Then run:

appwrite-sync sync

Or pass DB ID directly:

appwrite-sync sync --db-id your-db-id

✅ Supported Attribute Types

  • string, email, url, integer, boolean, datetime
  • enum with elements
  • relationship with relatedCollection, relationType, and twoWay

🧪 Development (Editable Install)

git clone https://github.com/aboidrees/appwrite-sync.git
cd appwrite-sync
pip install -e . --config-settings editable_mode=compat

📤 How to Publish to PyPI

Step 1: Build the package

python -m build

Step 2: Upload to PyPI

twine upload dist/*

To upload to TestPyPI instead:

twine upload --repository-url https://test.pypi.org/legacy/ dist/*

Step 3: Install from PyPI

pip install appwrite-sync

🧾 License

This project is licensed under the MIT License. See the LICENSE file for full details.


👨‍💻 Author

Developed by [Muhammad Yousif]

GitHub: https://github.com/aboidrees


---

Would you like me to also generate a matching `LICENSE` file now? If so, let me know what name you want to appear in the copyright.

Metadata

Release files for appwrite-sync 0.4.5

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for appwrite-sync 0.4.5
File Size Uploaded Provenance Actions
appwrite_sync-0.4.5.tar.gz 3.1 kB Without provenance Details for appwrite_sync-0.4.5.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for appwrite-sync 0.4.5
File Interpreter ABI Platform Actions
appwrite_sync-0.4.5-py3-none-any.whl Python 3 none any Details for appwrite_sync-0.4.5-py3-none-any.whl

Total release size: 6.1 kB

Release files / appwrite_sync-0.4.5.tar.gz

Download URL appwrite_sync-0.4.5.tar.gz
Size 3.1 kB
Tags Source
SHA-256 checksum
How to use checksums
52c0bf8fc88f5a5b0289f90f41e8fa567cd79f4341951a031f32c67c3100a488
BLAKE2b-256 checksum
How to use checksums
7bc97ac6accc3efcf8d4e4fb788bd7a3aa79c889726afa32da00d61fde1ed5da
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.9.22

Release files / appwrite_sync-0.4.5-py3-none-any.whl

Download URL appwrite_sync-0.4.5-py3-none-any.whl
Size 3.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
9ef5baa81ad0d419fb3f8c07156dcf1f50e5d9da1fd52ae177aa4ca921575edc
BLAKE2b-256 checksum
How to use checksums
ab287d8c98e2af953b74b1aca278df5137e419716bb5d01a98b1b0bfae1a63f2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.9.22

Security for appwrite-sync 0.4.5

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.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.4.5 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page