athena-python-xlsx
Drop-in replacement for openpyxl that connects to XLSX Studio for real-time collaboration.
Installation
pip install athena-python-xlsx
Quick Start
from openpyxl import Workbook
from openpyxl.styles import Font, PatternFill, Alignment
# Create a new workbook
wb = Workbook.create(name="Sales Report")
ws = wb.active
# Headers
headers = ["Product", "Q1", "Q2", "Q3", "Q4", "Total"]
for col, header in enumerate(headers, 1):
cell = ws.cell(row=1, column=col, value=header)
cell.font = Font(bold=True, size=12)
cell.fill = PatternFill(fgColor="4472C4")
cell.alignment = Alignment(horizontal="center")
# Data
data = [
["Widget A", 150, 200, 180, 220],
["Widget B", 300, 280, 350, 400],
["Widget C", 100, 120, 90, 110],
]
for row_idx, row_data in enumerate(data, 2):
for col_idx, value in enumerate(row_data, 1):
ws.cell(row=row_idx, column=col_idx, value=value)
# Total formula
ws.cell(row=row_idx, column=6, value=f"=SUM(B{row_idx}:E{row_idx})")
# Column widths
ws.column_dimensions['A'].width = 15
# Save
wb.save("sales_report.xlsx")
Configuration
Set these environment variables:
export ATHENA_XLSX_BASE_URL=https://api.xlsx-studio.com
export ATHENA_XLSX_API_KEY=your-api-key # optional
Or pass them directly:
wb = Workbook(workbook_id="wb_123", base_url="https://api.xlsx-studio.com")
Athena Assets
To connect to an existing Athena spreadsheet asset, pass the org_id parameter:
wb = Workbook(
workbook_id="asset_5a9fbe63-a63f-4ba3-8d3d-11231bbb67dc",
base_url="https://api.xlsx-studio.com",
org_id="workspace_5fd97d12-eda1-4191-82e5-b6fe5cb61dcc",
)
ws = wb.active
ws['A1'] = "Hello from Python!"
wb.close() # Flushes changes
How It Works
This SDK implements the openpyxl API surface as a proxy layer over the XLSX Studio API:
- Read path:
GET /workbooks/{id}/snapshot→ JSON → Python proxy objects (Workbook, Worksheet, Cell) - Write path: Property setter → Command dataclass → CommandBuffer →
POST /workbooks/{id}/commands→ server applies to Yjs Y.Doc - Export path:
POST /workbooks/{id}/export→ server rebuilds XLSX from Y.Doc → download
Changes are applied in real-time via Yjs, so other users see edits instantly in the browser.
API Compatibility
| Feature | Status |
|---|---|
| Cell values (str, int, float, bool) | ✅ |
| Formulas | ✅ |
| Cell styles (Font, Fill, Border, Alignment) | ✅ |
| Number formats | ✅ |
| Column widths / Row heights | ✅ |
| Merged cells | ✅ |
| Insert/Delete rows/columns | ✅ |
| Freeze panes | ✅ |
| Auto-filter | ✅ |
| Sheet operations (add, remove, rename, copy) | ✅ |
| Workbook properties | ✅ |
| Charts | 🚧 Planned |
| Images | 🚧 Planned |
| Conditional formatting | 🚧 Planned |
| Data validation | 🚧 Planned |
| Pivot tables | 🚧 Planned |
Batch Operations
By default, commands are auto-batched with a 2-second debounce timer. For explicit control:
# Explicit batch - all commands sent in one request
with wb.batch():
for row in range(1, 1001):
ws.cell(row=row, column=1, value=f"Row {row}")
Metadata
Release files for athena-python-xlsx 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| athena_python_xlsx-0.1.0.tar.gz | 25.0 kB | Without provenance | Details for athena_python_xlsx-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| athena_python_xlsx-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for athena_python_xlsx-0.1.0-py3-none-any.whl |
Total release size: 53.2 kB
Release files / athena_python_xlsx-0.1.0.tar.gz
| Download URL | athena_python_xlsx-0.1.0.tar.gz |
|---|---|
| Size | 25.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
99a98b00013757e4c3bbdd4e134693b0538b03acc3f660b5a42a913667fcd156
|
|
BLAKE2b-256 checksum How to use checksums |
49ae1dff8ccc3bca89f6e0aa39f3fd81cdae56f4fdf0d46db90ac414e2047f40
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.6
|
Release files / athena_python_xlsx-0.1.0-py3-none-any.whl
| Download URL | athena_python_xlsx-0.1.0-py3-none-any.whl |
|---|---|
| Size | 28.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
6eb2b0f2b041c1ce1f4a1d64249a242c5b30d8b746f138f3398bec993c701a63
|
|
BLAKE2b-256 checksum How to use checksums |
3cbed67cca4b9a441878a30d64dd73baa6338a75d5f9ae509f17d141127b1e3f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.6
|
Security for athena-python-xlsx 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.