quadratic icon indicating copy to clipboard operation
quadratic copied to clipboard

Public API & making client libraries possible

Open luke-quadratic opened this issue 1 year ago • 1 comments

Simplest possible but extremely useful Python client spec.

Discussion point & important to this issue - what changes would need to be made to the existing Quadratic API to allow creation of a client library/endpoint access in what follows:

As example Python client library run_project(sheet_id, api_key) - runs all cells in sheet run_cell(sheet_id, cell, api_key) - runs specific cell in sheet get_table(sheet_id, api_key, ((0,0),(2,20))) - gets data from range of cells in sheet post_table(sheet_id, api_key, df) - posts data to range of cells in sheet

As url endpoints

curl "https://api.airtable.com/get-table/{sheet_id}" \
-H "Authorization: Bearer API_KEY"

curl "https://api.quadratichq.com/post-table/{sheet_id}" \
-H "Authorization: Bearer API_KEY"
'{
    "records": [
      {
        "fields": {
          "column1": value,
          "column2": value,
          "column3": "value"
        },
      },
      {
        "fields": {
          "column1": value,
          "column2": value,
          "column3": "value"
        },
      },
    ]
  }'

Image

luke-quadratic avatar Nov 30 '23 22:11 luke-quadratic

fwiw, and I'm sure you were thinking this anyways, I could totally see my python code looking like:

import quadratic as q

q.auth(...)

N-Demir avatar Apr 23 '24 21:04 N-Demir