XlsxWriter 3.3.3__tar.gz → 3.3.4__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (171) hide show
  1. {xlsxwriter-3.3.3 → xlsxwriter-3.3.4}/Changes +13 -0
  2. {xlsxwriter-3.3.3/xlsxwriter.egg-info → xlsxwriter-3.3.4}/PKG-INFO +20 -11
  3. {xlsxwriter-3.3.3 → xlsxwriter-3.3.4}/README.rst +19 -10
  4. xlsxwriter-3.3.4/examples/custom_ui.py +39 -0
  5. xlsxwriter-3.3.4/examples/vbaProject_custom_ui.bin +0 -0
  6. {xlsxwriter-3.3.3 → xlsxwriter-3.3.4}/pyproject.toml +1 -1
  7. {xlsxwriter-3.3.3 → xlsxwriter-3.3.4}/xlsxwriter/__init__.py +1 -1
  8. {xlsxwriter-3.3.3 → xlsxwriter-3.3.4}/xlsxwriter/exceptions.py +4 -0
  9. {xlsxwriter-3.3.3 → xlsxwriter-3.3.4}/xlsxwriter/packager.py +23 -0
  10. {xlsxwriter-3.3.3 → xlsxwriter-3.3.4}/xlsxwriter/relationships.py +11 -0
  11. {xlsxwriter-3.3.3 → xlsxwriter-3.3.4}/xlsxwriter/utility.py +1 -1
  12. {xlsxwriter-3.3.3 → xlsxwriter-3.3.4}/xlsxwriter/workbook.py +51 -0
  13. {xlsxwriter-3.3.3 → xlsxwriter-3.3.4/xlsxwriter.egg-info}/PKG-INFO +20 -11
  14. {xlsxwriter-3.3.3 → xlsxwriter-3.3.4}/xlsxwriter.egg-info/SOURCES.txt +2 -0
  15. {xlsxwriter-3.3.3 → xlsxwriter-3.3.4}/LICENSE.txt +0 -0
  16. {xlsxwriter-3.3.3 → xlsxwriter-3.3.4}/MANIFEST.in +0 -0
  17. {xlsxwriter-3.3.3 → xlsxwriter-3.3.4}/examples/array_formula.py +0 -0
  18. {xlsxwriter-3.3.3 → xlsxwriter-3.3.4}/examples/autofilter.py +0 -0
  19. {xlsxwriter-3.3.3 → xlsxwriter-3.3.4}/examples/autofilter_data.txt +0 -0
  20. {xlsxwriter-3.3.3 → xlsxwriter-3.3.4}/examples/autofit.py +0 -0
  21. {xlsxwriter-3.3.3 → xlsxwriter-3.3.4}/examples/autofit_manually.py +0 -0
  22. {xlsxwriter-3.3.3 → xlsxwriter-3.3.4}/examples/background.py +0 -0
  23. {xlsxwriter-3.3.3 → xlsxwriter-3.3.4}/examples/cell_indentation.py +0 -0
  24. {xlsxwriter-3.3.3 → xlsxwriter-3.3.4}/examples/chart.py +0 -0
  25. {xlsxwriter-3.3.3 → xlsxwriter-3.3.4}/examples/chart_area.py +0 -0
  26. {xlsxwriter-3.3.3 → xlsxwriter-3.3.4}/examples/chart_bar.py +0 -0
  27. {xlsxwriter-3.3.3 → xlsxwriter-3.3.4}/examples/chart_clustered.py +0 -0
  28. {xlsxwriter-3.3.3 → xlsxwriter-3.3.4}/examples/chart_column.py +0 -0
  29. {xlsxwriter-3.3.3 → xlsxwriter-3.3.4}/examples/chart_combined.py +0 -0
  30. {xlsxwriter-3.3.3 → xlsxwriter-3.3.4}/examples/chart_data_labels.py +0 -0
  31. {xlsxwriter-3.3.3 → xlsxwriter-3.3.4}/examples/chart_data_table.py +0 -0
  32. {xlsxwriter-3.3.3 → xlsxwriter-3.3.4}/examples/chart_data_tools.py +0 -0
  33. {xlsxwriter-3.3.3 → xlsxwriter-3.3.4}/examples/chart_date_axis.py +0 -0
  34. {xlsxwriter-3.3.3 → xlsxwriter-3.3.4}/examples/chart_doughnut.py +0 -0
  35. {xlsxwriter-3.3.3 → xlsxwriter-3.3.4}/examples/chart_gauge.py +0 -0
  36. {xlsxwriter-3.3.3 → xlsxwriter-3.3.4}/examples/chart_gradient.py +0 -0
  37. {xlsxwriter-3.3.3 → xlsxwriter-3.3.4}/examples/chart_line.py +0 -0
  38. {xlsxwriter-3.3.3 → xlsxwriter-3.3.4}/examples/chart_pareto.py +0 -0
  39. {xlsxwriter-3.3.3 → xlsxwriter-3.3.4}/examples/chart_pattern.py +0 -0
  40. {xlsxwriter-3.3.3 → xlsxwriter-3.3.4}/examples/chart_pie.py +0 -0
  41. {xlsxwriter-3.3.3 → xlsxwriter-3.3.4}/examples/chart_radar.py +0 -0
  42. {xlsxwriter-3.3.3 → xlsxwriter-3.3.4}/examples/chart_scatter.py +0 -0
  43. {xlsxwriter-3.3.3 → xlsxwriter-3.3.4}/examples/chart_secondary_axis.py +0 -0
  44. {xlsxwriter-3.3.3 → xlsxwriter-3.3.4}/examples/chart_stock.py +0 -0
  45. {xlsxwriter-3.3.3 → xlsxwriter-3.3.4}/examples/chart_styles.py +0 -0
  46. {xlsxwriter-3.3.3 → xlsxwriter-3.3.4}/examples/chartsheet.py +0 -0
  47. {xlsxwriter-3.3.3 → xlsxwriter-3.3.4}/examples/check_close.py +0 -0
  48. {xlsxwriter-3.3.3 → xlsxwriter-3.3.4}/examples/checkbox.py +0 -0
  49. {xlsxwriter-3.3.3 → xlsxwriter-3.3.4}/examples/colors.py +0 -0
  50. {xlsxwriter-3.3.3 → xlsxwriter-3.3.4}/examples/comments1.py +0 -0
  51. {xlsxwriter-3.3.3 → xlsxwriter-3.3.4}/examples/comments2.py +0 -0
  52. {xlsxwriter-3.3.3 → xlsxwriter-3.3.4}/examples/conditional_format.py +0 -0
  53. {xlsxwriter-3.3.3 → xlsxwriter-3.3.4}/examples/context_manager.py +0 -0
  54. {xlsxwriter-3.3.3 → xlsxwriter-3.3.4}/examples/data_validate.py +0 -0
  55. {xlsxwriter-3.3.3 → xlsxwriter-3.3.4}/examples/datetimes.py +0 -0
  56. {xlsxwriter-3.3.3 → xlsxwriter-3.3.4}/examples/defined_name.py +0 -0
  57. {xlsxwriter-3.3.3 → xlsxwriter-3.3.4}/examples/demo.py +0 -0
  58. {xlsxwriter-3.3.3 → xlsxwriter-3.3.4}/examples/diagonal_border.py +0 -0
  59. {xlsxwriter-3.3.3 → xlsxwriter-3.3.4}/examples/django_simple.py +0 -0
  60. {xlsxwriter-3.3.3 → xlsxwriter-3.3.4}/examples/doc_properties.py +0 -0
  61. {xlsxwriter-3.3.3 → xlsxwriter-3.3.4}/examples/dynamic_arrays.py +0 -0
  62. {xlsxwriter-3.3.3 → xlsxwriter-3.3.4}/examples/embedded_images.py +0 -0
  63. {xlsxwriter-3.3.3 → xlsxwriter-3.3.4}/examples/headers_footers.py +0 -0
  64. {xlsxwriter-3.3.3 → xlsxwriter-3.3.4}/examples/hello_world.py +0 -0
  65. {xlsxwriter-3.3.3 → xlsxwriter-3.3.4}/examples/hide_row_col.py +0 -0
  66. {xlsxwriter-3.3.3 → xlsxwriter-3.3.4}/examples/hide_sheet.py +0 -0
  67. {xlsxwriter-3.3.3 → xlsxwriter-3.3.4}/examples/http_server.py +0 -0
  68. {xlsxwriter-3.3.3 → xlsxwriter-3.3.4}/examples/hyperlink.py +0 -0
  69. {xlsxwriter-3.3.3 → xlsxwriter-3.3.4}/examples/ignore_errors.py +0 -0
  70. {xlsxwriter-3.3.3 → xlsxwriter-3.3.4}/examples/images.py +0 -0
  71. {xlsxwriter-3.3.3 → xlsxwriter-3.3.4}/examples/images_bytesio.py +0 -0
  72. {xlsxwriter-3.3.3 → xlsxwriter-3.3.4}/examples/inheritance1.py +0 -0
  73. {xlsxwriter-3.3.3 → xlsxwriter-3.3.4}/examples/inheritance2.py +0 -0
  74. {xlsxwriter-3.3.3 → xlsxwriter-3.3.4}/examples/lambda.py +0 -0
  75. {xlsxwriter-3.3.3 → xlsxwriter-3.3.4}/examples/macros.py +0 -0
  76. {xlsxwriter-3.3.3 → xlsxwriter-3.3.4}/examples/merge1.py +0 -0
  77. {xlsxwriter-3.3.3 → xlsxwriter-3.3.4}/examples/merge_rich_string.py +0 -0
  78. {xlsxwriter-3.3.3 → xlsxwriter-3.3.4}/examples/outline.py +0 -0
  79. {xlsxwriter-3.3.3 → xlsxwriter-3.3.4}/examples/outline_collapsed.py +0 -0
  80. {xlsxwriter-3.3.3 → xlsxwriter-3.3.4}/examples/pandas_autofilter.py +0 -0
  81. {xlsxwriter-3.3.3 → xlsxwriter-3.3.4}/examples/pandas_chart.py +0 -0
  82. {xlsxwriter-3.3.3 → xlsxwriter-3.3.4}/examples/pandas_chart_columns.py +0 -0
  83. {xlsxwriter-3.3.3 → xlsxwriter-3.3.4}/examples/pandas_chart_line.py +0 -0
  84. {xlsxwriter-3.3.3 → xlsxwriter-3.3.4}/examples/pandas_column_formats.py +0 -0
  85. {xlsxwriter-3.3.3 → xlsxwriter-3.3.4}/examples/pandas_conditional_format.py +0 -0
  86. {xlsxwriter-3.3.3 → xlsxwriter-3.3.4}/examples/pandas_datetime.py +0 -0
  87. {xlsxwriter-3.3.3 → xlsxwriter-3.3.4}/examples/pandas_header_format.py +0 -0
  88. {xlsxwriter-3.3.3 → xlsxwriter-3.3.4}/examples/pandas_multiple.py +0 -0
  89. {xlsxwriter-3.3.3 → xlsxwriter-3.3.4}/examples/pandas_percentage.py +0 -0
  90. {xlsxwriter-3.3.3 → xlsxwriter-3.3.4}/examples/pandas_positioning.py +0 -0
  91. {xlsxwriter-3.3.3 → xlsxwriter-3.3.4}/examples/pandas_simple.py +0 -0
  92. {xlsxwriter-3.3.3 → xlsxwriter-3.3.4}/examples/pandas_table.py +0 -0
  93. {xlsxwriter-3.3.3 → xlsxwriter-3.3.4}/examples/panes.py +0 -0
  94. {xlsxwriter-3.3.3 → xlsxwriter-3.3.4}/examples/pivot_table.py +0 -0
  95. {xlsxwriter-3.3.3 → xlsxwriter-3.3.4}/examples/polars_chart.py +0 -0
  96. {xlsxwriter-3.3.3 → xlsxwriter-3.3.4}/examples/polars_checkbox.py +0 -0
  97. {xlsxwriter-3.3.3 → xlsxwriter-3.3.4}/examples/polars_conditional_format.py +0 -0
  98. {xlsxwriter-3.3.3 → xlsxwriter-3.3.4}/examples/polars_format_custom.py +0 -0
  99. {xlsxwriter-3.3.3 → xlsxwriter-3.3.4}/examples/polars_format_default.py +0 -0
  100. {xlsxwriter-3.3.3 → xlsxwriter-3.3.4}/examples/polars_multiple.py +0 -0
  101. {xlsxwriter-3.3.3 → xlsxwriter-3.3.4}/examples/polars_positioning.py +0 -0
  102. {xlsxwriter-3.3.3 → xlsxwriter-3.3.4}/examples/polars_simple.py +0 -0
  103. {xlsxwriter-3.3.3 → xlsxwriter-3.3.4}/examples/polars_sparklines.py +0 -0
  104. {xlsxwriter-3.3.3 → xlsxwriter-3.3.4}/examples/polars_xlsxwriter.py +0 -0
  105. {xlsxwriter-3.3.3 → xlsxwriter-3.3.4}/examples/rich_strings.py +0 -0
  106. {xlsxwriter-3.3.3 → xlsxwriter-3.3.4}/examples/right_to_left.py +0 -0
  107. {xlsxwriter-3.3.3 → xlsxwriter-3.3.4}/examples/sensitivity_label.py +0 -0
  108. {xlsxwriter-3.3.3 → xlsxwriter-3.3.4}/examples/sparklines1.py +0 -0
  109. {xlsxwriter-3.3.3 → xlsxwriter-3.3.4}/examples/sparklines2.py +0 -0
  110. {xlsxwriter-3.3.3 → xlsxwriter-3.3.4}/examples/tab_colors.py +0 -0
  111. {xlsxwriter-3.3.3 → xlsxwriter-3.3.4}/examples/tables.py +0 -0
  112. {xlsxwriter-3.3.3 → xlsxwriter-3.3.4}/examples/text_indent.py +0 -0
  113. {xlsxwriter-3.3.3 → xlsxwriter-3.3.4}/examples/textbox.py +0 -0
  114. {xlsxwriter-3.3.3 → xlsxwriter-3.3.4}/examples/theme_custom.py +0 -0
  115. {xlsxwriter-3.3.3 → xlsxwriter-3.3.4}/examples/theme_excel_2023.py +0 -0
  116. {xlsxwriter-3.3.3 → xlsxwriter-3.3.4}/examples/tutorial1.py +0 -0
  117. {xlsxwriter-3.3.3 → xlsxwriter-3.3.4}/examples/tutorial2.py +0 -0
  118. {xlsxwriter-3.3.3 → xlsxwriter-3.3.4}/examples/tutorial3.py +0 -0
  119. {xlsxwriter-3.3.3 → xlsxwriter-3.3.4}/examples/unicode.py +0 -0
  120. {xlsxwriter-3.3.3 → xlsxwriter-3.3.4}/examples/unicode_polish_utf8.py +0 -0
  121. {xlsxwriter-3.3.3 → xlsxwriter-3.3.4}/examples/unicode_polish_utf8.txt +0 -0
  122. {xlsxwriter-3.3.3 → xlsxwriter-3.3.4}/examples/unicode_shift_jis.py +0 -0
  123. {xlsxwriter-3.3.3 → xlsxwriter-3.3.4}/examples/unicode_shift_jis.txt +0 -0
  124. {xlsxwriter-3.3.3 → xlsxwriter-3.3.4}/examples/user_types1.py +0 -0
  125. {xlsxwriter-3.3.3 → xlsxwriter-3.3.4}/examples/user_types2.py +0 -0
  126. {xlsxwriter-3.3.3 → xlsxwriter-3.3.4}/examples/user_types3.py +0 -0
  127. {xlsxwriter-3.3.3 → xlsxwriter-3.3.4}/examples/vbaProject.bin +0 -0
  128. {xlsxwriter-3.3.3 → xlsxwriter-3.3.4}/examples/vba_extract.py +0 -0
  129. {xlsxwriter-3.3.3 → xlsxwriter-3.3.4}/examples/watermark.py +0 -0
  130. {xlsxwriter-3.3.3 → xlsxwriter-3.3.4}/examples/worksheet_protection.py +0 -0
  131. {xlsxwriter-3.3.3 → xlsxwriter-3.3.4}/setup.cfg +0 -0
  132. {xlsxwriter-3.3.3 → xlsxwriter-3.3.4}/xlsxwriter/app.py +0 -0
  133. {xlsxwriter-3.3.3 → xlsxwriter-3.3.4}/xlsxwriter/chart.py +0 -0
  134. {xlsxwriter-3.3.3 → xlsxwriter-3.3.4}/xlsxwriter/chart_area.py +0 -0
  135. {xlsxwriter-3.3.3 → xlsxwriter-3.3.4}/xlsxwriter/chart_bar.py +0 -0
  136. {xlsxwriter-3.3.3 → xlsxwriter-3.3.4}/xlsxwriter/chart_column.py +0 -0
  137. {xlsxwriter-3.3.3 → xlsxwriter-3.3.4}/xlsxwriter/chart_doughnut.py +0 -0
  138. {xlsxwriter-3.3.3 → xlsxwriter-3.3.4}/xlsxwriter/chart_line.py +0 -0
  139. {xlsxwriter-3.3.3 → xlsxwriter-3.3.4}/xlsxwriter/chart_pie.py +0 -0
  140. {xlsxwriter-3.3.3 → xlsxwriter-3.3.4}/xlsxwriter/chart_radar.py +0 -0
  141. {xlsxwriter-3.3.3 → xlsxwriter-3.3.4}/xlsxwriter/chart_scatter.py +0 -0
  142. {xlsxwriter-3.3.3 → xlsxwriter-3.3.4}/xlsxwriter/chart_stock.py +0 -0
  143. {xlsxwriter-3.3.3 → xlsxwriter-3.3.4}/xlsxwriter/chart_title.py +0 -0
  144. {xlsxwriter-3.3.3 → xlsxwriter-3.3.4}/xlsxwriter/chartsheet.py +0 -0
  145. {xlsxwriter-3.3.3 → xlsxwriter-3.3.4}/xlsxwriter/color.py +0 -0
  146. {xlsxwriter-3.3.3 → xlsxwriter-3.3.4}/xlsxwriter/comments.py +0 -0
  147. {xlsxwriter-3.3.3 → xlsxwriter-3.3.4}/xlsxwriter/contenttypes.py +0 -0
  148. {xlsxwriter-3.3.3 → xlsxwriter-3.3.4}/xlsxwriter/core.py +0 -0
  149. {xlsxwriter-3.3.3 → xlsxwriter-3.3.4}/xlsxwriter/custom.py +0 -0
  150. {xlsxwriter-3.3.3 → xlsxwriter-3.3.4}/xlsxwriter/drawing.py +0 -0
  151. {xlsxwriter-3.3.3 → xlsxwriter-3.3.4}/xlsxwriter/feature_property_bag.py +0 -0
  152. {xlsxwriter-3.3.3 → xlsxwriter-3.3.4}/xlsxwriter/format.py +0 -0
  153. {xlsxwriter-3.3.3 → xlsxwriter-3.3.4}/xlsxwriter/image.py +0 -0
  154. {xlsxwriter-3.3.3 → xlsxwriter-3.3.4}/xlsxwriter/metadata.py +0 -0
  155. {xlsxwriter-3.3.3 → xlsxwriter-3.3.4}/xlsxwriter/pivot_cache.py +0 -0
  156. {xlsxwriter-3.3.3 → xlsxwriter-3.3.4}/xlsxwriter/pivot_table.py +0 -0
  157. {xlsxwriter-3.3.3 → xlsxwriter-3.3.4}/xlsxwriter/rich_value.py +0 -0
  158. {xlsxwriter-3.3.3 → xlsxwriter-3.3.4}/xlsxwriter/rich_value_rel.py +0 -0
  159. {xlsxwriter-3.3.3 → xlsxwriter-3.3.4}/xlsxwriter/rich_value_structure.py +0 -0
  160. {xlsxwriter-3.3.3 → xlsxwriter-3.3.4}/xlsxwriter/rich_value_types.py +0 -0
  161. {xlsxwriter-3.3.3 → xlsxwriter-3.3.4}/xlsxwriter/shape.py +0 -0
  162. {xlsxwriter-3.3.3 → xlsxwriter-3.3.4}/xlsxwriter/sharedstrings.py +0 -0
  163. {xlsxwriter-3.3.3 → xlsxwriter-3.3.4}/xlsxwriter/styles.py +0 -0
  164. {xlsxwriter-3.3.3 → xlsxwriter-3.3.4}/xlsxwriter/table.py +0 -0
  165. {xlsxwriter-3.3.3 → xlsxwriter-3.3.4}/xlsxwriter/theme.py +0 -0
  166. {xlsxwriter-3.3.3 → xlsxwriter-3.3.4}/xlsxwriter/url.py +0 -0
  167. {xlsxwriter-3.3.3 → xlsxwriter-3.3.4}/xlsxwriter/vml.py +0 -0
  168. {xlsxwriter-3.3.3 → xlsxwriter-3.3.4}/xlsxwriter/worksheet.py +0 -0
  169. {xlsxwriter-3.3.3 → xlsxwriter-3.3.4}/xlsxwriter/xmlwriter.py +0 -0
  170. {xlsxwriter-3.3.3 → xlsxwriter-3.3.4}/xlsxwriter.egg-info/dependency_links.txt +0 -0
  171. {xlsxwriter-3.3.3 → xlsxwriter-3.3.4}/xlsxwriter.egg-info/top_level.txt +0 -0
@@ -1,4 +1,17 @@
1
1
 
2
+ Release 3.3.4 - November 22 2026
3
+ --------------------------------
4
+
5
+ * Added support for custom ribbon UI XML files via the :func:`add_custom_ui`
6
+ method. See :ref:`customui`.
7
+
8
+ :feature:`1086`.
9
+
10
+ * Fixed issue where datetimes on 1900-02-28 with a time after midnight were
11
+ written as 1900-02-29.
12
+
13
+ :issue:`1232`.
14
+
2
15
  Release 3.3.3 - November 20 2026
3
16
  --------------------------------
4
17
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: xlsxwriter
3
- Version: 3.3.3
3
+ Version: 3.3.4
4
4
  Summary: A Python module for creating Excel XLSX files.
5
5
  Author-email: John McNamara <jmcnamara@cpan.org>
6
6
  License-Expression: BSD-2-Clause
@@ -36,21 +36,30 @@ multiple worksheets and it supports features such as formatting and many more,
36
36
  including:
37
37
 
38
38
  * 100% compatible Excel XLSX files.
39
- * Full formatting.
40
- * Merged cells.
41
- * Defined names.
39
+ * Support for writing all basic Excel data types.
40
+ * Full cell formatting support.
41
+ * Formula support, including new Excel 365 dynamic functions.
42
42
  * Charts.
43
- * Autofilters.
44
- * Data validation and drop down lists.
43
+ * Hyperlink support.
44
+ * Page/Printing Setup support.
45
+ * Merged ranges.
45
46
  * Conditional formatting.
46
- * Worksheet tables.
47
- * Pivot tables.
47
+ * Data validation and drop down lists.
48
+ * Cell comments.
49
+ * Textboxes.
50
+ * Checkboxes.
51
+ * Sparklines.
48
52
  * Worksheet PNG/JPEG/GIF/BMP/WMF/EMF images.
53
+ * Workbook themes.
49
54
  * Rich multi-format strings.
50
- * Cell comments.
55
+ * Outline groupings.
56
+ * Defined names.
57
+ * Autofilters.
58
+ * Worksheet tables.
59
+ * Pivot tables.
51
60
  * Integration with Pandas and Polars.
52
- * Textboxes.
53
- * Support for adding Macros.
61
+ * Support for macros.
62
+ * Custom UI/Ribbon elements.
54
63
  * Memory optimization mode for writing large files.
55
64
 
56
65
  It supports Python 3.8+ and PyPy3 and uses standard libraries only.
@@ -9,21 +9,30 @@ multiple worksheets and it supports features such as formatting and many more,
9
9
  including:
10
10
 
11
11
  * 100% compatible Excel XLSX files.
12
- * Full formatting.
13
- * Merged cells.
14
- * Defined names.
12
+ * Support for writing all basic Excel data types.
13
+ * Full cell formatting support.
14
+ * Formula support, including new Excel 365 dynamic functions.
15
15
  * Charts.
16
- * Autofilters.
17
- * Data validation and drop down lists.
16
+ * Hyperlink support.
17
+ * Page/Printing Setup support.
18
+ * Merged ranges.
18
19
  * Conditional formatting.
19
- * Worksheet tables.
20
- * Pivot tables.
20
+ * Data validation and drop down lists.
21
+ * Cell comments.
22
+ * Textboxes.
23
+ * Checkboxes.
24
+ * Sparklines.
21
25
  * Worksheet PNG/JPEG/GIF/BMP/WMF/EMF images.
26
+ * Workbook themes.
22
27
  * Rich multi-format strings.
23
- * Cell comments.
28
+ * Outline groupings.
29
+ * Defined names.
30
+ * Autofilters.
31
+ * Worksheet tables.
32
+ * Pivot tables.
24
33
  * Integration with Pandas and Polars.
25
- * Textboxes.
26
- * Support for adding Macros.
34
+ * Support for macros.
35
+ * Custom UI/Ribbon elements.
27
36
  * Memory optimization mode for writing large files.
28
37
 
29
38
  It supports Python 3.8+ and PyPy3 and uses standard libraries only.
@@ -0,0 +1,39 @@
1
+ #######################################################################
2
+ #
3
+ # An example of adding a custom ribbon tab to an XlsxWriter file using a
4
+ # Custom UI XML file.
5
+ #
6
+ # The custom tab contains built-in Excel commands and a button that runs a
7
+ # macro from a VBA project file.
8
+ #
9
+ # SPDX-License-Identifier: BSD-2-Clause
10
+ #
11
+ # Copyright (c) 2013-2026, John McNamara, jmcnamara@cpan.org
12
+ #
13
+ import xlsxwriter
14
+
15
+ # Note the file extension should be .xlsm.
16
+ workbook = xlsxwriter.Workbook("custom_ui.xlsm")
17
+ worksheet = workbook.add_worksheet()
18
+
19
+ worksheet.set_column("A:A", 50)
20
+
21
+ # Add the Custom UI XML file for the Excel 2010+ ribbon.
22
+ workbook.add_custom_ui("./customUI14.xml")
23
+
24
+ # Show some instructions for the end user.
25
+ bold = workbook.add_format({"bold": True})
26
+ worksheet.write("A1", "Use the 'My Ribbon' tab to sort the selected data.", bold)
27
+
28
+ # Add some data to sort.
29
+ for row, fruit in enumerate(["Pear", "Apple", "Orange", "Banana", "Grape"], 2):
30
+ worksheet.write(row, 0, fruit)
31
+
32
+ # Preselect the data so it is ready to sort.
33
+ worksheet.set_selection("A3:A7")
34
+
35
+ # Add the VBA project for the macro on the custom ribbon tab. This was extracted
36
+ # from an Excel file using the vba_extract tool.
37
+ workbook.add_vba_project("./vbaProject_custom_ui.bin")
38
+
39
+ workbook.close()
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "xlsxwriter"
7
- version = "3.3.3"
7
+ version = "3.3.4"
8
8
  description = "A Python module for creating Excel XLSX files."
9
9
  readme = "README.rst"
10
10
  license = "BSD-2-Clause"
@@ -3,7 +3,7 @@
3
3
  #
4
4
  # Copyright (c) 2013-2026, John McNamara, jmcnamara@cpan.org
5
5
  #
6
- __version__ = "3.3.3"
6
+ __version__ = "3.3.4"
7
7
  __VERSION__ = __version__
8
8
  from xlsxwriter.workbook import Workbook
9
9
 
@@ -62,3 +62,7 @@ class FileSizeError(XlsxFileError):
62
62
 
63
63
  class ThemeFileError(XlsxFileError):
64
64
  """Error when processing a custom theme file."""
65
+
66
+
67
+ class CustomUIFileError(XlsxFileError):
68
+ """Error when processing a Custom UI file."""
@@ -171,6 +171,7 @@ class Packager:
171
171
  self._write_metadata_file()
172
172
  self._write_feature_bag_property()
173
173
  self._write_rich_value_files()
174
+ self._add_ribbons()
174
175
 
175
176
  return self.filenames
176
177
 
@@ -626,6 +627,9 @@ class Packager:
626
627
  if self.workbook.custom_properties:
627
628
  rels._add_document_relationship("/custom-properties", "docProps/custom.xml")
628
629
 
630
+ for part_name in self.workbook.custom_uis:
631
+ rels._add_custom_ui_relationship(part_name)
632
+
629
633
  rels._set_xml_writer(self._filename("_rels/.rels"))
630
634
 
631
635
  rels._assemble_xml_file()
@@ -929,3 +933,22 @@ class Packager:
929
933
  os_filename = BytesIO(vba_data)
930
934
 
931
935
  self.filenames.append((os_filename, xml_vba_name, True))
936
+
937
+ def _add_ribbons(self) -> None:
938
+ # Write the Custom UI XML files.
939
+ custom_uis = self.workbook.custom_uis
940
+
941
+ if not custom_uis:
942
+ return
943
+
944
+ for part_name, (_, custom_ui_data) in custom_uis.items():
945
+ part_path = f"customUI/{part_name}.xml"
946
+ if not self.in_memory:
947
+ # In file mode we write the xml data to a file.
948
+ with open(self._filename(part_path), mode="wb") as custom_ui_file:
949
+ custom_ui_file.write(custom_ui_data)
950
+
951
+ else:
952
+ # Store the user's XML bytes unchanged.
953
+ os_filename = BytesIO(custom_ui_data)
954
+ self.filenames.append((os_filename, part_path, True))
@@ -76,6 +76,17 @@ class Relationships(xmlwriter.XMLwriter):
76
76
 
77
77
  self.relationships.append((rel_type, target, None))
78
78
 
79
+ def _add_custom_ui_relationship(self, part_name) -> None:
80
+ # Add Custom UI relationship. Excel 2010+ parts use the 2007 schema.
81
+ if part_name == "customUI14":
82
+ schema = "http://schemas.microsoft.com/office/2007/relationships"
83
+ else:
84
+ schema = "http://schemas.microsoft.com/office/2006/relationships"
85
+
86
+ rel_type = schema + "/ui/extensibility"
87
+ target = f"customUI/{part_name}.xml"
88
+ self.relationships.append((rel_type, target, None))
89
+
79
90
  def _add_rich_value_relationship(self) -> None:
80
91
  # Add RichValue relationship to XLSX .rels xml files.
81
92
  schema = "http://schemas.microsoft.com/office/2022/10/relationships/"
@@ -942,7 +942,7 @@ def _datetime_to_excel_datetime(
942
942
  excel_time -= 1
943
943
 
944
944
  # Account for Excel erroneously treating 1900 as a leap year.
945
- if not date_1904 and not is_timedelta and excel_time > 59:
945
+ if not date_1904 and not is_timedelta and excel_time >= 60:
946
946
  excel_time += 1
947
947
 
948
948
  return excel_time
@@ -20,6 +20,7 @@ from fractions import Fraction
20
20
  from io import StringIO
21
21
  from typing import IO, Any, AnyStr, Dict, List, Literal, Optional, Tuple, Union
22
22
  from warnings import warn
23
+ from xml.etree import ElementTree
23
24
  from zipfile import ZIP_DEFLATED, LargeZipFile, ZipFile, ZipInfo
24
25
 
25
26
  # Package imports.
@@ -35,6 +36,7 @@ from xlsxwriter.chart_scatter import ChartScatter
35
36
  from xlsxwriter.chart_stock import ChartStock
36
37
  from xlsxwriter.chartsheet import Chartsheet
37
38
  from xlsxwriter.exceptions import (
39
+ CustomUIFileError,
38
40
  DuplicateWorksheetName,
39
41
  FileCreateError,
40
42
  FileSizeError,
@@ -176,6 +178,8 @@ class Workbook(xmlwriter.XMLwriter):
176
178
  self.default_theme_version: str = "124226"
177
179
  self.theme_xml: str = THEME_XML_2007
178
180
 
181
+ self.custom_uis: Dict[str, Tuple[Union[str, os.PathLike], bytes]] = {}
182
+
179
183
  # We can't do 'constant_memory' mode while doing 'in_memory' mode.
180
184
  if self.in_memory:
181
185
  self.constant_memory = False
@@ -462,6 +466,53 @@ class Workbook(xmlwriter.XMLwriter):
462
466
  self.theme_xml = theme_xml
463
467
  self.default_theme_version = ""
464
468
 
469
+ def add_custom_ui(self, custom_ui: Union[str, os.PathLike]) -> None:
470
+ """
471
+ Add a custom ribbon UI XML file to the Excel workbook.
472
+
473
+ Args:
474
+ custom_ui: The Custom UI XML file path (string or PathLike).
475
+
476
+ Raises:
477
+ OSError: If the file cannot be read.
478
+ CustomUIFileError: If the file isn't valid Custom UI XML, or a
479
+ file of the same format was already added.
480
+
481
+ """
482
+ # Read the file once so the saved part is the one that was checked.
483
+ with open(custom_ui, mode="rb") as custom_ui_file:
484
+ custom_ui_data = custom_ui_file.read()
485
+
486
+ try:
487
+ root_tag = ElementTree.fromstring(custom_ui_data).tag
488
+ except ElementTree.ParseError as e:
489
+ raise CustomUIFileError(
490
+ f"Invalid XML in Custom UI file '{custom_ui}': {e}."
491
+ ) from e
492
+
493
+ # Map the root namespace to the Excel 2007 or 2010+ part name.
494
+ schema = "http://schemas.microsoft.com/office"
495
+ part_names = {
496
+ f"{{{schema}/2006/01/customui}}customUI": "customUI",
497
+ f"{{{schema}/2009/07/customui}}customUI": "customUI14",
498
+ }
499
+
500
+ part_name = part_names.get(root_tag)
501
+
502
+ if part_name is None:
503
+ raise CustomUIFileError(
504
+ f"Unrecognized root element or namespace in Custom UI file "
505
+ f"'{custom_ui}'."
506
+ )
507
+
508
+ if part_name in self.custom_uis:
509
+ raise CustomUIFileError(
510
+ f"Custom UI file '{custom_ui}' has the same namespace as "
511
+ f"'{self.custom_uis[part_name][0]}'. Only one of each is allowed."
512
+ )
513
+
514
+ self.custom_uis[part_name] = (custom_ui, custom_ui_data)
515
+
465
516
  def close(self) -> None:
466
517
  """
467
518
  Call finalization code and close file.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: xlsxwriter
3
- Version: 3.3.3
3
+ Version: 3.3.4
4
4
  Summary: A Python module for creating Excel XLSX files.
5
5
  Author-email: John McNamara <jmcnamara@cpan.org>
6
6
  License-Expression: BSD-2-Clause
@@ -36,21 +36,30 @@ multiple worksheets and it supports features such as formatting and many more,
36
36
  including:
37
37
 
38
38
  * 100% compatible Excel XLSX files.
39
- * Full formatting.
40
- * Merged cells.
41
- * Defined names.
39
+ * Support for writing all basic Excel data types.
40
+ * Full cell formatting support.
41
+ * Formula support, including new Excel 365 dynamic functions.
42
42
  * Charts.
43
- * Autofilters.
44
- * Data validation and drop down lists.
43
+ * Hyperlink support.
44
+ * Page/Printing Setup support.
45
+ * Merged ranges.
45
46
  * Conditional formatting.
46
- * Worksheet tables.
47
- * Pivot tables.
47
+ * Data validation and drop down lists.
48
+ * Cell comments.
49
+ * Textboxes.
50
+ * Checkboxes.
51
+ * Sparklines.
48
52
  * Worksheet PNG/JPEG/GIF/BMP/WMF/EMF images.
53
+ * Workbook themes.
49
54
  * Rich multi-format strings.
50
- * Cell comments.
55
+ * Outline groupings.
56
+ * Defined names.
57
+ * Autofilters.
58
+ * Worksheet tables.
59
+ * Pivot tables.
51
60
  * Integration with Pandas and Polars.
52
- * Textboxes.
53
- * Support for adding Macros.
61
+ * Support for macros.
62
+ * Custom UI/Ribbon elements.
54
63
  * Memory optimization mode for writing large files.
55
64
 
56
65
  It supports Python 3.8+ and PyPy3 and uses standard libraries only.
@@ -40,6 +40,7 @@ examples/comments1.py
40
40
  examples/comments2.py
41
41
  examples/conditional_format.py
42
42
  examples/context_manager.py
43
+ examples/custom_ui.py
43
44
  examples/data_validate.py
44
45
  examples/datetimes.py
45
46
  examples/defined_name.py
@@ -114,6 +115,7 @@ examples/user_types1.py
114
115
  examples/user_types2.py
115
116
  examples/user_types3.py
116
117
  examples/vbaProject.bin
118
+ examples/vbaProject_custom_ui.bin
117
119
  examples/vba_extract.py
118
120
  examples/watermark.py
119
121
  examples/worksheet_protection.py
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes