Skip to main content

mgtx-xlwings-utils

Package-first xlwings and pandas helpers for Excel automation workflows at MeiraGTx.


What's new

0.2.3 — Fixes dropdown validation on paste when the dropdown's option source is a defined name (e.g. =valid_dropdown): the name is now resolved to its actual options instead of being mistaken for the only allowed value, which rejected every paste into that column.

0.2.2 — Pins xlwings to ==0.32.1 (was >=0.30) so a fresh install matches the validated release environment instead of pulling the latest xlwings (0.35.0). No API changes.

0.2.1 — The post-save prompt is now a public function, offer_file_actions, with a new Copy file path button and an actions= argument to choose which of Open file / Open folder / Copy file path appear (save_dataframe(..., actions=...) forwards the same choice). Copying the path leaves the dialog open so you can still open the file or its folder; those close it. The copy now writes through the OS clipboard so it persists after the window closes.

0.2.0 — A formatting + dropdowns release. apply_table_features / apply_benchling_table_features apply column colours, prefill rows, and in-cell dropdowns in one call (Benchling enum columns become dropdowns automatically); paste_df_to_named_range is now format-preserving (borders="mesh"); paste_plate_data refreshes a plate without redrawing. Includes breaking renames/removals — see the changelog.

Full history: CHANGELOG.md.


Install

pip install mgtx-xlwings-utils

# With Benchling integration:
pip install "mgtx-xlwings-utils[benchling]"

For local development (editable install with test + build tooling):

pip install -e ".[dev]"

Python requirement: >=3.10.11,<4.0


Documentation

🌐 Live docs site: https://mgtx-data-science.github.io/xlwings_package/  ·  source: docs/index.md  ·  also mirrored on the GitHub Wiki.

Every guide is full-lifecycle — initialise → paste data in → read it back out → update → format → save — with inline Excel-grid diagrams showing exactly what to highlight and what each step does to the sheet.

Scenario guides

Understand the engine

  • Stacked tables & Benchling reinitialise — how managed tables stack (disjoint rows, danger zone, auto-heal), and how reinitialising with more columns auto-widens a table while protecting the neighbour below.

Reference & operational

  • Full tools reference — every public function + exception, with verbatim signatures and examples.
  • Credentials — constructing the Benchling ctx.
  • Common patterns — config cells, dropdowns, sheet management, plotting, file IO.

Quickstart

import xlwings as xw
from xlwings_package import initialize_workbook, initialise_table_benchling

wb = xw.Book.caller()
initialize_workbook(wb)

# Pull a Benchling schema and lay it out on a sheet.
results = initialise_table_benchling(
    wb,
    {"Assay Results": ["assaysch_abc123"]},
    ctx=my_benchling_context,    # see the Credentials guide
)

See the single-Benchling guide for the full seven-step pattern (init → headers → read → transform → write → colour → save).


Testing

# Unit tests (no Excel required) — pure-Python fake workbook harness.
pytest tests/unit/ -q

# Integration tests (require a live Excel installation on Windows).
pytest tests/integration/ -q

Integration tests write inspectable artifacts to tests/integration/excel_table_tests/ — open any .xlsx to see what each test produced.


Debugging

Best-effort operations (cell merges, sheet moves, bookmark auto-heal) swallow Excel COM errors so they don't interrupt your workflow. To surface those errors during debugging:

import logging
logging.basicConfig(level=logging.DEBUG)

Production code paths that detect data-corruption risks (occupancy conflicts, column overflow, missing schema metadata) always raise — debug logs are only relevant for cosmetic / non-load-bearing failures.

Metadata

Release files for mgtx-xlwings-utils 0.2.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for mgtx-xlwings-utils 0.2.3
File Size Uploaded Provenance Actions
mgtx_xlwings_utils-0.2.3.tar.gz 93.3 kB With provenance Details for mgtx_xlwings_utils-0.2.3.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for mgtx-xlwings-utils 0.2.3
File Interpreter ABI Platform Actions
mgtx_xlwings_utils-0.2.3-py3-none-any.whl Python 3 none any Details for mgtx_xlwings_utils-0.2.3-py3-none-any.whl

Total release size: 192.1 kB

Release files / mgtx_xlwings_utils-0.2.3.tar.gz

Download URL mgtx_xlwings_utils-0.2.3.tar.gz
Size 93.3 kB
Tags Source
SHA-256 checksum
How to use checksums
3fe5ff0758728376b2c3f2ac13d0e179a28e26996c07c842d088d3d30829f838
BLAKE2b-256 checksum
How to use checksums
2dbd7219c8bf504dadb1d24d1d69eac6205d37dac0a8d6150f698cd0f2844758
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jul 15, 2026.

Transparency log

Release files / mgtx_xlwings_utils-0.2.3-py3-none-any.whl

Download URL mgtx_xlwings_utils-0.2.3-py3-none-any.whl
Size 98.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
8743a83ddb9191072b95b0ab7d1895349d22d9aed8d0973d42df679f8bd2b449
BLAKE2b-256 checksum
How to use checksums
e086d40dcc62d458e37e4c8027ba1ac8db66eec00fb8e37cef37becdf1335bf9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jul 15, 2026.

Transparency log

Security for mgtx-xlwings-utils 0.2.3

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.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for mgtx_xlwings_utils-0.2.3.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jul 15, 2026.

Transparency log

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.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page