Metadata-Version: 2.4
Name: quadratic-developer-api-client
Version: 0.26.1
Summary: Quadratic Developer API
Home-page: https://github.com/quadratichq/quadratic
Author: Quadratic
Author-email: Quadratic <team@quadratichq.com>
License: Apache-2.0
Project-URL: Repository, https://github.com/quadratichq/quadratic
Keywords: OpenAPI,OpenAPI-Generator,Quadratic Developer API
Requires-Python: >=3.10
Description-Content-Type: text/markdown
Requires-Dist: urllib3<3.0.0,>=2.1.0
Requires-Dist: python-dateutil>=2.8.2
Requires-Dist: pydantic>=2.11
Requires-Dist: typing-extensions>=4.7.1
Dynamic: author
Dynamic: home-page

# 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](https://openapi-generator.tech) 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:

```sh
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:
```python
import quadratic_developer_api
```

### Setuptools

Install via [Setuptools](http://pypi.python.org/pypi/setuptools).

```sh
python setup.py install --user
```
(or `sudo python setup.py install` to install the package for all users)

Then import the package:
```python
import quadratic_developer_api
```

### Tests

Execute `pytest` to run the tests.

## Getting Started

Please follow the [installation procedure](#installation--usage) and then run the following:

```python

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**](docs/AgentConnectionsApi.md#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**](docs/AgentConnectionsApi.md#list_agent_connections) | **GET** /v1/agent-connections | Lists the caller&#39;s team&#39;s ready agent connections.
*AuthApi* | [**get_me**](docs/AuthApi.md#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**](docs/CellsApi.md#delete_cells) | **DELETE** /v1/files/{file_id}/cells | Deletes the contents of every cell in the selection.
*CellsApi* | [**get_cells**](docs/CellsApi.md#get_cells) | **GET** /v1/files/{file_id}/cells | Reads cell values for a selection. Read-only; dispatches via &#x60;/mcp/query&#x60;.
*CellsApi* | [**get_code_cell**](docs/CellsApi.md#get_code_cell) | **GET** /v1/files/{file_id}/cells/code | Fetches the source and computed value of a single code cell.
*CellsApi* | [**get_dependencies**](docs/CellsApi.md#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**](docs/CellsApi.md#get_formats) | **GET** /v1/files/{file_id}/cells/formats | Reads cell formatting (font, color, alignment, etc.) for a selection.
*CellsApi* | [**has_cell_data**](docs/CellsApi.md#has_cell_data) | **GET** /v1/files/{file_id}/cells/has-data | Returns whether any cell in the selection contains data.
*CellsApi* | [**merge_cells**](docs/CellsApi.md#merge_cells) | **POST** /v1/files/{file_id}/cells/merge | Merges every cell in the selection into a single visual cell.
*CellsApi* | [**move_cells**](docs/CellsApi.md#move_cells) | **POST** /v1/files/{file_id}/cells/move | Moves a rectangular block of cells to a new location.
*CellsApi* | [**rerun_code**](docs/CellsApi.md#rerun_code) | **POST** /v1/files/{file_id}/cells/code/rerun | Triggers re-execution of code cells in the file (or selection).
*CellsApi* | [**set_borders**](docs/CellsApi.md#set_borders) | **PUT** /v1/files/{file_id}/cells/borders | Applies cell borders in batch.
*CellsApi* | [**set_cell_values**](docs/CellsApi.md#set_cell_values) | **PUT** /v1/files/{file_id}/cells | Writes a 2D block of values starting at &#x60;top_left_position&#x60;.
*CellsApi* | [**set_code_cell**](docs/CellsApi.md#set_code_cell) | **PUT** /v1/files/{file_id}/cells/code | Creates or updates a Python / JavaScript / Formula code cell.
*CellsApi* | [**set_formats**](docs/CellsApi.md#set_formats) | **PUT** /v1/files/{file_id}/cells/formats | Applies formatting to one or more cells in a single batch.
*CellsApi* | [**set_formula_cells**](docs/CellsApi.md#set_formula_cells) | **PUT** /v1/files/{file_id}/cells/formula | Writes one or more formula cells in a single batch.
*CellsApi* | [**set_sql_cell**](docs/CellsApi.md#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**](docs/CellsApi.md#unmerge_cells) | **DELETE** /v1/files/{file_id}/cells/merge | Splits previously-merged cells back into individual cells.
*ColumnsAndRowsApi* | [**delete_columns**](docs/ColumnsAndRowsApi.md#delete_columns) | **DELETE** /v1/files/{file_id}/columns | Deletes the named columns from the sheet.
*ColumnsAndRowsApi* | [**delete_rows**](docs/ColumnsAndRowsApi.md#delete_rows) | **DELETE** /v1/files/{file_id}/rows | Deletes the listed rows from the sheet.
*ColumnsAndRowsApi* | [**insert_columns**](docs/ColumnsAndRowsApi.md#insert_columns) | **POST** /v1/files/{file_id}/columns | Inserts one or more columns at the given position.
*ColumnsAndRowsApi* | [**insert_rows**](docs/ColumnsAndRowsApi.md#insert_rows) | **POST** /v1/files/{file_id}/rows | Inserts one or more rows at the given position.
*ColumnsAndRowsApi* | [**resize_columns**](docs/ColumnsAndRowsApi.md#resize_columns) | **PUT** /v1/files/{file_id}/columns/size | Resizes one or more columns to the given pixel width.
*ColumnsAndRowsApi* | [**resize_rows**](docs/ColumnsAndRowsApi.md#resize_rows) | **PUT** /v1/files/{file_id}/rows/size | Resizes one or more rows to the given pixel height.
*ColumnsAndRowsApi* | [**set_default_column_width**](docs/ColumnsAndRowsApi.md#set_default_column_width) | **PUT** /v1/files/{file_id}/columns/default-size | Sets the default width for columns that haven&#39;t been individually resized.
*ColumnsAndRowsApi* | [**set_default_row_height**](docs/ColumnsAndRowsApi.md#set_default_row_height) | **PUT** /v1/files/{file_id}/rows/default-size | Sets the default height for rows that haven&#39;t been individually resized.
*ConditionalFormatsApi* | [**get_conditional_formats**](docs/ConditionalFormatsApi.md#get_conditional_formats) | **GET** /v1/files/{file_id}/conditional-formats | Returns all conditional-format rules on a single sheet.
*ConditionalFormatsApi* | [**update_conditional_formats**](docs/ConditionalFormatsApi.md#update_conditional_formats) | **PUT** /v1/files/{file_id}/conditional-formats | Creates, updates, or deletes conditional-format rules on a sheet. Rules with &#x60;action: \&quot;delete\&quot;&#x60; only require the &#x60;id&#x60; field; &#x60;create&#x60; and &#x60;update&#x60; rules need a &#x60;selection&#x60; plus a formula (&#x60;rule&#x60;) or a &#x60;color_scale_thresholds&#x60; array.
*ConnectionsApi* | [**get_connection_schemas**](docs/ConnectionsApi.md#get_connection_schemas) | **POST** /v1/connections/schemas | Fetches DB schemas from the connection service. Unlike the other endpoints this doesn&#39;t require a worker — it talks directly to the &#x60;quadratic-connection&#x60; service.
*ContextOutlineSearchApi* | [**get_context**](docs/ContextOutlineSearchApi.md#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**](docs/ContextOutlineSearchApi.md#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**](docs/ContextOutlineSearchApi.md#read_data) | **GET** /v1/files/{file_id}/data | Reads a tabular slice of cell data, optimized for bulk consumption.
*ContextOutlineSearchApi* | [**text_search**](docs/ContextOutlineSearchApi.md#text_search) | **GET** /v1/files/{file_id}/search | Searches cell values (and optionally code-cell source) for matches.
*DocumentationApi* | [**openapi_spec**](docs/DocumentationApi.md#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 &#x60;/docs&#x60;.
*FilesApi* | [**create_file**](docs/FilesApi.md#create_file) | **POST** /v1/files | Creates a new blank file. If &#x60;team_uuid&#x60; is omitted the file is created in the team the caller&#39;s API token is scoped to.
*FilesApi* | [**get_file**](docs/FilesApi.md#get_file) | **GET** /v1/files/{file_id} | Fetches metadata for a single file by UUID.
*FilesApi* | [**import_into_file**](docs/FilesApi.md#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&#39;s import summary.
*FilesApi* | [**import_new_file**](docs/FilesApi.md#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**](docs/FilesApi.md#list_files) | **GET** /v1/files | Lists files visible to the caller across every team they belong to.
*HealthApi* | [**health**](docs/HealthApi.md#health) | **GET** /health | 
*HistoryApi* | [**batch**](docs/HistoryApi.md#batch) | **POST** /v1/files/{file_id}/batch | Executes a batch of actions sequentially, stopping on the first error. Mirrors the MCP &#x60;batch&#x60; semantics. The response is an array of &#x60;{action, result}&#x60; objects up to and including the failed action.
*HistoryApi* | [**redo**](docs/HistoryApi.md#redo) | **POST** /v1/files/{file_id}/redo | Re-applies the last &#x60;count&#x60; operations that were undone.
*HistoryApi* | [**undo**](docs/HistoryApi.md#undo) | **POST** /v1/files/{file_id}/undo | Reverts the last &#x60;count&#x60; operations on a file.
*SheetsApi* | [**add_sheet**](docs/SheetsApi.md#add_sheet) | **POST** /v1/files/{file_id}/sheets | Adds a new sheet to the file.
*SheetsApi* | [**color_sheets**](docs/SheetsApi.md#color_sheets) | **PATCH** /v1/files/{file_id}/sheets/colors | Recolors one or more sheet tabs in a single call.
*SheetsApi* | [**delete_sheet**](docs/SheetsApi.md#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**](docs/SheetsApi.md#duplicate_sheet) | **POST** /v1/files/{file_id}/sheets/duplicate | Duplicates an existing sheet under a new name.
*SheetsApi* | [**list_sheets**](docs/SheetsApi.md#list_sheets) | **GET** /v1/files/{file_id}/sheets | Returns info for all sheets, or a single sheet when &#x60;sheet_name&#x60; is provided. Read-only; dispatches via the worker&#39;s &#x60;/mcp/query&#x60; route.
*SheetsApi* | [**move_sheet**](docs/SheetsApi.md#move_sheet) | **POST** /v1/files/{file_id}/sheets/move | Reorders sheets within a file.
*SheetsApi* | [**rename_sheet**](docs/SheetsApi.md#rename_sheet) | **PATCH** /v1/files/{file_id}/sheets/{sheet_name} | Renames a sheet.
*TablesApi* | [**add_table**](docs/TablesApi.md#add_table) | **POST** /v1/files/{file_id}/tables | Creates a new data table on the given sheet.
*TablesApi* | [**convert_to_table**](docs/TablesApi.md#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**](docs/TablesApi.md#table_column_settings) | **PUT** /v1/files/{file_id}/tables/columns | Updates per-column settings (display name, sort, filter) on a table.
*TablesApi* | [**table_meta**](docs/TablesApi.md#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**](docs/ValidationsApi.md#add_list_validation) | **POST** /v1/files/{file_id}/validations/list | Adds a list-of-values validation. Either &#x60;list_source_list&#x60; or &#x60;list_source_selection&#x60; must be supplied (but not both).
*ValidationsApi* | [**add_logical_validation**](docs/ValidationsApi.md#add_logical_validation) | **POST** /v1/files/{file_id}/validations/logical | Adds a boolean (true/false) validation rule to a selection.
*ValidationsApi* | [**list_validations**](docs/ValidationsApi.md#list_validations) | **GET** /v1/files/{file_id}/validations | Lists all data-validation rules on a file (or one sheet).
*ValidationsApi* | [**remove_validation**](docs/ValidationsApi.md#remove_validation) | **DELETE** /v1/files/{file_id}/validations | Removes any data-validation rule(s) covering the given selection.


## Documentation For Models

 - [AddListValidationRequest](docs/AddListValidationRequest.md)
 - [AddLogicalValidationRequest](docs/AddLogicalValidationRequest.md)
 - [AddSheetRequest](docs/AddSheetRequest.md)
 - [AddTableRequest](docs/AddTableRequest.md)
 - [AgentConnectionDetail](docs/AgentConnectionDetail.md)
 - [AgentConnectionSecretBinding](docs/AgentConnectionSecretBinding.md)
 - [AgentConnectionSummary](docs/AgentConnectionSummary.md)
 - [BatchItem](docs/BatchItem.md)
 - [BatchRequest](docs/BatchRequest.md)
 - [ColorSheetEntry](docs/ColorSheetEntry.md)
 - [ColorSheetsRequest](docs/ColorSheetsRequest.md)
 - [ConvertToTableRequest](docs/ConvertToTableRequest.md)
 - [CreateFileRequest](docs/CreateFileRequest.md)
 - [CreateFileResponse](docs/CreateFileResponse.md)
 - [DeleteCellsRequest](docs/DeleteCellsRequest.md)
 - [DeleteColumnsRequest](docs/DeleteColumnsRequest.md)
 - [DeleteRowsRequest](docs/DeleteRowsRequest.md)
 - [DuplicateSheetRequest](docs/DuplicateSheetRequest.md)
 - [ErrorBody](docs/ErrorBody.md)
 - [ErrorDetail](docs/ErrorDetail.md)
 - [FileDetail](docs/FileDetail.md)
 - [FileSummary](docs/FileSummary.md)
 - [GetSchemasRequest](docs/GetSchemasRequest.md)
 - [HealthResponse](docs/HealthResponse.md)
 - [ImportIntoFileRequest](docs/ImportIntoFileRequest.md)
 - [ImportNewFileRequest](docs/ImportNewFileRequest.md)
 - [ImportNewFileResponse](docs/ImportNewFileResponse.md)
 - [InsertColumnsRequest](docs/InsertColumnsRequest.md)
 - [InsertRowsRequest](docs/InsertRowsRequest.md)
 - [MeResponse](docs/MeResponse.md)
 - [MergeCellsRequest](docs/MergeCellsRequest.md)
 - [MoveCellsRequest](docs/MoveCellsRequest.md)
 - [MoveSheetRequest](docs/MoveSheetRequest.md)
 - [RemoveValidationRequest](docs/RemoveValidationRequest.md)
 - [RenameSheetRequest](docs/RenameSheetRequest.md)
 - [RerunCodeRequest](docs/RerunCodeRequest.md)
 - [ResizeColumnsRequest](docs/ResizeColumnsRequest.md)
 - [ResizeRowsRequest](docs/ResizeRowsRequest.md)
 - [SetBordersRequest](docs/SetBordersRequest.md)
 - [SetCellValuesRequest](docs/SetCellValuesRequest.md)
 - [SetCodeCellRequest](docs/SetCodeCellRequest.md)
 - [SetDefaultSizeRequest](docs/SetDefaultSizeRequest.md)
 - [SetFormatsRequest](docs/SetFormatsRequest.md)
 - [SetFormulaCellsRequest](docs/SetFormulaCellsRequest.md)
 - [SetSqlCellRequest](docs/SetSqlCellRequest.md)
 - [TableColumnSettingsRequest](docs/TableColumnSettingsRequest.md)
 - [TableMetaRequest](docs/TableMetaRequest.md)
 - [UndoRedoRequest](docs/UndoRedoRequest.md)
 - [UpdateConditionalFormatsRequest](docs/UpdateConditionalFormatsRequest.md)


<a id="documentation-for-authorization"></a>
## Documentation For Authorization


Authentication schemes defined for the API:
<a id="bearer_auth"></a>
### bearer_auth

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


## Author




