• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

openpyxl / openpyxl
96%
default: 96%

Build:
Build:
LAST BUILD BRANCH: 3.1
DEFAULT BRANCH: default
Repo Added 04 Aug 2018 11:51AM UTC
Files 190
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

LAST BUILD ON BRANCH 3.2
branch: 3.2
CHANGE BRANCH
x
Reset
  • 3.2
  • 2.5
  • 2.6
  • 3.0
  • 3.1
  • DefRefErr
  • Matthew-Davis/make-import-dependencies-clear-for-works-1572416714092
  • Scott-Noyes/fix-grammar-and-spelling-errors-1574224174595
  • Scott-Noyes/fix-some-grammar-and-spelling-1574230839774
  • Tristan-Stenner/namedrangedoc
  • bugfix/merge-cell-hyperlink
  • default
  • deletion-performance
  • empty-sequence
  • feature/formula-with-linefeed
  • feature/write_numpy_to_cell
  • fix-cfvo-type-error
  • fix-mergedcell-hyperlink-read-only
  • fix-reading-chart-with-no-series
  • fix_disjoint_cellrange
  • henningb/protectionrst-edited-online-with-bitbuck-1549543344364
  • improve-error-msg
  • issue-1321
  • jemord/fix-incorrect-class-path-for-writeonlyce-1549810368558
  • jlice/protectionrst-edited-online-with-bitbuck-1556983141575
  • n23/fix-critical-typo-mitre-to-miter-causing-1544625603513
  • snippet/authorsrst-edited-fixed-typo-1542062111491
  • update-docs-py34

10 Jan 2026 03:13PM UTC coverage: 96.495% (-0.01%) from 96.507%
#865

push

coveralls-python

David Ropero
Add autofit() method for automatic column width adjustment

This commit introduces a new autofit() method in ColumnDimension that
automatically adjusts column widths based on cell content length.

Features:
- Uses public API: worksheet.cell(), min_row, max_row
- Configurable: min_width, max_width, width_factor parameters
- Robust: handles None values, multiline content (\n)
- Returns calculated width for debugging

Also includes:
- autofit_columns() helper method in Worksheet class
- Comprehensive test suite (13 new tests, all passing)
- Updated AUTHORS.rst with contributor

Performance: ~0.014s per column for 10k rows

This is a pragmatic approximation based on character count.
Excel's AutoFit uses complex calculations involving DPI, font metrics,
and rendering engine details that are not available to openpyxl.
This method provides a practical solution suitable for most use cases.

14920 of 15462 relevant lines covered (96.49%)

0.96 hits per line

Relevant lines Covered
Build:
Build:
15462 RELEVANT LINES 14920 COVERED LINES
0.96 HITS PER LINE
Source Files on 3.2
  • Tree
  • List 190
  • Changed 34
  • Source Changed 0
  • Coverage Changed 34
Coverage ∆ File Lines Relevant Covered Missed Hits/Line

Recent builds

Builds Branch Commit Type Ran Committer Via Coverage
#865 3.2 Add autofit() method for automatic column width adjustment This commit introduces a new autofit() method in ColumnDimension that automatically adjusts column widths based on cell content length. Features: - Uses public API: worksheet.cell(), min... push 10 Jan 2026 03:13PM UTC David Ropero coveralls-python
96.49
#862 3.2 Merge with 3.1 push 01 Oct 2025 12:03PM UTC Charlie Clark coveralls-python
96.51
#833 3.2 Merge with 3.1 push 13 Feb 2025 05:53PM UTC Charlie Clark coveralls-python
96.51
#832 3.2 Fix version after merge push 18 Dec 2024 04:09PM UTC Charlie Clark coveralls-python
96.51
#830 3.2 Typo on docs push 25 Sep 2024 07:05AM UTC snippet coveralls-python
96.62
#827 3.2 Think this got lost in the merge push 04 Sep 2024 11:02AM UTC snippet coveralls-python
96.62
#824 3.2 Switch to using a NamedTuple for the result of parsing a cell. Microoptimisation. Next step is to use Coordinate in the Cell and Worksheet. push 04 Sep 2024 10:24AM UTC Charlie Clark coveralls-python
96.53
#823 3.2 Cleanup post merge push 04 Sep 2024 10:08AM UTC snippet coveralls-python
96.44
#821 3.2 Merge push 24 Jul 2024 12:02PM UTC Charlie Clark coveralls-python
96.5
#819 3.2 Merge branch 'topic/3.2/connection-caches' into 'branch/3.2' Add support for connections having pivot caches associated See merge request openpyxl/openpyxl!453 push 24 Jul 2024 11:37AM UTC CharlieC coveralls-python
96.5
See All Builds (870)
  • Repo on Bitbucket
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc