Skip to main content

Type-safe Python SDK for the AppFlowy Cloud REST API

Project description

AppFlowy SDK

Type-safe Python SDK for the AppFlowy Cloud REST API.

Installation

pip install appflowysdk 
## or
uv add appflowysdk

Quick Start

from appflowy import AppFlowy

with AppFlowy(email="user@example.com", password="password") as client:
    # Authenticate
    token = client.login()
    print(f"Logged in, token expires in {token.expires_in}s")

    # List workspaces
    workspaces = client.get_workspaces(include_member_count=True)
    for ws in workspaces:
        print(f"{ws.workspace_name} ({ws.workspace_id})")

    # Get folder structure
    folder = client.get_workspace_folder(workspaces[0].workspace_id)

    # List databases
    databases = client.get_databases(workspaces[0].workspace_id)

    # Get database fields
    fields = client.get_database_fields(
        workspaces[0].workspace_id, databases[0].id
    )

    # Get row IDs
    rows = client.get_database_row_ids(
        workspaces[0].workspace_id, databases[0].id
    )

    # Get row details
    if rows:
        details = client.get_database_row_details(
            workspaces[0].workspace_id,
            databases[0].id,
            [rows[0].id],
            with_doc=True,
        )

    # Create a row
    row_id = client.create_database_row(
        workspaces[0].workspace_id,
        databases[0].id,
        cells={"field_id": "value"},
    )

    # Upsert a row
    row_id = client.upsert_database_row(
        workspaces[0].workspace_id,
        databases[0].id,
        pre_hash="unique-key",
        cells={"field_id": "value"},
    )

OAuth

client = AppFlowy()
token = client.oauth_redirect_token(
    code="auth_code_from_redirect",
    grant_type="authorization_code",
)

Error Handling

All SDK errors inherit from AppFlowyError:

from src.exception import (
    AppFlowyError,
    LoginError,
    RefreshTokenError,
    APIError,
    ValidationError,
    NetworkError,
)

API Reference

Method Endpoint Description
login() POST /gotrue/token?grant_type=password Password auth
refresh_token() POST /gotrue/token?grant_type=refresh_token Refresh token
oauth_redirect_token() GET /web-api/oauth-redirect/token OAuth token exchange
get_workspaces() GET /api/workspace List workspaces
get_workspace_folder() GET /api/workspace/{id}/folder Get folder tree
get_databases() GET /api/workspace/{id}/database List databases
get_database_fields() GET /api/workspace/{id}/database/{id}/fields List fields
get_database_row_ids() GET /api/workspace/{id}/database/{id}/row List row IDs
create_database_row() POST /api/workspace/{id}/database/{id}/row Create row
upsert_database_row() PUT /api/workspace/{id}/database/{id}/row Upsert row
get_database_row_ids_updated() GET /api/workspace/{id}/database/{id}/row/updated Updated rows
get_database_row_details() GET /api/workspace/{id}/database/{id}/row/detail Row details

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

appflowysdk-0.1.1.tar.gz (8.9 kB view details)

Uploaded Source

Built Distribution

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

appflowysdk-0.1.1-py3-none-any.whl (9.6 kB view details)

Uploaded Python 3

File details

Details for the file appflowysdk-0.1.1.tar.gz.

File metadata

  • Download URL: appflowysdk-0.1.1.tar.gz
  • Upload date:
  • Size: 8.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for appflowysdk-0.1.1.tar.gz
Algorithm Hash digest
SHA256 ce80e78c96a36383216eb9489690cede3d2c71b5639bb862387fd12926fdf451
MD5 23b16a5732e70950b90bef7bca99c41c
BLAKE2b-256 e4550f2542ae0d3782c2d28b6db20dd2a7ac48d7bf7ffbdcabec69d1b4f92e54

See more details on using hashes here.

File details

Details for the file appflowysdk-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: appflowysdk-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 9.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for appflowysdk-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 29e88a6433f1ba74684f7c9ffe2b8acba02feeea9123b1800062ee8b1d200034
MD5 74fb4fa9461d351680a3e501257302fd
BLAKE2b-256 f1f27381efe147e4c81695e116fbde3d3fbe7478e00b2f5fcb69258acd27751c

See more details on using hashes here.

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