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.2.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.2-py3-none-any.whl (9.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: appflowysdk-0.1.2.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.2.tar.gz
Algorithm Hash digest
SHA256 bc5a0d774e5a5b15de21ef9e27718576dad3ac2994dfeeaddb018d0a1eb7245e
MD5 92d787077a57f45420938e1402286097
BLAKE2b-256 93fa33d5e77c5248bc5ba6129b846e48a69f3499d4ec4fc89165ebf74f433f31

See more details on using hashes here.

File details

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

File metadata

  • Download URL: appflowysdk-0.1.2-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.2-py3-none-any.whl
Algorithm Hash digest
SHA256 5feffc8827f95628644bb732e2aec5a92c2b5160c02d824cee737c2023df7573
MD5 7cb0eb3f47ca922c68f3b6dec881d186
BLAKE2b-256 6ffe82b6f40769814bc2e6779041bfa95ae0dffa9eb6661303f5930041bbbf21

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