Skip to main content

Python SDK for implementing collab-editor storage providers

Project description

collab-editor-provider

Python SDK for implementing collab-editor storage providers.

Installation

pip install collab-editor-provider

With FastAPI support:

pip install collab-editor-provider[fastapi]

For the latest dev build (published on every push to main):

pip install --pre collab-editor-provider

Quick Start

from collab_editor_provider import Provider, ContentResult, create_fastapi_router, serve
from fastapi import FastAPI

class MyProvider(Provider):
    async def read_content(self, document_id: str) -> ContentResult:
        text = read_from_your_storage(document_id)
        return ContentResult(content=text, mime_type="text/plain")

    async def write_content(self, document_id: str, content: str, mime_type: str) -> None:
        save_to_your_storage(document_id, content)

# Option 1: FastAPI router
app = FastAPI()
app.include_router(create_fastapi_router(MyProvider()), prefix="/collab")

# Option 2: Standalone server
serve(MyProvider(), port=8081)

# Option 3: Manual processing
from collab_editor_provider import ProviderProcessor
processor = ProviderProcessor(MyProvider())
result = await processor.process_store(document_id, updates)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

collab_editor_provider-0.1.0.dev3.tar.gz (11.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

collab_editor_provider-0.1.0.dev3-py3-none-any.whl (10.7 kB view details)

Uploaded Python 3

File details

Details for the file collab_editor_provider-0.1.0.dev3.tar.gz.

File metadata

File hashes

Hashes for collab_editor_provider-0.1.0.dev3.tar.gz
Algorithm Hash digest
SHA256 144cbf55d3bb86ab033440a040656f3c6eb3316a699b92b9ed9dc6bcb4b1e664
MD5 3242b01184537481c7d6a401aaedf402
BLAKE2b-256 ad3656b61188e5cdb90866701ef14d0b5656e5275937e0624be518e848610844

See more details on using hashes here.

Provenance

The following attestation bundles were made for collab_editor_provider-0.1.0.dev3.tar.gz:

Publisher: pypi-publish.yml on imyousuf/collab-editor

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file collab_editor_provider-0.1.0.dev3-py3-none-any.whl.

File metadata

File hashes

Hashes for collab_editor_provider-0.1.0.dev3-py3-none-any.whl
Algorithm Hash digest
SHA256 a55bddc90cdc9026cadce4f29efce6b8bc6242a42cb406a56c81f1c49ae6d511
MD5 f080db0dd5cef7d59ae8c301aec5d7ed
BLAKE2b-256 f0562e0414cc6f5bc60d1c028d593eed191ce17dcaba6ae39d73c7ad287ee663

See more details on using hashes here.

Provenance

The following attestation bundles were made for collab_editor_provider-0.1.0.dev3-py3-none-any.whl:

Publisher: pypi-publish.yml on imyousuf/collab-editor

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page