Skip to main content

Quadratic Developer API

Project description

quadratic-developer-api-client

Token-authenticated REST API for Quadratic spreadsheets. All /v1/* routes require an Authorization: Bearer <token> header where the token is a qdx_live_… or qdx_test_… value minted from the Quadratic UI.

Optional Quadratic-Session-Id header. Clients may attach a UUID v4 to every request to correlate analytics events from a single integration run (one client instance, one CLI invocation, one CI job). Official SDKs generate one at construction and send it transparently; direct callers may omit it. Malformed values are dropped silently and never propagated to analytics.

This Python package is automatically generated by the OpenAPI Generator project:

  • API version: 0.26.1
  • Package version: 0.26.1
  • Generator version: 7.22.0
  • Build package: org.openapitools.codegen.languages.PythonClientCodegen

Requirements.

Python 3.10+

Installation & Usage

pip install

If the python package is hosted on a repository, you can install directly using:

pip install git+https://github.com/quadratichq/quadratic.git

(you may need to run pip with root permission: sudo pip install git+https://github.com/quadratichq/quadratic.git)

Then import the package:

import quadratic_developer_api

Setuptools

Install via Setuptools.

python setup.py install --user

(or sudo python setup.py install to install the package for all users)

Then import the package:

import quadratic_developer_api

Tests

Execute pytest to run the tests.

Getting Started

Please follow the installation procedure and then run the following:

import quadratic_developer_api
from quadratic_developer_api.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to http://localhost
# See configuration.py for a list of all supported configuration parameters.
configuration = quadratic_developer_api.Configuration(
    host = "http://localhost"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

# Configure Bearer authorization (API token (qdx_live_… or qdx_test_…)): bearer_auth
configuration = quadratic_developer_api.Configuration(
    access_token = os.environ["BEARER_TOKEN"]
)


# Enter a context with an instance of the API client
with quadratic_developer_api.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = quadratic_developer_api.AgentConnectionsApi(api_client)
    connection_id = UUID('38400000-8cf0-11bd-b23e-10b96e4ef00d') # UUID | Agent connection UUID
    team_uuid = UUID('38400000-8cf0-11bd-b23e-10b96e4ef00d') # UUID | Team UUID that owns the connections. Defaults to the caller's token-scoped team when omitted. (optional)

    try:
        # Fetches a single agent connection by UUID, including its full plan and apiSchema.
        api_response = api_instance.get_agent_connection(connection_id, team_uuid=team_uuid)
        print("The response of AgentConnectionsApi->get_agent_connection:\n")
        pprint(api_response)
    except ApiException as e:
        print("Exception when calling AgentConnectionsApi->get_agent_connection: %s\n" % e)

Documentation for API Endpoints

All URIs are relative to http://localhost

Class Method HTTP request Description
AgentConnectionsApi get_agent_connection GET /v1/agent-connections/{connection_id} Fetches a single agent connection by UUID, including its full plan and apiSchema.
AgentConnectionsApi list_agent_connections GET /v1/agent-connections Lists the caller's team's ready agent connections.
AuthApi get_me GET /v1/auth/me Returns identity information derived from the API token that authorized this request. Useful for verifying a token works and discovering which team it belongs to.
CellsApi delete_cells DELETE /v1/files/{file_id}/cells Deletes the contents of every cell in the selection.
CellsApi get_cells GET /v1/files/{file_id}/cells Reads cell values for a selection. Read-only; dispatches via `/mcp/query`.
CellsApi get_code_cell GET /v1/files/{file_id}/cells/code Fetches the source and computed value of a single code cell.
CellsApi get_dependencies GET /v1/files/{file_id}/cells/dependencies Lists the formula / code-cell dependencies that flow into or out of the given position.
CellsApi get_formats GET /v1/files/{file_id}/cells/formats Reads cell formatting (font, color, alignment, etc.) for a selection.
CellsApi has_cell_data GET /v1/files/{file_id}/cells/has-data Returns whether any cell in the selection contains data.
CellsApi merge_cells POST /v1/files/{file_id}/cells/merge Merges every cell in the selection into a single visual cell.
CellsApi move_cells POST /v1/files/{file_id}/cells/move Moves a rectangular block of cells to a new location.
CellsApi rerun_code POST /v1/files/{file_id}/cells/code/rerun Triggers re-execution of code cells in the file (or selection).
CellsApi set_borders PUT /v1/files/{file_id}/cells/borders Applies cell borders in batch.
CellsApi set_cell_values PUT /v1/files/{file_id}/cells Writes a 2D block of values starting at `top_left_position`.
CellsApi set_code_cell PUT /v1/files/{file_id}/cells/code Creates or updates a Python / JavaScript / Formula code cell.
CellsApi set_formats PUT /v1/files/{file_id}/cells/formats Applies formatting to one or more cells in a single batch.
CellsApi set_formula_cells PUT /v1/files/{file_id}/cells/formula Writes one or more formula cells in a single batch.
CellsApi set_sql_cell PUT /v1/files/{file_id}/cells/sql Creates or updates a SQL code cell backed by a registered connection.
CellsApi unmerge_cells DELETE /v1/files/{file_id}/cells/merge Splits previously-merged cells back into individual cells.
ColumnsAndRowsApi delete_columns DELETE /v1/files/{file_id}/columns Deletes the named columns from the sheet.
ColumnsAndRowsApi delete_rows DELETE /v1/files/{file_id}/rows Deletes the listed rows from the sheet.
ColumnsAndRowsApi insert_columns POST /v1/files/{file_id}/columns Inserts one or more columns at the given position.
ColumnsAndRowsApi insert_rows POST /v1/files/{file_id}/rows Inserts one or more rows at the given position.
ColumnsAndRowsApi resize_columns PUT /v1/files/{file_id}/columns/size Resizes one or more columns to the given pixel width.
ColumnsAndRowsApi resize_rows PUT /v1/files/{file_id}/rows/size Resizes one or more rows to the given pixel height.
ColumnsAndRowsApi set_default_column_width PUT /v1/files/{file_id}/columns/default-size Sets the default width for columns that haven't been individually resized.
ColumnsAndRowsApi set_default_row_height PUT /v1/files/{file_id}/rows/default-size Sets the default height for rows that haven't been individually resized.
ConditionalFormatsApi get_conditional_formats GET /v1/files/{file_id}/conditional-formats Returns all conditional-format rules on a single sheet.
ConditionalFormatsApi update_conditional_formats PUT /v1/files/{file_id}/conditional-formats Creates, updates, or deletes conditional-format rules on a sheet. Rules with `action: &quot;delete&quot;` only require the `id` field; `create` and `update` rules need a `selection` plus a formula (`rule`) or a `color_scale_thresholds` array.
ConnectionsApi get_connection_schemas POST /v1/connections/schemas Fetches DB schemas from the connection service. Unlike the other endpoints this doesn't require a worker — it talks directly to the `quadratic-connection` service.
ContextOutlineSearchApi get_context GET /v1/files/{file_id}/context Returns a worker-built context blob (summary of sheets, tables, named ranges, etc.) suitable for feeding to LLMs.
ContextOutlineSearchApi get_outline GET /v1/files/{file_id}/outline Returns a structural outline of the file: sheets, named ranges, tables, and code cells.
ContextOutlineSearchApi read_data GET /v1/files/{file_id}/data Reads a tabular slice of cell data, optimized for bulk consumption.
ContextOutlineSearchApi text_search GET /v1/files/{file_id}/search Searches cell values (and optionally code-cell source) for matches.
DocumentationApi openapi_spec GET /openapi.json Serves the raw OpenAPI 3.1 spec for the developer API. The same spec is rendered as interactive HTML at `/docs`.
FilesApi create_file POST /v1/files Creates a new blank file. If `team_uuid` is omitted the file is created in the team the caller's API token is scoped to.
FilesApi get_file GET /v1/files/{file_id} Fetches metadata for a single file by UUID.
FilesApi import_into_file POST /v1/files/{file_id}/import Imports bytes into an existing file. The file is updated in place; the response is the worker's import summary.
FilesApi import_new_file POST /v1/files/import REST-only convenience endpoint that creates a new blank file and imports the given bytes into it in a single request.
FilesApi list_files GET /v1/files Lists files visible to the caller across every team they belong to.
HealthApi health GET /health
HistoryApi batch POST /v1/files/{file_id}/batch Executes a batch of actions sequentially, stopping on the first error. Mirrors the MCP `batch` semantics. The response is an array of `{action, result}` objects up to and including the failed action.
HistoryApi redo POST /v1/files/{file_id}/redo Re-applies the last `count` operations that were undone.
HistoryApi undo POST /v1/files/{file_id}/undo Reverts the last `count` operations on a file.
SheetsApi add_sheet POST /v1/files/{file_id}/sheets Adds a new sheet to the file.
SheetsApi color_sheets PATCH /v1/files/{file_id}/sheets/colors Recolors one or more sheet tabs in a single call.
SheetsApi delete_sheet DELETE /v1/files/{file_id}/sheets/{sheet_name} Deletes a sheet by name. Files must always have at least one sheet, so the worker will reject deleting the last remaining sheet.
SheetsApi duplicate_sheet POST /v1/files/{file_id}/sheets/duplicate Duplicates an existing sheet under a new name.
SheetsApi list_sheets GET /v1/files/{file_id}/sheets Returns info for all sheets, or a single sheet when `sheet_name` is provided. Read-only; dispatches via the worker's `/mcp/query` route.
SheetsApi move_sheet POST /v1/files/{file_id}/sheets/move Reorders sheets within a file.
SheetsApi rename_sheet PATCH /v1/files/{file_id}/sheets/{sheet_name} Renames a sheet.
TablesApi add_table POST /v1/files/{file_id}/tables Creates a new data table on the given sheet.
TablesApi convert_to_table POST /v1/files/{file_id}/tables/from-range Converts a plain range of cells into a structured data table.
TablesApi table_column_settings PUT /v1/files/{file_id}/tables/columns Updates per-column settings (display name, sort, filter) on a table.
TablesApi table_meta PATCH /v1/files/{file_id}/tables Updates table-level metadata (name, header visibility, alternating row colors, etc.). Only the fields you supply are changed.
ValidationsApi add_list_validation POST /v1/files/{file_id}/validations/list Adds a list-of-values validation. Either `list_source_list` or `list_source_selection` must be supplied (but not both).
ValidationsApi add_logical_validation POST /v1/files/{file_id}/validations/logical Adds a boolean (true/false) validation rule to a selection.
ValidationsApi list_validations GET /v1/files/{file_id}/validations Lists all data-validation rules on a file (or one sheet).
ValidationsApi remove_validation DELETE /v1/files/{file_id}/validations Removes any data-validation rule(s) covering the given selection.

Documentation For Models

Documentation For Authorization

Authentication schemes defined for the API:

bearer_auth

  • Type: Bearer authentication (API token (qdx_live_… or qdx_test_…))

Author

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

quadratic_developer_api_client-0.26.1.tar.gz (76.7 kB view details)

Uploaded Source

Built Distribution

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

quadratic_developer_api_client-0.26.1-py3-none-any.whl (158.6 kB view details)

Uploaded Python 3

File details

Details for the file quadratic_developer_api_client-0.26.1.tar.gz.

File metadata

File hashes

Hashes for quadratic_developer_api_client-0.26.1.tar.gz
Algorithm Hash digest
SHA256 02814f54436e95b29eb116da08ce55b357115006a3191a5a9cff187f0a8c7565
MD5 393fd73bc3ad979b05ff6ba112d287b1
BLAKE2b-256 c6d9df84014c3cedf9dce61fde6462c7eb0edd12190937bfa690bbceb9388525

See more details on using hashes here.

File details

Details for the file quadratic_developer_api_client-0.26.1-py3-none-any.whl.

File metadata

File hashes

Hashes for quadratic_developer_api_client-0.26.1-py3-none-any.whl
Algorithm Hash digest
SHA256 193a862d615ee203f09b1e16cec2978a6b19280219330cb43c9ab6b8ded998b7
MD5 c6b05509218aa03c714d61cb88ce79aa
BLAKE2b-256 41593d71d052a04808281ec501cffe55760bed263ca1f0b1deca216886a084c5

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