XlsxWriter 3.2.3__tar.gz → 3.2.5__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.
- {xlsxwriter-3.2.3 → xlsxwriter-3.2.5}/Changes +30 -0
- {xlsxwriter-3.2.3/XlsxWriter.egg-info → xlsxwriter-3.2.5}/PKG-INFO +4 -4
- {xlsxwriter-3.2.3 → xlsxwriter-3.2.5}/README.rst +1 -1
- xlsxwriter-3.2.5/examples/colors.py +87 -0
- xlsxwriter-3.2.5/setup.py +35 -0
- {xlsxwriter-3.2.3 → xlsxwriter-3.2.5}/xlsxwriter/__init__.py +1 -1
- {xlsxwriter-3.2.3 → xlsxwriter-3.2.5}/xlsxwriter/chart.py +88 -30
- xlsxwriter-3.2.5/xlsxwriter/color.py +431 -0
- {xlsxwriter-3.2.3 → xlsxwriter-3.2.5}/xlsxwriter/comments.py +6 -13
- {xlsxwriter-3.2.3 → xlsxwriter-3.2.5}/xlsxwriter/drawing.py +10 -15
- {xlsxwriter-3.2.3 → xlsxwriter-3.2.5}/xlsxwriter/format.py +41 -43
- {xlsxwriter-3.2.3 → xlsxwriter-3.2.5}/xlsxwriter/image.py +5 -3
- {xlsxwriter-3.2.3 → xlsxwriter-3.2.5}/xlsxwriter/shape.py +20 -2
- {xlsxwriter-3.2.3 → xlsxwriter-3.2.5}/xlsxwriter/styles.py +16 -31
- {xlsxwriter-3.2.3 → xlsxwriter-3.2.5}/xlsxwriter/url.py +19 -18
- {xlsxwriter-3.2.3 → xlsxwriter-3.2.5}/xlsxwriter/utility.py +339 -375
- {xlsxwriter-3.2.3 → xlsxwriter-3.2.5}/xlsxwriter/vml.py +1 -1
- {xlsxwriter-3.2.3 → xlsxwriter-3.2.5}/xlsxwriter/workbook.py +7 -19
- {xlsxwriter-3.2.3 → xlsxwriter-3.2.5}/xlsxwriter/worksheet.py +70 -77
- {xlsxwriter-3.2.3 → xlsxwriter-3.2.5/xlsxwriter.egg-info}/PKG-INFO +4 -4
- {xlsxwriter-3.2.3/XlsxWriter.egg-info → xlsxwriter-3.2.5/xlsxwriter.egg-info}/SOURCES.txt +7 -5
- xlsxwriter-3.2.3/setup.py +0 -55
- {xlsxwriter-3.2.3 → xlsxwriter-3.2.5}/LICENSE.txt +0 -0
- {xlsxwriter-3.2.3 → xlsxwriter-3.2.5}/MANIFEST.in +0 -0
- {xlsxwriter-3.2.3 → xlsxwriter-3.2.5}/examples/array_formula.py +0 -0
- {xlsxwriter-3.2.3 → xlsxwriter-3.2.5}/examples/autofilter.py +0 -0
- {xlsxwriter-3.2.3 → xlsxwriter-3.2.5}/examples/autofilter_data.txt +0 -0
- {xlsxwriter-3.2.3 → xlsxwriter-3.2.5}/examples/autofit.py +0 -0
- {xlsxwriter-3.2.3 → xlsxwriter-3.2.5}/examples/autofit_manually.py +0 -0
- {xlsxwriter-3.2.3 → xlsxwriter-3.2.5}/examples/background.py +0 -0
- {xlsxwriter-3.2.3 → xlsxwriter-3.2.5}/examples/cell_indentation.py +0 -0
- {xlsxwriter-3.2.3 → xlsxwriter-3.2.5}/examples/chart.py +0 -0
- {xlsxwriter-3.2.3 → xlsxwriter-3.2.5}/examples/chart_area.py +0 -0
- {xlsxwriter-3.2.3 → xlsxwriter-3.2.5}/examples/chart_bar.py +0 -0
- {xlsxwriter-3.2.3 → xlsxwriter-3.2.5}/examples/chart_clustered.py +0 -0
- {xlsxwriter-3.2.3 → xlsxwriter-3.2.5}/examples/chart_column.py +0 -0
- {xlsxwriter-3.2.3 → xlsxwriter-3.2.5}/examples/chart_combined.py +0 -0
- {xlsxwriter-3.2.3 → xlsxwriter-3.2.5}/examples/chart_data_labels.py +0 -0
- {xlsxwriter-3.2.3 → xlsxwriter-3.2.5}/examples/chart_data_table.py +0 -0
- {xlsxwriter-3.2.3 → xlsxwriter-3.2.5}/examples/chart_data_tools.py +0 -0
- {xlsxwriter-3.2.3 → xlsxwriter-3.2.5}/examples/chart_date_axis.py +0 -0
- {xlsxwriter-3.2.3 → xlsxwriter-3.2.5}/examples/chart_doughnut.py +0 -0
- {xlsxwriter-3.2.3 → xlsxwriter-3.2.5}/examples/chart_gauge.py +0 -0
- {xlsxwriter-3.2.3 → xlsxwriter-3.2.5}/examples/chart_gradient.py +0 -0
- {xlsxwriter-3.2.3 → xlsxwriter-3.2.5}/examples/chart_line.py +0 -0
- {xlsxwriter-3.2.3 → xlsxwriter-3.2.5}/examples/chart_pareto.py +0 -0
- {xlsxwriter-3.2.3 → xlsxwriter-3.2.5}/examples/chart_pattern.py +0 -0
- {xlsxwriter-3.2.3 → xlsxwriter-3.2.5}/examples/chart_pie.py +0 -0
- {xlsxwriter-3.2.3 → xlsxwriter-3.2.5}/examples/chart_radar.py +0 -0
- {xlsxwriter-3.2.3 → xlsxwriter-3.2.5}/examples/chart_scatter.py +0 -0
- {xlsxwriter-3.2.3 → xlsxwriter-3.2.5}/examples/chart_secondary_axis.py +0 -0
- {xlsxwriter-3.2.3 → xlsxwriter-3.2.5}/examples/chart_stock.py +0 -0
- {xlsxwriter-3.2.3 → xlsxwriter-3.2.5}/examples/chart_styles.py +0 -0
- {xlsxwriter-3.2.3 → xlsxwriter-3.2.5}/examples/chartsheet.py +0 -0
- {xlsxwriter-3.2.3 → xlsxwriter-3.2.5}/examples/check_close.py +0 -0
- {xlsxwriter-3.2.3 → xlsxwriter-3.2.5}/examples/checkbox.py +0 -0
- {xlsxwriter-3.2.3 → xlsxwriter-3.2.5}/examples/comments1.py +0 -0
- {xlsxwriter-3.2.3 → xlsxwriter-3.2.5}/examples/comments2.py +0 -0
- {xlsxwriter-3.2.3 → xlsxwriter-3.2.5}/examples/conditional_format.py +0 -0
- {xlsxwriter-3.2.3 → xlsxwriter-3.2.5}/examples/context_manager.py +0 -0
- {xlsxwriter-3.2.3 → xlsxwriter-3.2.5}/examples/data_validate.py +0 -0
- {xlsxwriter-3.2.3 → xlsxwriter-3.2.5}/examples/datetimes.py +0 -0
- {xlsxwriter-3.2.3 → xlsxwriter-3.2.5}/examples/defined_name.py +0 -0
- {xlsxwriter-3.2.3 → xlsxwriter-3.2.5}/examples/demo.py +0 -0
- {xlsxwriter-3.2.3 → xlsxwriter-3.2.5}/examples/diagonal_border.py +0 -0
- {xlsxwriter-3.2.3 → xlsxwriter-3.2.5}/examples/django_simple.py +0 -0
- {xlsxwriter-3.2.3 → xlsxwriter-3.2.5}/examples/doc_properties.py +0 -0
- {xlsxwriter-3.2.3 → xlsxwriter-3.2.5}/examples/dynamic_arrays.py +0 -0
- {xlsxwriter-3.2.3 → xlsxwriter-3.2.5}/examples/embedded_images.py +0 -0
- {xlsxwriter-3.2.3 → xlsxwriter-3.2.5}/examples/headers_footers.py +0 -0
- {xlsxwriter-3.2.3 → xlsxwriter-3.2.5}/examples/hello_world.py +0 -0
- {xlsxwriter-3.2.3 → xlsxwriter-3.2.5}/examples/hide_row_col.py +0 -0
- {xlsxwriter-3.2.3 → xlsxwriter-3.2.5}/examples/hide_sheet.py +0 -0
- {xlsxwriter-3.2.3 → xlsxwriter-3.2.5}/examples/http_server.py +0 -0
- {xlsxwriter-3.2.3 → xlsxwriter-3.2.5}/examples/hyperlink.py +0 -0
- {xlsxwriter-3.2.3 → xlsxwriter-3.2.5}/examples/ignore_errors.py +0 -0
- {xlsxwriter-3.2.3 → xlsxwriter-3.2.5}/examples/images.py +0 -0
- {xlsxwriter-3.2.3 → xlsxwriter-3.2.5}/examples/images_bytesio.py +0 -0
- {xlsxwriter-3.2.3 → xlsxwriter-3.2.5}/examples/inheritance1.py +0 -0
- {xlsxwriter-3.2.3 → xlsxwriter-3.2.5}/examples/inheritance2.py +0 -0
- {xlsxwriter-3.2.3 → xlsxwriter-3.2.5}/examples/lambda.py +0 -0
- {xlsxwriter-3.2.3 → xlsxwriter-3.2.5}/examples/macros.py +0 -0
- {xlsxwriter-3.2.3 → xlsxwriter-3.2.5}/examples/merge1.py +0 -0
- {xlsxwriter-3.2.3 → xlsxwriter-3.2.5}/examples/merge_rich_string.py +0 -0
- {xlsxwriter-3.2.3 → xlsxwriter-3.2.5}/examples/outline.py +0 -0
- {xlsxwriter-3.2.3 → xlsxwriter-3.2.5}/examples/outline_collapsed.py +0 -0
- {xlsxwriter-3.2.3 → xlsxwriter-3.2.5}/examples/pandas_autofilter.py +0 -0
- {xlsxwriter-3.2.3 → xlsxwriter-3.2.5}/examples/pandas_chart.py +0 -0
- {xlsxwriter-3.2.3 → xlsxwriter-3.2.5}/examples/pandas_chart_columns.py +0 -0
- {xlsxwriter-3.2.3 → xlsxwriter-3.2.5}/examples/pandas_chart_line.py +0 -0
- {xlsxwriter-3.2.3 → xlsxwriter-3.2.5}/examples/pandas_column_formats.py +0 -0
- {xlsxwriter-3.2.3 → xlsxwriter-3.2.5}/examples/pandas_conditional_format.py +0 -0
- {xlsxwriter-3.2.3 → xlsxwriter-3.2.5}/examples/pandas_datetime.py +0 -0
- {xlsxwriter-3.2.3 → xlsxwriter-3.2.5}/examples/pandas_header_format.py +0 -0
- {xlsxwriter-3.2.3 → xlsxwriter-3.2.5}/examples/pandas_multiple.py +0 -0
- {xlsxwriter-3.2.3 → xlsxwriter-3.2.5}/examples/pandas_percentage.py +0 -0
- {xlsxwriter-3.2.3 → xlsxwriter-3.2.5}/examples/pandas_positioning.py +0 -0
- {xlsxwriter-3.2.3 → xlsxwriter-3.2.5}/examples/pandas_simple.py +0 -0
- {xlsxwriter-3.2.3 → xlsxwriter-3.2.5}/examples/pandas_table.py +0 -0
- {xlsxwriter-3.2.3 → xlsxwriter-3.2.5}/examples/panes.py +0 -0
- {xlsxwriter-3.2.3 → xlsxwriter-3.2.5}/examples/polars_chart.py +0 -0
- {xlsxwriter-3.2.3 → xlsxwriter-3.2.5}/examples/polars_checkbox.py +0 -0
- {xlsxwriter-3.2.3 → xlsxwriter-3.2.5}/examples/polars_conditional_format.py +0 -0
- {xlsxwriter-3.2.3 → xlsxwriter-3.2.5}/examples/polars_format_custom.py +0 -0
- {xlsxwriter-3.2.3 → xlsxwriter-3.2.5}/examples/polars_format_default.py +0 -0
- {xlsxwriter-3.2.3 → xlsxwriter-3.2.5}/examples/polars_multiple.py +0 -0
- {xlsxwriter-3.2.3 → xlsxwriter-3.2.5}/examples/polars_positioning.py +0 -0
- {xlsxwriter-3.2.3 → xlsxwriter-3.2.5}/examples/polars_simple.py +0 -0
- {xlsxwriter-3.2.3 → xlsxwriter-3.2.5}/examples/polars_sparklines.py +0 -0
- {xlsxwriter-3.2.3 → xlsxwriter-3.2.5}/examples/polars_xlsxwriter.py +0 -0
- {xlsxwriter-3.2.3 → xlsxwriter-3.2.5}/examples/rich_strings.py +0 -0
- {xlsxwriter-3.2.3 → xlsxwriter-3.2.5}/examples/right_to_left.py +0 -0
- {xlsxwriter-3.2.3 → xlsxwriter-3.2.5}/examples/sensitivity_label.py +0 -0
- {xlsxwriter-3.2.3 → xlsxwriter-3.2.5}/examples/sparklines1.py +0 -0
- {xlsxwriter-3.2.3 → xlsxwriter-3.2.5}/examples/sparklines2.py +0 -0
- {xlsxwriter-3.2.3 → xlsxwriter-3.2.5}/examples/tab_colors.py +0 -0
- {xlsxwriter-3.2.3 → xlsxwriter-3.2.5}/examples/tables.py +0 -0
- {xlsxwriter-3.2.3 → xlsxwriter-3.2.5}/examples/text_indent.py +0 -0
- {xlsxwriter-3.2.3 → xlsxwriter-3.2.5}/examples/textbox.py +0 -0
- {xlsxwriter-3.2.3 → xlsxwriter-3.2.5}/examples/tutorial1.py +0 -0
- {xlsxwriter-3.2.3 → xlsxwriter-3.2.5}/examples/tutorial2.py +0 -0
- {xlsxwriter-3.2.3 → xlsxwriter-3.2.5}/examples/tutorial3.py +0 -0
- {xlsxwriter-3.2.3 → xlsxwriter-3.2.5}/examples/unicode.py +0 -0
- {xlsxwriter-3.2.3 → xlsxwriter-3.2.5}/examples/unicode_polish_utf8.py +0 -0
- {xlsxwriter-3.2.3 → xlsxwriter-3.2.5}/examples/unicode_polish_utf8.txt +0 -0
- {xlsxwriter-3.2.3 → xlsxwriter-3.2.5}/examples/unicode_shift_jis.py +0 -0
- {xlsxwriter-3.2.3 → xlsxwriter-3.2.5}/examples/unicode_shift_jis.txt +0 -0
- {xlsxwriter-3.2.3 → xlsxwriter-3.2.5}/examples/user_types1.py +0 -0
- {xlsxwriter-3.2.3 → xlsxwriter-3.2.5}/examples/user_types2.py +0 -0
- {xlsxwriter-3.2.3 → xlsxwriter-3.2.5}/examples/user_types3.py +0 -0
- {xlsxwriter-3.2.3 → xlsxwriter-3.2.5}/examples/vbaProject.bin +0 -0
- {xlsxwriter-3.2.3 → xlsxwriter-3.2.5}/examples/vba_extract.py +0 -0
- {xlsxwriter-3.2.3 → xlsxwriter-3.2.5}/examples/watermark.py +0 -0
- {xlsxwriter-3.2.3 → xlsxwriter-3.2.5}/examples/worksheet_protection.py +0 -0
- {xlsxwriter-3.2.3 → xlsxwriter-3.2.5}/setup.cfg +0 -0
- {xlsxwriter-3.2.3 → xlsxwriter-3.2.5}/xlsxwriter/app.py +0 -0
- {xlsxwriter-3.2.3 → xlsxwriter-3.2.5}/xlsxwriter/chart_area.py +0 -0
- {xlsxwriter-3.2.3 → xlsxwriter-3.2.5}/xlsxwriter/chart_bar.py +0 -0
- {xlsxwriter-3.2.3 → xlsxwriter-3.2.5}/xlsxwriter/chart_column.py +0 -0
- {xlsxwriter-3.2.3 → xlsxwriter-3.2.5}/xlsxwriter/chart_doughnut.py +0 -0
- {xlsxwriter-3.2.3 → xlsxwriter-3.2.5}/xlsxwriter/chart_line.py +0 -0
- {xlsxwriter-3.2.3 → xlsxwriter-3.2.5}/xlsxwriter/chart_pie.py +0 -0
- {xlsxwriter-3.2.3 → xlsxwriter-3.2.5}/xlsxwriter/chart_radar.py +0 -0
- {xlsxwriter-3.2.3 → xlsxwriter-3.2.5}/xlsxwriter/chart_scatter.py +0 -0
- {xlsxwriter-3.2.3 → xlsxwriter-3.2.5}/xlsxwriter/chart_stock.py +0 -0
- {xlsxwriter-3.2.3 → xlsxwriter-3.2.5}/xlsxwriter/chartsheet.py +0 -0
- {xlsxwriter-3.2.3 → xlsxwriter-3.2.5}/xlsxwriter/contenttypes.py +0 -0
- {xlsxwriter-3.2.3 → xlsxwriter-3.2.5}/xlsxwriter/core.py +0 -0
- {xlsxwriter-3.2.3 → xlsxwriter-3.2.5}/xlsxwriter/custom.py +0 -0
- {xlsxwriter-3.2.3 → xlsxwriter-3.2.5}/xlsxwriter/exceptions.py +0 -0
- {xlsxwriter-3.2.3 → xlsxwriter-3.2.5}/xlsxwriter/feature_property_bag.py +0 -0
- {xlsxwriter-3.2.3 → xlsxwriter-3.2.5}/xlsxwriter/metadata.py +0 -0
- {xlsxwriter-3.2.3 → xlsxwriter-3.2.5}/xlsxwriter/packager.py +0 -0
- {xlsxwriter-3.2.3 → xlsxwriter-3.2.5}/xlsxwriter/relationships.py +0 -0
- {xlsxwriter-3.2.3 → xlsxwriter-3.2.5}/xlsxwriter/rich_value.py +0 -0
- {xlsxwriter-3.2.3 → xlsxwriter-3.2.5}/xlsxwriter/rich_value_rel.py +0 -0
- {xlsxwriter-3.2.3 → xlsxwriter-3.2.5}/xlsxwriter/rich_value_structure.py +0 -0
- {xlsxwriter-3.2.3 → xlsxwriter-3.2.5}/xlsxwriter/rich_value_types.py +0 -0
- {xlsxwriter-3.2.3 → xlsxwriter-3.2.5}/xlsxwriter/sharedstrings.py +0 -0
- {xlsxwriter-3.2.3 → xlsxwriter-3.2.5}/xlsxwriter/table.py +0 -0
- {xlsxwriter-3.2.3 → xlsxwriter-3.2.5}/xlsxwriter/theme.py +0 -0
- {xlsxwriter-3.2.3 → xlsxwriter-3.2.5}/xlsxwriter/xmlwriter.py +0 -0
- {xlsxwriter-3.2.3/XlsxWriter.egg-info → xlsxwriter-3.2.5/xlsxwriter.egg-info}/dependency_links.txt +0 -0
- {xlsxwriter-3.2.3/XlsxWriter.egg-info → xlsxwriter-3.2.5/xlsxwriter.egg-info}/top_level.txt +0 -0
|
@@ -1,3 +1,29 @@
|
|
|
1
|
+
Release 3.2.5 - June 17 2025
|
|
2
|
+
----------------------------
|
|
3
|
+
|
|
4
|
+
* Fixed issue where a test function was made public incorrectly which caused
|
|
5
|
+
warnings about a missing ``xlsxwriter.test`` module.
|
|
6
|
+
|
|
7
|
+
:issue:`1138`.
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
Release 3.2.4 - June 17 2025
|
|
11
|
+
----------------------------
|
|
12
|
+
|
|
13
|
+
* Added support for a :ref:`Color() <Color>` type. This is backwards compatible
|
|
14
|
+
with existing Html and named color string types but also adds support for
|
|
15
|
+
theme colors. See also :ref:`colors`.
|
|
16
|
+
|
|
17
|
+
* Fixed issue where ``write_url()`` dropped implicit support for generic URL
|
|
18
|
+
types due to the refactoring into a ``Url`` type in the previous release.
|
|
19
|
+
|
|
20
|
+
:issue:`1129`.
|
|
21
|
+
|
|
22
|
+
* Fixed issue where ``max_url_length`` parameter wasn't honored.
|
|
23
|
+
|
|
24
|
+
:issue:`1130`.
|
|
25
|
+
|
|
26
|
+
|
|
1
27
|
Release 3.2.3 - April 17 2025
|
|
2
28
|
-----------------------------
|
|
3
29
|
|
|
@@ -26,6 +52,10 @@ Release 3.2.3 - April 17 2025
|
|
|
26
52
|
This is part of a modernization of the XlsxWriter code base, see "XlsxWriter
|
|
27
53
|
Roadmap v2" :feature:`1128`.
|
|
28
54
|
|
|
55
|
+
* As part of the type annotation refactoring support was added for an explicit
|
|
56
|
+
``Url`` type in addition to the implicit string URLs used in previous
|
|
57
|
+
versions. This isn't documented in this release.
|
|
58
|
+
|
|
29
59
|
|
|
30
60
|
Release 3.2.2 - January 28 2025
|
|
31
61
|
-------------------------------
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.2
|
|
2
|
-
Name:
|
|
3
|
-
Version: 3.2.
|
|
2
|
+
Name: xlsxwriter
|
|
3
|
+
Version: 3.2.5
|
|
4
4
|
Summary: A Python module for creating Excel XLSX files.
|
|
5
5
|
Home-page: https://github.com/jmcnamara/XlsxWriter
|
|
6
6
|
Author: John McNamara
|
|
@@ -17,7 +17,7 @@ Classifier: Programming Language :: Python :: 3.10
|
|
|
17
17
|
Classifier: Programming Language :: Python :: 3.11
|
|
18
18
|
Classifier: Programming Language :: Python :: 3.12
|
|
19
19
|
Classifier: Programming Language :: Python :: 3.13
|
|
20
|
-
Requires-Python: >=3.
|
|
20
|
+
Requires-Python: >=3.8
|
|
21
21
|
License-File: LICENSE.txt
|
|
22
22
|
Dynamic: author
|
|
23
23
|
Dynamic: author-email
|
|
@@ -54,7 +54,7 @@ including:
|
|
|
54
54
|
* Support for adding Macros.
|
|
55
55
|
* Memory optimization mode for writing large files.
|
|
56
56
|
|
|
57
|
-
It supports Python 3.
|
|
57
|
+
It supports Python 3.8+ and PyPy3 and uses standard libraries only.
|
|
58
58
|
|
|
59
59
|
Here is a simple example:
|
|
60
60
|
|
|
@@ -24,7 +24,7 @@ including:
|
|
|
24
24
|
* Support for adding Macros.
|
|
25
25
|
* Memory optimization mode for writing large files.
|
|
26
26
|
|
|
27
|
-
It supports Python 3.
|
|
27
|
+
It supports Python 3.8+ and PyPy3 and uses standard libraries only.
|
|
28
28
|
|
|
29
29
|
Here is a simple example:
|
|
30
30
|
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
##############################################################################
|
|
2
|
+
#
|
|
3
|
+
# A demonstration of the RGB and Theme colors palettes available in the
|
|
4
|
+
# XlsxWriter Python module.
|
|
5
|
+
#
|
|
6
|
+
# SPDX-License-Identifier: BSD-2-Clause
|
|
7
|
+
#
|
|
8
|
+
# Copyright (c) 2013-2025, John McNamara, jmcnamara@cpan.org
|
|
9
|
+
#
|
|
10
|
+
import xlsxwriter
|
|
11
|
+
from xlsxwriter.color import Color
|
|
12
|
+
|
|
13
|
+
# Create a new Excel file object.
|
|
14
|
+
workbook = xlsxwriter.Workbook("colors.xlsx")
|
|
15
|
+
|
|
16
|
+
# Add a worksheet for the RGB colors.
|
|
17
|
+
worksheet = workbook.add_worksheet("RGB Colors")
|
|
18
|
+
|
|
19
|
+
# Write some predefined colors to cells.
|
|
20
|
+
named_colors = [
|
|
21
|
+
"Black",
|
|
22
|
+
"Blue",
|
|
23
|
+
"Brown",
|
|
24
|
+
"Cyan",
|
|
25
|
+
"Gray",
|
|
26
|
+
"Green",
|
|
27
|
+
"Lime",
|
|
28
|
+
"Magenta",
|
|
29
|
+
"Navy",
|
|
30
|
+
"Orange",
|
|
31
|
+
"Pink",
|
|
32
|
+
"Purple",
|
|
33
|
+
"Red",
|
|
34
|
+
"Silver",
|
|
35
|
+
"White",
|
|
36
|
+
"Yellow",
|
|
37
|
+
]
|
|
38
|
+
|
|
39
|
+
# Write the named colors.
|
|
40
|
+
for row, name in enumerate(named_colors):
|
|
41
|
+
color_format = workbook.add_format({"bg_color": Color(name)})
|
|
42
|
+
worksheet.write_string(row, 0, name)
|
|
43
|
+
worksheet.write_blank(row, 1, None, color_format)
|
|
44
|
+
|
|
45
|
+
# Write some user-defined RGB colors to cells.
|
|
46
|
+
user_defined_colors = [
|
|
47
|
+
"#FF7F50",
|
|
48
|
+
"#DCDCDC",
|
|
49
|
+
"#6495ED",
|
|
50
|
+
"#DAA520",
|
|
51
|
+
]
|
|
52
|
+
|
|
53
|
+
for row, name in enumerate(user_defined_colors, start=len(named_colors)):
|
|
54
|
+
color_format = workbook.add_format({"bg_color": Color(name)})
|
|
55
|
+
worksheet.write_string(row, 0, name)
|
|
56
|
+
worksheet.write_blank(row, 1, None, color_format)
|
|
57
|
+
|
|
58
|
+
# Add a worksheet for the Theme colors.
|
|
59
|
+
worksheet = workbook.add_worksheet("Theme Colors")
|
|
60
|
+
|
|
61
|
+
# Add alternative colors for the cell text.
|
|
62
|
+
black_text = Color("#000000")
|
|
63
|
+
white_text = Color("#FFFFFF")
|
|
64
|
+
|
|
65
|
+
# Create a cell with each of the theme colors.
|
|
66
|
+
for row in range(6):
|
|
67
|
+
for col in range(10):
|
|
68
|
+
# Use the theme color for the background.
|
|
69
|
+
theme_color = Color.theme(col, row)
|
|
70
|
+
|
|
71
|
+
# Use white font color for better contrast on dark backgrounds.
|
|
72
|
+
if col != 0:
|
|
73
|
+
font_color = white_text
|
|
74
|
+
else:
|
|
75
|
+
font_color = black_text
|
|
76
|
+
|
|
77
|
+
color_format = workbook.add_format(
|
|
78
|
+
{
|
|
79
|
+
"align": "center",
|
|
80
|
+
"bg_color": theme_color,
|
|
81
|
+
"font_color": font_color,
|
|
82
|
+
}
|
|
83
|
+
)
|
|
84
|
+
worksheet.write_string(row, col, f"({col}, {row})", color_format)
|
|
85
|
+
|
|
86
|
+
# Save the file to disk.
|
|
87
|
+
workbook.close()
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import sys
|
|
2
|
+
from warnings import warn
|
|
3
|
+
|
|
4
|
+
from setuptools import setup
|
|
5
|
+
|
|
6
|
+
if sys.version_info < (3, 8):
|
|
7
|
+
warn("The minimum Python version supported by XlsxWriter is 3.8")
|
|
8
|
+
sys.exit()
|
|
9
|
+
|
|
10
|
+
setup(
|
|
11
|
+
name="xlsxwriter",
|
|
12
|
+
version="3.2.5",
|
|
13
|
+
author="John McNamara",
|
|
14
|
+
author_email="jmcnamara@cpan.org",
|
|
15
|
+
url="https://github.com/jmcnamara/XlsxWriter",
|
|
16
|
+
packages=["xlsxwriter"],
|
|
17
|
+
scripts=["examples/vba_extract.py"],
|
|
18
|
+
license="BSD-2-Clause",
|
|
19
|
+
description="A Python module for creating Excel XLSX files.",
|
|
20
|
+
long_description=open("README.rst", encoding="utf-8").read(),
|
|
21
|
+
classifiers=[
|
|
22
|
+
"Development Status :: 5 - Production/Stable",
|
|
23
|
+
"License :: OSI Approved :: BSD License",
|
|
24
|
+
"Programming Language :: Python",
|
|
25
|
+
"Programming Language :: Python :: 3 :: Only",
|
|
26
|
+
"Programming Language :: Python :: 3",
|
|
27
|
+
"Programming Language :: Python :: 3.8",
|
|
28
|
+
"Programming Language :: Python :: 3.9",
|
|
29
|
+
"Programming Language :: Python :: 3.10",
|
|
30
|
+
"Programming Language :: Python :: 3.11",
|
|
31
|
+
"Programming Language :: Python :: 3.12",
|
|
32
|
+
"Programming Language :: Python :: 3.13",
|
|
33
|
+
],
|
|
34
|
+
python_requires=">=3.8",
|
|
35
|
+
)
|
|
@@ -11,11 +11,12 @@ import copy
|
|
|
11
11
|
import re
|
|
12
12
|
from warnings import warn
|
|
13
13
|
|
|
14
|
+
from xlsxwriter.color import Color, ColorTypes
|
|
15
|
+
|
|
14
16
|
from . import xmlwriter
|
|
15
17
|
from .shape import Shape
|
|
16
18
|
from .utility import (
|
|
17
19
|
_datetime_to_excel_datetime,
|
|
18
|
-
_get_rgb_color,
|
|
19
20
|
_supported_datetime,
|
|
20
21
|
quote_sheetname,
|
|
21
22
|
xl_range_formula,
|
|
@@ -204,7 +205,10 @@ class Chart(xmlwriter.XMLwriter):
|
|
|
204
205
|
|
|
205
206
|
# Set the "invert if negative" fill property.
|
|
206
207
|
invert_if_neg = options.get("invert_if_negative", False)
|
|
207
|
-
inverted_color = options.get("invert_if_negative_color"
|
|
208
|
+
inverted_color = options.get("invert_if_negative_color")
|
|
209
|
+
|
|
210
|
+
if inverted_color:
|
|
211
|
+
inverted_color = Color._from_value(inverted_color)
|
|
208
212
|
|
|
209
213
|
# Set the secondary axis properties.
|
|
210
214
|
x2_axis = options.get("x2_axis")
|
|
@@ -845,6 +849,9 @@ class Chart(xmlwriter.XMLwriter):
|
|
|
845
849
|
if font["rotation"]:
|
|
846
850
|
font["rotation"] = 60000 * int(font["rotation"])
|
|
847
851
|
|
|
852
|
+
if font.get("color"):
|
|
853
|
+
font["color"] = Color._from_value(font["color"])
|
|
854
|
+
|
|
848
855
|
return font
|
|
849
856
|
|
|
850
857
|
def _list_to_formula(self, data):
|
|
@@ -1889,7 +1896,7 @@ class Chart(xmlwriter.XMLwriter):
|
|
|
1889
1896
|
|
|
1890
1897
|
self._xml_end_tag("c:ser")
|
|
1891
1898
|
|
|
1892
|
-
def _write_c_ext_lst_inverted_color(self, color):
|
|
1899
|
+
def _write_c_ext_lst_inverted_color(self, color: Color):
|
|
1893
1900
|
# Write the <c:extLst> element for the inverted fill color.
|
|
1894
1901
|
|
|
1895
1902
|
uri = "{6F2FDCE9-48DA-4B69-8628-5D25D57E5C99}"
|
|
@@ -3156,7 +3163,7 @@ class Chart(xmlwriter.XMLwriter):
|
|
|
3156
3163
|
style_attributes = Shape._get_font_style_attributes(font)
|
|
3157
3164
|
latin_attributes = Shape._get_font_latin_attributes(font)
|
|
3158
3165
|
|
|
3159
|
-
if font and font.get("color")
|
|
3166
|
+
if font and font.get("color"):
|
|
3160
3167
|
has_color = True
|
|
3161
3168
|
|
|
3162
3169
|
if latin_attributes or has_color:
|
|
@@ -3201,7 +3208,7 @@ class Chart(xmlwriter.XMLwriter):
|
|
|
3201
3208
|
style_attributes = Shape._get_font_style_attributes(font)
|
|
3202
3209
|
latin_attributes = Shape._get_font_latin_attributes(font)
|
|
3203
3210
|
|
|
3204
|
-
if font and font["color"]
|
|
3211
|
+
if font and font["color"]:
|
|
3205
3212
|
has_color = True
|
|
3206
3213
|
|
|
3207
3214
|
# Add the lang type to the attributes.
|
|
@@ -3362,17 +3369,46 @@ class Chart(xmlwriter.XMLwriter):
|
|
|
3362
3369
|
|
|
3363
3370
|
self._xml_start_tag("a:solidFill")
|
|
3364
3371
|
|
|
3365
|
-
if "color"
|
|
3366
|
-
|
|
3367
|
-
|
|
3372
|
+
if fill.get("color"):
|
|
3373
|
+
self._write_color(fill["color"], fill.get("transparency"))
|
|
3374
|
+
|
|
3375
|
+
self._xml_end_tag("a:solidFill")
|
|
3376
|
+
|
|
3377
|
+
def _write_color(self, color: Color, transparency=None):
|
|
3378
|
+
# Write the appropriate chart color element.
|
|
3379
|
+
|
|
3380
|
+
if not color:
|
|
3381
|
+
return
|
|
3382
|
+
|
|
3383
|
+
if color._is_automatic:
|
|
3384
|
+
# Write the a:sysClr element.
|
|
3385
|
+
self._write_a_sys_clr()
|
|
3386
|
+
elif color._type == ColorTypes.RGB:
|
|
3368
3387
|
# Write the a:srgbClr element.
|
|
3369
3388
|
self._write_a_srgb_clr(color, transparency)
|
|
3389
|
+
elif color._type == ColorTypes.THEME:
|
|
3390
|
+
self._write_a_scheme_clr(color, transparency)
|
|
3370
3391
|
|
|
3371
|
-
|
|
3392
|
+
def _write_a_sys_clr(self):
|
|
3393
|
+
# Write the <a:sysClr> element.
|
|
3372
3394
|
|
|
3373
|
-
|
|
3395
|
+
val = "window"
|
|
3396
|
+
last_clr = "FFFFFF"
|
|
3397
|
+
|
|
3398
|
+
attributes = [
|
|
3399
|
+
("val", val),
|
|
3400
|
+
("lastClr", last_clr),
|
|
3401
|
+
]
|
|
3402
|
+
|
|
3403
|
+
self._xml_empty_tag("a:sysClr", attributes)
|
|
3404
|
+
|
|
3405
|
+
def _write_a_srgb_clr(self, color: Color, transparency=None):
|
|
3374
3406
|
# Write the <a:srgbClr> element.
|
|
3375
|
-
|
|
3407
|
+
|
|
3408
|
+
if not color:
|
|
3409
|
+
return
|
|
3410
|
+
|
|
3411
|
+
attributes = [("val", color._rgb_hex_value())]
|
|
3376
3412
|
|
|
3377
3413
|
if transparency:
|
|
3378
3414
|
self._xml_start_tag("a:srgbClr", attributes)
|
|
@@ -3384,6 +3420,42 @@ class Chart(xmlwriter.XMLwriter):
|
|
|
3384
3420
|
else:
|
|
3385
3421
|
self._xml_empty_tag("a:srgbClr", attributes)
|
|
3386
3422
|
|
|
3423
|
+
def _write_a_scheme_clr(self, color: Color, transparency=None):
|
|
3424
|
+
# Write the <a:schemeClr> element.
|
|
3425
|
+
scheme, lum_mod, lum_off = color._chart_scheme()
|
|
3426
|
+
attributes = [("val", scheme)]
|
|
3427
|
+
|
|
3428
|
+
if lum_mod > 0 or lum_off > 0 or transparency:
|
|
3429
|
+
self._xml_start_tag("a:schemeClr", attributes)
|
|
3430
|
+
|
|
3431
|
+
if lum_mod > 0:
|
|
3432
|
+
# Write the a:lumMod element.
|
|
3433
|
+
self._write_a_lum_mod(lum_mod)
|
|
3434
|
+
|
|
3435
|
+
if lum_off > 0:
|
|
3436
|
+
# Write the a:lumOff element.
|
|
3437
|
+
self._write_a_lum_off(lum_off)
|
|
3438
|
+
|
|
3439
|
+
if transparency:
|
|
3440
|
+
# Write the a:alpha element.
|
|
3441
|
+
self._write_a_alpha(transparency)
|
|
3442
|
+
|
|
3443
|
+
self._xml_end_tag("a:schemeClr")
|
|
3444
|
+
else:
|
|
3445
|
+
self._xml_empty_tag("a:schemeClr", attributes)
|
|
3446
|
+
|
|
3447
|
+
def _write_a_lum_mod(self, value: int):
|
|
3448
|
+
# Write the <a:lumMod> element.
|
|
3449
|
+
attributes = [("val", value)]
|
|
3450
|
+
|
|
3451
|
+
self._xml_empty_tag("a:lumMod", attributes)
|
|
3452
|
+
|
|
3453
|
+
def _write_a_lum_off(self, value: int):
|
|
3454
|
+
# Write the <a:lumOff> element.
|
|
3455
|
+
attributes = [("val", value)]
|
|
3456
|
+
|
|
3457
|
+
self._xml_empty_tag("a:lumOff", attributes)
|
|
3458
|
+
|
|
3387
3459
|
def _write_a_alpha(self, val):
|
|
3388
3460
|
# Write the <a:alpha> element.
|
|
3389
3461
|
|
|
@@ -4279,9 +4351,7 @@ class Chart(xmlwriter.XMLwriter):
|
|
|
4279
4351
|
attributes = [("pos", pos)]
|
|
4280
4352
|
self._xml_start_tag("a:gs", attributes)
|
|
4281
4353
|
|
|
4282
|
-
|
|
4283
|
-
color = _get_rgb_color(color)
|
|
4284
|
-
self._write_a_srgb_clr(color)
|
|
4354
|
+
self._write_color(color)
|
|
4285
4355
|
|
|
4286
4356
|
self._xml_end_tag("a:gs")
|
|
4287
4357
|
|
|
@@ -4357,26 +4427,14 @@ class Chart(xmlwriter.XMLwriter):
|
|
|
4357
4427
|
|
|
4358
4428
|
self._xml_end_tag("a:pattFill")
|
|
4359
4429
|
|
|
4360
|
-
def _write_a_fg_clr(self, color):
|
|
4430
|
+
def _write_a_fg_clr(self, color: Color):
|
|
4361
4431
|
# Write the <a:fgClr> element.
|
|
4362
|
-
|
|
4363
|
-
color = _get_rgb_color(color)
|
|
4364
|
-
|
|
4365
4432
|
self._xml_start_tag("a:fgClr")
|
|
4366
|
-
|
|
4367
|
-
# Write the a:srgbClr element.
|
|
4368
|
-
self._write_a_srgb_clr(color)
|
|
4369
|
-
|
|
4433
|
+
self._write_color(color)
|
|
4370
4434
|
self._xml_end_tag("a:fgClr")
|
|
4371
4435
|
|
|
4372
|
-
def _write_a_bg_clr(self, color):
|
|
4436
|
+
def _write_a_bg_clr(self, color: Color):
|
|
4373
4437
|
# Write the <a:bgClr> element.
|
|
4374
|
-
|
|
4375
|
-
color = _get_rgb_color(color)
|
|
4376
|
-
|
|
4377
4438
|
self._xml_start_tag("a:bgClr")
|
|
4378
|
-
|
|
4379
|
-
# Write the a:srgbClr element.
|
|
4380
|
-
self._write_a_srgb_clr(color)
|
|
4381
|
-
|
|
4439
|
+
self._write_color(color)
|
|
4382
4440
|
self._xml_end_tag("a:bgClr")
|