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.dev4.tar.gz (18.3 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.dev4-py3-none-any.whl (16.9 kB view details)

Uploaded Python 3

File details

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

File metadata

File hashes

Hashes for collab_editor_provider-0.1.0.dev4.tar.gz
Algorithm Hash digest
SHA256 d61787f31c0e3655e5624991da29f68de5f5d75496a2a067037fc4eaf2bdb363
MD5 c5bf2bd462ffe8a7f01feffaef0ebdf5
BLAKE2b-256 ca7a0b9b6169e7d75d746ca6d83361e45e27ec3ad2d24ca0650e19b3657140b5

See more details on using hashes here.

Provenance

The following attestation bundles were made for collab_editor_provider-0.1.0.dev4.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.dev4-py3-none-any.whl.

File metadata

File hashes

Hashes for collab_editor_provider-0.1.0.dev4-py3-none-any.whl
Algorithm Hash digest
SHA256 fe94cb7d88c7d2069d626f3963aaeb67f0872fb7698b2412351a7867990fafbe
MD5 73fa741f8a51c00f64470af7cbb651b6
BLAKE2b-256 0aa8e3193385dcd0db85961f588f164b26bcb06483db09e97b9180d5c7175edd

See more details on using hashes here.

Provenance

The following attestation bundles were made for collab_editor_provider-0.1.0.dev4-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