8000 Merge openpyxl stubs from microsoft/python-type-stubs by Avasam · Pull Request #9511 · python/typeshed · GitHub
[go: up one dir, main page]

Skip to content

Merge openpyxl stubs from microsoft/python-type-stubs #9511

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
99 commits
Select commit Hold shift + click to select a range
e371358
Bring openpyxl stubs at least up to par with microsoft/python-type-stubs
Avasam Jan 10, 2023
f47d473
Merge branch 'main' of https://github.com/python/typeshed into openpy…
Avasam Jan 11, 2023
e08d3ea
Merge branch 'main' of https://github.com/python/typeshed into openpy…
Avasam Jan 12, 2023
9c14076
Include numpy
Avasam Jan 12, 2023
4e7fc09
Convertible Descriptors
Avasam Jan 12, 2023
8a9de85
Update after self-review
Avasam Jan 12, 2023
704399f
Merge branch 'main' of https://github.com/python/typeshed into openpy…
Avasam Feb 8, 2023
dd5a152
Update tests
Avasam Feb 8, 2023
f11292d
Fix pytype errors
Avasam Feb 9, 2023
e3419bd
Merge branch 'main' of https://github.com/python/typeshed into openpy…
Avasam Feb 21, 2023
7b034b2
Fixes
Avasam Feb 21, 2023
674f8ff
Merge branch 'main' of https://github.com/python/typeshed into openpy…
Avasam Feb 23, 2023
093b061
PR comments
Avasam Feb 23, 2023
ba82470
quick CI fixes
Avasam Feb 23, 2023
9e63d21
failed at version checking
Avasam Feb 23, 2023
d1e618e
Apply suggestions from code review
Avasam Feb 28, 2023
6d6d1ce
Add alias _UnderlineType and update Self
Avasam Feb 28, 2023
567a1a8
Merge branch 'openpyxl-from-microsoft-python-type-stubs' of https://g…
Avasam Feb 28, 2023
12789fe
Post-merge fixes
Avasam Feb 28, 2023
bfb6c60
Make stubuploader tests pass
Avasam Feb 28, 2023
2a98afc
Merge branch 'main' into openpyxl-from-microsoft-python-type-stubs
AlexWaygood Mar 16, 2023
f5df850
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Mar 16, 2023
028ac1c
Apply suggestions from code review
AlexWaygood Mar 16, 2023
6bdc7df
Update stubs/openpyxl/openpyxl/reader/workbook.pyi
AlexWaygood Mar 16, 2023
e5e4eb3
Merge branch 'main' of https://github.com/python/typeshed into openpy…
Avasam Mar 22, 2023
7b9ccae
Merge branch 'main' into openpyxl-from-microsoft-python-type-stubs
srittau Mar 24, 2023
c7c24e8
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Mar 24, 2023
368a500
Merge branch 'openpyxl-from-microsoft-python-type-stubs' of https://g…
Avasam Mar 31, 2023
ed09fc2
Run stubdefaulter
Avasam Mar 31, 2023
b5fd48c
Merge branch 'main' of https://github.com/python/typeshed into openpy…
Avasam Mar 31, 2023
feef334
Use new type aliases for params
Avasam May 10, 2023
bc66516
Type MetaSerialisable dunders
Avasam May 10, 2023
4bfc8fb
Merge branch 'Type-MetaSerialisable-dunders' of https://github.com/Av…
Avasam May 10, 2023
4a050d9
regroup __init__ in stubtest_allowlist
Avasam May 10, 2023
93c9bfc
.
Avasam May 10, 2023
a1f40c6
Merge branch 'main' of https://github.com/python/typeshed into openpy…
Avasam May 20, 2023
2557483
Merge branch 'main' of https://github.com/python/typeshed into openpy…
Avasam Jun 12, 2023
ff8e704
Type openpyxl incomplete dunders
Avasam Jun 12, 2023
ac138f8
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jun 12, 2023
031592c
Remove redundant suppressions
Avasam Jun 12, 2023
d856a33
Merge branch 'main' of https://github.com/python/typeshed into openpy…
Avasam Jun 13, 2023
328001b
Merge branch 'openpyxl-incomplete-dunders' of https://github.com/Avas…
Avasam Jun 13, 2023
82d17a6
Merge branch 'main' of https://github.com/python/typeshed into openpy…
Avasam Jun 15, 2023
c127da3
Merge branch 'openpyxl-incomplete-dunders' of https://github.com/Avas…
Avasam Jun 15, 2023
6331d8a
Merge branch 'main' of https://github.com/python/typeshed into openpy…
Avasam Jul 23, 2023
ce181aa
_SerialisableTreeElement
Avasam Jul 23, 2023
a4fff41
openpyxl: Class properties set explicitely as another class'
Avasam Aug 9, 2023
7b2180d
Merge branch 'main' of https://github.com/python/typeshed into openpy…
Avasam Aug 11, 2023
dba0b8d
Merge branch 'openpyxl-Class-properties-set-explicitely' of https://g…
Avasam Aug 11, 2023
aac6860
Complete openpyxl title type annotations
Avasam Aug 11, 2023
79bd5fe
Merge branch 'openpyxl-title' of https://github.com/Avasam/typeshed i…
Avasam Aug 12, 2023
0ba3633
Merge branch 'main' of https://github.com/python/typeshed into openpy…
Avasam Aug 15, 2023
50a27a8
Fixes post merge
Avasam Aug 18, 2023
8c43a40
Complete `from_tree`
Avasam Aug 18, 2023
f5cb6fe
Merge branch 'main' of https://github.com/python/typeshed into openpy…
Avasam Aug 21, 2023
491efaf
Serialisable.from_tree improvement to avoid override issues
Avasam Aug 21, 2023
94c8b66
Merge branch 'main' of https://github.com/python/typeshed into openpy…
Avasam Sep 12, 2023
a2e8d15
Type usages of PIL and zipfile
Avasam Sep 12, 2023
f08c6f1
Update stubtest_allowlist
Avasam Sep 12, 2023
29c9218
Update `get_rel`
Avasam Sep 12, 2023
c32f3e2
Merge branch 'main' of https://github.com/python/typeshed into openpy…
Avasam Sep 19, 2023
a27c72f
Merge branch 'openpyxl-external-types' of https://github.com/Avasam/t…
Avasam Sep 19, 2023
5a284d6
Extract PIL and zipfile to #10706
Avasam Sep 19, 2023
200c096
datetime and _FileRead changes and fixes
Avasam Sep 19, 2023
9eb96b8
Merge branch 'main' of https://github.com/python/typeshed into openpy…
Avasam Oct 13, 2023
d0793fc
Merge branch 'main' of https://github.com/python/typeshed into openpy…
Avasam Oct 16, 2023
b957b79
Revert some import changes to reduce changes
Avasam Oct 16, 2023
ae8101c
Generator send actually unknown
Avasam Oct 16, 2023
6f408a6
avoid backref
Avasam Oct 16, 2023
11446be
tagname stays classvar
Avasam Oct 16, 2023
1f66b3f
Merge branch 'main' of https://github.com/python/typeshed into openpy…
Avasam Nov 1, 2023
2fbb0e3
Merge branch 'main' of https://github.com/python/typeshed into openpy…
Avasam Nov 2, 2023
5fc62cc
non-complex extraction from 9511
Avasam Dec 1, 2023
cc96eb4
Fix CI failures
Avasam Dec 1, 2023
169ea20
create_sheet return type
Avasam Dec 1, 2023
c0521d1
Merge branch 'main' of https://github.com/python/typeshed into openpy…
Avasam Dec 1, 2023
d491dd8
Merge branch 'main' of https://github.com/python/typeshed into non-co…
Avasam Dec 1, 2023
a74c7ef
Post-merge fix missing Element
Avasam Dec 1, 2023
c272267
Merge branch 'non-complex-extraction-from-9511' of https://github.com…
Avasam Dec 1, 2023
17ff8a0
.
Avasam Dec 1, 2023
fd5a9a9
Merge branch 'main' of https://github.com/python/typeshed into openpy…
Avasam Dec 4, 2023
333054d
Merge branch 'main' of https://github.com/python/typeshed into openpy…
Avasam Dec 6, 2023
b35695d
Merge branch 'main' of https://github.com/python/typeshed into openpy…
Avasam Mar 6, 2024
3b0034b
Update stubs/openpyxl/openpyxl/worksheet/_reader.pyi
Avasam Mar 6, 2024
6290b35
Merge branch 'main' of https://github.com/python/typeshed into openpy…
Avasam Mar 11, 2024
08e4e91
Merge branch 'openpyxl-from-microsoft-python-type-stubs' of https://g…
Avasam Mar 11, 2024
a9021fc
Merge branch 'main' of https://github.com/python/typeshed into openpy…
Avasam Mar 13, 2024
2bf8906
Merge branch 'main' of https://github.com/python/typeshed into openpy…
Avasam Apr 1, 2024
8db96b3
Merge branch 'main' of https://github.com/python/typeshed into openpy…
Avasam Apr 8, 2024
e2f2720
Merge branch 'main' into openpyxl-from-microsoft-python-type-stubs
Avasam Aug 18, 2024
2979638
Merge branch 'main' into openpyxl-from-microsoft-python-type-stubs
Avasam Sep 23, 2024
9cd6ffe
openpyxl: `Cell | MergedCell` annotations
Avasam Nov 25, 2024
82b5fcc
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Nov 25, 2024
e0d6119
lint fixes
Avasam Nov 25, 2024
f17d61c
Merge branch 'main' of https://github.com/python/typeshed into openpy…
Avasam Nov 25, 2024
0b0b501
Rename _Cell to _CellOrMergedCell
Avasam Nov 25, 2024
1a6d68e
Merge branch 'openpyxl-Cell-or-MergedCell-annotations' of https://git…
Avasam Nov 25, 2024
3fe91a6
Merge branch 'main' of https://github.com/python/typeshed into openpy…
Avasam Nov 25, 2024
0542fd2
Merge branch 'main' of https://github.com/python/typeshed into openpy…
Avasam May 3, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Update tests
  • Loading branch information
Avasam committed Feb 8, 2023
commit dd5a1525b008fe8fb905a343c6713f39d1e1ff74
178 changes: 5 additions & 173 deletions stubs/openpyxl/@tests/stubtest_allowlist.txt
8000
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ openpyxl.descriptors.slots.AutoSlotProperties.__new__
# The actual runtime definition depends on what else is installed
# (lxml, defusedxml, et_xmlfile, numpy, ...)
openpyxl.compat.NUMERIC_TYPES
openpyxl.compat.numbers.NUMERIC_TYPES
openpyxl.cell.cell.NUMERIC_TYPES
openpyxl.xml._functions
openpyxl.xml.functions.Element.__iter__
openpyxl.xml.functions.tostring
Expand All @@ -28,184 +30,14 @@ openpyxl.utils.cell.col
openpyxl.utils.cell.i

# Unintended re-exports
openpyxl.cell._writer.LXML
openpyxl.cell._writer.REL_NS
openpyxl.cell._writer.XML_NS
openpyxl.cell.cell.NUMERIC_TYPES
openpyxl.cell.read_only.BUILTIN_FORMATS
openpyxl.cell.read_only.BUILTIN_FORMATS_MAX_SIZE
openpyxl.chart._chart.attribute_mapping
openpyxl.chart.axis.CHART_NS
openpyxl.chart.chartspace.CHART_NS
openpyxl.chart.marker.DRAWING_NS
openpyxl.chart.marker.PRESET_COLORS
openpyxl.chart.shapes.DRAWING_NS
openpyxl.chart.shapes.PRESET_COLORS
openpyxl.chartsheet.chartsheet.REL_NS
openpyxl.chartsheet.chartsheet.SHEET_MAIN_NS
openpyxl.comments.comment_sheet.SHEET_MAIN_NS
openpyxl.comments.comment_sheet.tostring
openpyxl.comments.shape_writer.tostring
openpyxl.compat.numbers.NUMERIC_TYPES
openpyxl.compat.strings.NUMERIC_TYPES
openpyxl.descriptors.excel.REL_NS
openpyxl.descriptors.serialisable.kwlist
openpyxl.drawing.colors.DRAWING_NS
openpyxl.drawing.drawing.BLACK
openpyxl.drawing.drawing.WHITE
openpyxl.drawing.fill.DRAWING_NS
openpyxl.drawing.fill.PRESET_COLORS
openpyxl.drawing.geometry.DRAWING_NS
openpyxl.drawing.graphic.CHART_NS
openpyxl.drawing.graphic.DRAWING_NS
openpyxl.drawing.graphic.NS_REGEX
openpyxl.drawing.graphic.REL_NS
openpyxl.drawing.line.DRAWING_NS
openpyxl.drawing.picture.DRAWING_NS
openpyxl.drawing.properties.DRAWING_NS
openpyxl.drawing.relation.CHART_NS
openpyxl.drawing.spreadsheet_drawing.SHEET_DRAWING_NS
openpyxl.drawing.text.DRAWING_NS
openpyxl.drawing.text.PRESET_COLORS
openpyxl.formatting.rule.COORD_RE
openpyxl.packaging.core.COREPROPS_NS
openpyxl.packaging.core.DCORE_NS
openpyxl.packaging.core.DCTERMS_NS
openpyxl.packaging.core.DCTERMS_PREFIX
openpyxl.packaging.core.tostring
openpyxl.packaging.core.XSI_NS
openpyxl.packaging.extended.XPROPS_NS
openpyxl.packaging.manifest.ACTIVEX
openpyxl.packaging.manifest.ARC_APP
openpyxl.packaging.manifest.ARC_CONTENT_TYPES
openpyxl.packaging.manifest.ARC_CORE
openpyxl.packaging.manifest.ARC_SHARED_STRINGS
openpyxl.packaging.manifest.ARC_STYLE
openpyxl.packaging.manifest.ARC_THEME
openpyxl.packaging.manifest.ARC_WORKBOOK
openpyxl.packaging.manifest.CHART_TYPE
openpyxl.packaging.manifest.CHARTSHAPE_TYPE
openpyxl.packaging.manifest.CHARTSHEET_TYPE
openpyxl.packaging.manifest.COMMENTS_TYPE
openpyxl.packaging.manifest.CONTYPES_NS
openpyxl.packaging.manifest.CTRL
openpyxl.packaging.manifest.DRAWING_TYPE
openpyxl.packaging.manifest.EXTERNAL_LINK
openpyxl.packaging.manifest.SHARED_STRINGS
openpyxl.packaging.manifest.STYLES_TYPE
openpyxl.packaging.manifest.THEME_TYPE
openpyxl.packaging.manifest.tostring
openpyxl.packaging.manifest.VBA
openpyxl.packaging.manifest.WORKSHEET_TYPE
openpyxl.packaging.manifest.XLSM
openpyxl.packaging.manifest.XLSX
openpyxl.packaging.manifest.XLTM
openpyxl.packaging.manifest.XLTX
openpyxl.packaging.relationship.PKG_REL_NS
openpyxl.packaging.relationship.REL_NS
openpyxl.packaging.relationship.tostring
openpyxl.packaging.workbook.SHEET_MAIN_NS
openpyxl.pivot.cache.SHEET_MAIN_NS
openpyxl.pivot.cache.tostring
openpyxl.pivot.record.SHEET_MAIN_NS
openpyxl.pivot.record.tostring
openpyxl.pivot.table.SHEET_MAIN_NS
openpyxl.pivot.table.tostring
openpyxl.reader.drawings.IMAGE_NS
openpyxl.reader.drawings.PILImage
openpyxl.reader.excel.ARC_CONTENT_TYPES
openpyxl.reader.excel.ARC_CORE
openpyxl.reader.excel.ARC_SHARED_STRINGS
openpyxl.reader.excel.ARC_THEME
openpyxl.reader.excel.ARC_WORKBOOK
openpyxl.reader.excel.COMMENTS_NS
openpyxl.reader.excel.EXTERNAL_LINK
openpyxl.reader.excel.KEEP_VBA
openpyxl.reader.excel.SHARED_STRINGS
openpyxl.reader.excel.XLSM
openpyxl.reader.excel.XLSX
openpyxl.reader.excel.XLTM
openpyxl.reader.excel.XLTX
openpyxl.reader.excel.ZIP_DEFLATED
openpyxl.reader.strings.SHEET_MAIN_NS
openpyxl.reader.workbook.CALENDAR_MAC_1904
openpyxl.styles.fills.SHEET_MAIN_NS
openpyxl.styles.fonts.BLACK
openpyxl.styles.fonts.SHEET_MAIN_NS
openpyxl.styles.named_styles.BUILTIN_FORMATS_MAX_SIZE
openpyxl.styles.named_styles.BUILTIN_FORMATS_REVERSE
openpyxl.styles.styleable.BUILTIN_FORMATS
openpyxl.styles.styleable.BUILTIN_FORMATS_MAX_SIZE
openpyxl.styles.styleable.BUILTIN_FORMATS_REVERSE
openpyxl.styles.styleable.styles
openpyxl.styles.stylesheet.ARC_STYLE
openpyxl.styles.stylesheet.BUILTIN_FORMATS
openpyxl.styles.stylesheet.BUILTIN_FORMATS_MAX_SIZE
openpyxl.styles.stylesheet.BUILTIN_FORMATS_REVERSE
openpyxl.styles.stylesheet.COLOR_INDEX
openpyxl.styles.stylesheet.SHEET_MAIN_NS
openpyxl.styles.stylesheet.styles
openpyxl.utils.cell.digits
openpyxl.workbook._writer.ARC_APP
openpyxl.workbook._writer.ARC_CORE
openpyxl.workbook._writer.ARC_ROOT_RELS
openpyxl.workbook._writer.ARC_WORKBOOK
openpyxl.workbook._writer.CALENDAR_MAC_1904
openpyxl.workbook._writer.CUSTOMUI_NS
openpyxl.workbook._writer.PKG_REL_NS
openpyxl.workbook._writer.tostring
openpyxl.workbook.defined_name.SHEET_TITLE
openpyxl.workbook.defined_name.SHEETRANGE_RE
openpyxl.workbook.external_link.external.SHEET_MAIN_NS
openpyxl.workbook.workbook.COLOR_INDEX
openpyxl.workbook.workbook.MAC_EPOCH
openpyxl.workbook.workbook.WINDOWS_EPOCH
openpyxl.workbook.workbook.XLSM
openpyxl.workbook.workbook.XLSX
openpyxl.workbook.workbook.XLTM
openpyxl.workbook.workbook.XLTX
openpyxl.worksheet._reader.EXT_TYPES
openpyxl.worksheet._reader.SHEET_MAIN_NS
openpyxl.worksheet._reader.WINDOWS_EPOCH
openpyxl.worksheet._writer.SHEET_MAIN_NS
openpyxl.worksheet.dimensions.DEFAULT_COLUMN_WIDTH
openpyxl.worksheet.ole.SHEET_DRAWING_NS
openpyxl.worksheet.table.REL_NS
openpyxl.worksheet.table.SHEET_MAIN_NS
openpyxl.worksheet.table.tostring
openpyxl.worksheet.worksheet.COL_RANGE_RE
openpyxl.worksheet.worksheet.ROW_RANGE_RE
openpyxl.writer.excel.ARC_APP
openpyxl.writer.excel.ARC_CONTENT_TYPES
openpyxl.writer.excel.ARC_CORE
openpyxl.writer.excel.ARC_ROOT_RELS
openpyxl.writer.excel.ARC_SHARED_STRINGS
openpyxl.writer.excel.ARC_STYLE
openpyxl.writer.excel.ARC_THEME
openpyxl.writer.excel.ARC_WORKBOOK
openpyxl.writer.excel.ARC_WORKBOOK_RELS
openpyxl.writer.excel.PACKAGE_CHARTS
openpyxl.writer.excel.PACKAGE_CHARTSHEETS
openpyxl.writer.excel.PACKAGE_DRAWINGS
openpyxl.writer.excel.PACKAGE_IMAGES
openpyxl.writer.excel.PACKAGE_WORKSHEETS
openpyxl.writer.excel.PACKAGE_XL
openpyxl.writer.excel.theme_xml
openpyxl.writer.excel.tostring
openpyxl.writer.excel.ZIP_DEFLATED
openpyxl.xml.functions.CHART_DRAWING_NS
openpyxl.xml.functions.CHART_NS
openpyxl.xml.functions.COREPROPS_NS
openpyxl.xml.functions.DCTERMS_NS
openpyxl.xml.functions.DCTERMS_PREFIX
openpyxl.xml.functions.DEFUSEDXML
openpyxl.xml.functions.DRAWING_NS
openpyxl.xml.functions.LXML
openpyxl.xml.functions.REL_NS
openpyxl.xml.functions.SHEET_DRAWING_NS
openpyxl.xml.functions.SHEET_MAIN_NS
openpyxl.xml.functions.VTYPES_NS
openpyxl.xml.functions.XML_NS

# Type vs class stubtest issue
openpyxl.chart.descriptors.NumberFormatDescriptor.expected_type

# Variable differs from runtime type because attributes are actually
# non-Convertible descriptors and the value is obtained through a dynamic getter
Expand Down
20 changes: 17 additions & 3 deletions stubs/openpyxl/openpyxl/cell/cell.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,20 @@ TIME_FORMATS: dict[_TimeTypes, str]
STRING_TYPES: tuple[type[str], type[bytes]]
_StringTypes: TypeAlias = str | bytes
# mypy will simplify the type. Pyright fully expands it.
KNOWN_TYPES = NUMERIC_TYPES + TIME_TYPES + STRING_TYPES + (bool, type(None)) # noqa: F821,Y026
KNOWN_TYPES = NUMERIC_TYPES + TIME_TYPES + STRING_TYPES + (bool, type(None)) # noqa: F821,Y015
_KnownTypes: TypeAlias = _NumericTypes | _TimeTypes | _StringTypes | bool | None
ILLEGAL_CHARACTERS_RE: Pattern[str]
ERROR_CODES: Final = ("#NULL!", "#DIV/0!", "#VALUE!", "#REF!", "#NAME?", "#NUM!", "#N/A")
ERROR_CODES: Final[
tuple[
Literal["#NULL!"],
Literal["#DIV/0!"],
Literal["#VALUE!"],
Literal["#REF!"],
Literal["#NAME?"],
Literal["#NUM!"],
Literal["#N/A"],
]
]
TYPE_STRING: Final = "s"
TYPE_FORMULA: Final = "f"
TYPE_NUMERIC: Final = "n"
Expand All @@ -29,7 +39,11 @@ TYPE_INLINE: Final = "inlineStr"
TYPE_ERROR: Final = "e"
TYPE_FORMULA_CACHE_STRING: Final = "str"

VALID_TYPES = (TYPE_STRING, TYPE_FORMULA, TYPE_NUMERIC, TYPE_BOOL, TYPE_NULL, TYPE_INLINE, TYPE_ERROR, TYPE_FORMULA_CACHE_STRING)
VALID_TYPES: Final[
tuple[
Literal["s"], Literal["f"], Literal["n"], Literal["b"], Literal["n"], Literal["inlineStr"], Literal["e"], Literal["str"]
]
]

def get_type(t, value) -> Literal["n", "s", "d", None]: ...
def get_time_format(t) -> str: ...
Expand Down
4 changes: 2 additions & 2 deletions stubs/openpyxl/openpyxl/reader/excel.pyi
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
from _typeshed import Incomplete, StrPath
from typing import IO
from typing_extensions import Final
from typing_extensions import Final, Literal
from zipfile import ZipFile

from openpyxl.packaging.relationship import Relationship
from openpyxl.packaging.workbook import ChildSheet
from openpyxl.workbook.workbook import Workbook

SUPPORTED_FORMATS: Final = (".xlsx", ".xlsm", ".xltx", ".xltm")
SUPPORTED_FORMATS: Final[tuple[Literal[".xlsx"], Literal[".xlsm"], Literal[".xltx"], Literal[".xltm"]]]

class ExcelReader:
archive: ZipFile
Expand Down
15 changes: 13 additions & 2 deletions stubs/openpyxl/openpyxl/styles/alignment.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,22 @@ from openpyxl.descriptors.serialisable import Serialisable

_Unused: TypeAlias = object

horizontal_alignments: Final = ("general", "left", "center", "right", "fill", "justify", "centerContinuous", "distributed")
horizontal_alignments: Final[
tuple[
Literal["general"],
Literal["left"],
Literal["center"],
Literal["right"],
Literal["fill"],
Literal["justify"],
Literal["centerContinuous"],
Literal["distributed"],
]
]
_HorizontalAlignementsType: TypeAlias = Literal[
"general", "left", "center", "right", "fill", "justify", "centerContinuous", "distributed"
]
vertical_aligments: Final = ("top", "center", "bottom", "justify", "distributed")
vertical_aligments: Final[tuple[Literal["top"], Literal["center"], Literal["bottom"], Literal["justify"], Literal["distributed"]]]
_VerticalAlignementsType: TypeAlias = Literal["top", "center", "bottom", "justify", "distributed"]

class Alignment(Serialisable):
Expand Down
42 changes: 22 additions & 20 deletions stubs/openpyxl/openpyxl/styles/fills.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -32,26 +32,28 @@ FILL_PATTERN_LIGHTUP: Final = "lightUp"
FILL_PATTERN_LIGHTVERTICAL: Final = "lightVertical"
FILL_PATTERN_MEDIUMGRAY: Final = "mediumGray"

fills: Final = (
FILL_SOLID,
FILL_PATTERN_DARKDOWN,
FILL_PATTERN_DARKGRAY,
FILL_PATTERN_DARKGRID,
FILL_PATTERN_DARKHORIZONTAL,
FILL_PATTERN_DARKTRELLIS,
FILL_PATTERN_DARKUP,
FILL_PATTERN_DARKVERTICAL,
FILL_PATTERN_GRAY0625,
FILL_PATTERN_GRAY125,
FILL_PATTERN_LIGHTDOWN,
FILL_PATTERN_LIGHTGRAY,
FILL_PATTERN_LIGHTGRID,
FILL_PATTERN_LIGHTHORIZONTAL,
FILL_PATTERN_LIGHTTRELLIS,
FILL_PATTERN_LIGHTUP,
FILL_PATTERN_LIGHTVERTICAL,
FILL_PATTERN_MEDIUMGRAY,
)
fills: Final[
tuple[
Literal["solid"],
Literal["darkDown"],
Literal["darkGray"],
Literal["darkGrid"],
Literal["darkHorizontal"],
Literal["darkTrellis"],
Literal["darkUp"],
Literal["darkVertical"],
Literal["gray0625"],
Literal["gray125"],
Literal["lightDown"],
Literal["lightGray"],
Literal["lightGrid"],
Literal["lightHorizontal"],
Literal["lightTrellis"],
Literal["lightUp"],
Literal["lightVertical"],
Literal["mediumGray"],
]
]
_FillsType: TypeAlias = Literal[
"none",
"solid",
Expand Down
Loading
0