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.dev5.tar.gz (18.5 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.dev5-py3-none-any.whl (17.0 kB view details)

Uploaded Python 3

File details

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

File metadata

File hashes

Hashes for collab_editor_provider-0.1.0.dev5.tar.gz
Algorithm Hash digest
SHA256 9ff3860a333a010bef2009e16e2aa609bd90683bf079d43159767015467f0a13
MD5 cb6125814ee1061edd2429e111dd5859
BLAKE2b-256 78db44e23bdeced3afb340e8560cbf6da1570beec28acdb9c77956f9f52a9185

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for collab_editor_provider-0.1.0.dev5-py3-none-any.whl
Algorithm Hash digest
SHA256 d615d022998420ec84d2051ee20ba3a08eb83fa9931806023a81c5b686bbd7c0
MD5 289b5781864cd6af1709acadcaaa9adc
BLAKE2b-256 f0ebb52adf8819dabbc8dd6f5de98d3f6b91c28649aadcfc7c025e725304a4c5

See more details on using hashes here.

Provenance

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