Skip to content
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

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

Draft
wants to merge 98 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 23 commits
Commits
Show all changes
98 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
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
263 changes: 261 additions & 2 deletions stubs/openpyxl/@tests/stubtest_allowlist.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,264 @@
# "cls" argument has wrong name in implementation.
openpyxl.descriptors.slots.AutoSlotProperties.__new__
# The actual runtime definition depends on what else is installed
# (lxml, defusedxml, et_xmlfile, numpy, ...)
openpyxl.xml._functions
openpyxl.xml.functions.Element.__iter__
openpyxl.xml.functions.tostring
openpyxl.xml.functions.xmlfile

# Requires numpy to be installed
openpyxl.utils.dataframe

# Inconsistent __init__ because
# - using the default value results in an error because of the runtime type-guards
# - or, keyword arguments are explicitly specified
openpyxl.cell.text.PhoneticProperties.__init__
openpyxl.cell.text.PhoneticText.__init__
openpyxl.chart.axis._BaseAxis.__init__
openpyxl.chart.axis.DateAxis.__init__
openpyxl.chart.axis.NumericAxis.__init__
openpyxl.chart.axis.SeriesAxis.__init__
openpyxl.chart.axis.TextAxis.__init__
openpyxl.styles.colors.RgbColor.__init__
openpyxl.styles.named_styles._NamedCellStyle.__init__
openpyxl.styles.numbers.NumberFormat.__init__
openpyxl.workbook.defined_name.DefinedName.__init__

# Leaked into the global space
openpyxl.utils.cell.col
openpyxl.utils.cell.i

# Unintended re-exports
Avasam marked this conversation as resolved.
Show resolved Hide resolved
openpyxl.chart.marker.DRAWING_NS
openpyxl.chart.marker.PRESET_COLORS
openpyxl.chart.shapes.DRAWING_NS
openpyxl.chart.shapes.PRESET_COLORS
openpyxl.drawing.text.PRESET_COLORS

# 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
openpyxl.cell.text.InlineFont.color
Avasam marked this conversation as resolved.
Show resolved Hide resolved
openpyxl.cell.text.InlineFont.rFont
openpyxl.cell.text.InlineFont.scheme
openpyxl.cell.text.InlineFont.u
openpyxl.cell.text.InlineFont.vertAlign
openpyxl.cell.text.PhoneticProperties.alignment
openpyxl.cell.text.PhoneticProperties.type
openpyxl.cell.text.PhoneticText.t
openpyxl.cell.text.PhoneticText.text
openpyxl.cell.text.RichText.font
openpyxl.cell.text.RichText.rPr
openpyxl.cell.text.RichText.t
openpyxl.cell.text.RichText.text
openpyxl.cell.text.Text.formatted
openpyxl.cell.text.Text.phonetic
openpyxl.cell.text.Text.phoneticPr
openpyxl.cell.text.Text.PhoneticProperties
openpyxl.cell.text.Text.plain
openpyxl.cell.text.Text.r
openpyxl.cell.text.Text.rPh
openpyxl.cell.text.Text.t
openpyxl.chart.axis._BaseAxis.axPos
openpyxl.chart.axis._BaseAxis.crosses
openpyxl.chart.axis._BaseAxis.graphicalProperties
openpyxl.chart.axis._BaseAxis.majorGridlines
openpyxl.chart.axis._BaseAxis.majorTickMark
openpyxl.chart.axis._BaseAxis.minorGridlines
openpyxl.chart.axis._BaseAxis.minorTickMark
openpyxl.chart.axis._BaseAxis.number_format
openpyxl.chart.axis._BaseAxis.numFmt
openpyxl.chart.axis._BaseAxis.scaling
openpyxl.chart.axis._BaseAxis.spPr
openpyxl.chart.axis._BaseAxis.textProperties
openpyxl.chart.axis._BaseAxis.tickLblPos
openpyxl.chart.axis._BaseAxis.title
openpyxl.chart.axis._BaseAxis.txPr
openpyxl.chart.axis.ChartLines.graphicalProperties
openpyxl.chart.axis.ChartLines.spPr
openpyxl.chart.axis.DateAxis.axPos
openpyxl.chart.axis.DateAxis.baseTimeUnit
openpyxl.chart.axis.DateAxis.crosses
openpyxl.chart.axis.DateAxis.extLst
openpyxl.chart.axis.DateAxis.majorGridlines
openpyxl.chart.axis.DateAxis.majorTickMark
openpyxl.chart.axis.DateAxis.majorTimeUnit
openpyxl.chart.axis.DateAxis.minorGridlines
openpyxl.chart.axis.DateAxis.minorTickMark
openpyxl.chart.axis.DateAxis.minorTimeUnit
openpyxl.chart.axis.DateAxis.numFmt
openpyxl.chart.axis.DateAxis.scaling
openpyxl.chart.axis.DateAxis.spPr
openpyxl.chart.axis.DateAxis.tickLblPos
openpyxl.chart.axis.DateAxis.title
openpyxl.chart.axis.DateAxis.txPr
openpyxl.chart.axis.DisplayUnitsLabel.graphicalProperties
openpyxl.chart.axis.DisplayUnitsLabel.layout
openpyxl.chart.axis.DisplayUnitsLabel.spPr
openpyxl.chart.axis.DisplayUnitsLabel.text
openpyxl.chart.axis.DisplayUnitsLabel.textPropertes
openpyxl.chart.axis.DisplayUnitsLabel.tx
openpyxl.chart.axis.DisplayUnitsLabel.txPr
openpyxl.chart.axis.DisplayUnitsLabelList.builtInUnit
openpyxl.chart.axis.DisplayUnitsLabelList.dispUnitsLbl
openpyxl.chart.axis.DisplayUnitsLabelList.extLst
openpyxl.chart.axis.NumericAxis.axPos
openpyxl.chart.axis.NumericAxis.crossBetween
openpyxl.chart.axis.NumericAxis.crosses
openpyxl.chart.axis.NumericAxis.dispUnits
openpyxl.chart.axis.NumericAxis.extLst
openpyxl.chart.axis.NumericAxis.majorGridlines
openpyxl.chart.axis.NumericAxis.majorTickMark
openpyxl.chart.axis.NumericAxis.minorGridlines
openpyxl.chart.axis.NumericAxis.minorTickMark
openpyxl.chart.axis.NumericAxis.numFmt
openpyxl.chart.axis.NumericAxis.scaling
openpyxl.chart.axis.NumericAxis.spPr
openpyxl.chart.axis.NumericAxis.tickLblPos
openpyxl.chart.axis.NumericAxis.title
openpyxl.chart.axis.NumericAxis.txPr
openpyxl.chart.axis.Scaling.extLst
openpyxl.chart.axis.Scaling.orientation
openpyxl.chart.axis.SeriesAxis.axPos
openpyxl.chart.axis.SeriesAxis.crosses
openpyxl.chart.axis.SeriesAxis.extLst
openpyxl.chart.axis.SeriesAxis.majorGridlines
openpyxl.chart.axis.SeriesAxis.majorTickMark
openpyxl.chart.axis.SeriesAxis.minorGridlines
openpyxl.chart.axis.SeriesAxis.minorTickMark
openpyxl.chart.axis.SeriesAxis.numFmt
openpyxl.chart.axis.SeriesAxis.scaling
openpyxl.chart.axis.SeriesAxis.spPr
openpyxl.chart.axis.SeriesAxis.tickLblPos
openpyxl.chart.axis.SeriesAxis.title
openpyxl.chart.axis.SeriesAxis.txPr
openpyxl.chart.axis.TextAxis.axPos
openpyxl.chart.axis.TextAxis.crosses
openpyxl.chart.axis.TextAxis.extLst
openpyxl.chart.axis.TextAxis.lblAlgn
openpyxl.chart.axis.TextAxis.majorGridlines
openpyxl.chart.axis.TextAxis.majorTickMark
openpyxl.chart.axis.TextAxis.minorGridlines
openpyxl.chart.axis.TextAxis.minorTickMark
openpyxl.chart.axis.TextAxis.numFmt
openpyxl.chart.axis.TextAxis.scaling
openpyxl.chart.axis.TextAxis.spPr
openpyxl.chart.axis.TextAxis.tickLblPos
openpyxl.chart.axis.TextAxis.title
openpyxl.chart.axis.TextAxis.txPr
openpyxl.chartsheet.chartsheet.Chartsheet.sheet_state
openpyxl.chartsheet.Chartsheet.sheet_state
openpyxl.chartsheet.custom.CustomChartsheetView.state
openpyxl.packaging.workbook.ChildSheet.state
openpyxl.styles.alignment.Alignment.horizontal
openpyxl.styles.alignment.Alignment.shrink_to_fit
openpyxl.styles.alignment.Alignment.text_rotation
openpyxl.styles.alignment.Alignment.textRotation
openpyxl.styles.alignment.Alignment.vertical
openpyxl.styles.alignment.Alignment.wrap_text
openpyxl.styles.Alignment.horizontal
openpyxl.styles.Alignment.shrink_to_fit
openpyxl.styles.Alignment.text_rotation
openpyxl.styles.Alignment.textRotation
openpyxl.styles.Alignment.vertical
openpyxl.styles.Alignment.wrap_text
openpyxl.styles.Border.bottom
openpyxl.styles.Border.diagonal
openpyxl.styles.Border.end
openpyxl.styles.Border.horizontal
openpyxl.styles.Border.left
openpyxl.styles.Border.right
openpyxl.styles.Border.start
openpyxl.styles.Border.top
openpyxl.styles.Border.vertical
openpyxl.styles.borders.Border.bottom
openpyxl.styles.borders.Border.diagonal
openpyxl.styles.borders.Border.end
openpyxl.styles.borders.Border.horizontal
openpyxl.styles.borders.Border.left
openpyxl.styles.borders.Border.right
openpyxl.styles.borders.Border.start
openpyxl.styles.borders.Border.top
openpyxl.styles.borders.Border.vertical
openpyxl.styles.borders.Side.border_style
openpyxl.styles.borders.Side.color
openpyxl.styles.borders.Side.style
openpyxl.styles.Color.rgb
openpyxl.styles.Color.type
openpyxl.styles.colors.Color.rgb
openpyxl.styles.colors.Color.type
openpyxl.styles.colors.ColorDescriptor.expected_type
openpyxl.styles.colors.ColorList.indexedColors
openpyxl.styles.colors.ColorList.mruColors
openpyxl.styles.colors.RgbColor.rgb
openpyxl.styles.differential.DifferentialStyle.alignment
openpyxl.styles.differential.DifferentialStyle.border
openpyxl.styles.differential.DifferentialStyle.fill
openpyxl.styles.differential.DifferentialStyle.font
openpyxl.styles.differential.DifferentialStyle.numFmt
openpyxl.styles.differential.DifferentialStyle.protection
openpyxl.styles.differential.DifferentialStyleList.dxf
openpyxl.styles.fills.GradientFill.fill_type
openpyxl.styles.fills.GradientFill.stop
openpyxl.styles.fills.GradientFill.type
openpyxl.styles.fills.PatternFill.bgColor
openpyxl.styles.fills.PatternFill.end_color
openpyxl.styles.fills.PatternFill.fgColor
openpyxl.styles.fills.PatternFill.fill_type
openpyxl.styles.fills.PatternFill.patternType
openpyxl.styles.fills.PatternFill.start_color
openpyxl.styles.fills.Stop.color
openpyxl.styles.fills.StopList.expected_type
openpyxl.styles.Font.bold
openpyxl.styles.Font.color
openpyxl.styles.Font.italic
openpyxl.styles.Font.name
openpyxl.styles.Font.scheme
openpyxl.styles.Font.size
openpyxl.styles.Font.strikethrough
openpyxl.styles.Font.u
openpyxl.styles.Font.underline
openpyxl.styles.Font.vertAlign
openpyxl.styles.fonts.Font.bold
openpyxl.styles.fonts.Font.color
openpyxl.styles.fonts.Font.italic
openpyxl.styles.fonts.Font.name
openpyxl.styles.fonts.Font.scheme
openpyxl.styles.fonts.Font.size
openpyxl.styles.fonts.Font.strikethrough
openpyxl.styles.fonts.Font.u
openpyxl.styles.fonts.Font.underline
openpyxl.styles.fonts.Font.vertAlign
openpyxl.styles.GradientFill.fill_type
openpyxl.styles.GradientFill.stop
openpyxl.styles.GradientFill.type
openpyxl.styles.named_styles._NamedCellStyle.extLst
openpyxl.styles.named_styles._NamedCellStyle.name
openpyxl.styles.named_styles._NamedCellStyleList.cellStyle
openpyxl.styles.named_styles.NamedStyle.alignment
openpyxl.styles.named_styles.NamedStyle.border
openpyxl.styles.named_styles.NamedStyle.fill
openpyxl.styles.named_styles.NamedStyle.font
openpyxl.styles.named_styles.NamedStyle.name
openpyxl.styles.named_styles.NamedStyle.number_format
openpyxl.styles.named_styles.NamedStyle.protection
openpyxl.styles.NamedStyle.alignment
openpyxl.styles.NamedStyle.border
openpyxl.styles.NamedStyle.fill
openpyxl.styles.NamedStyle.font
openpyxl.styles.NamedStyle.name
openpyxl.styles.NamedStyle.number_format
openpyxl.styles.NamedStyle.protection
openpyxl.styles.numbers.NumberFormat.formatCode
openpyxl.styles.numbers.NumberFormatList.numFmt
openpyxl.styles.PatternFill.bgColor
openpyxl.styles.PatternFill.end_color
openpyxl.styles.PatternFill.fgColor
openpyxl.styles.PatternFill.fill_type
openpyxl.styles.PatternFill.patternType
openpyxl.styles.PatternFill.start_color
openpyxl.styles.Side.border_style
openpyxl.styles.Side.color
openpyxl.styles.Side.style
openpyxl.workbook.views.BookView.visibility
3 changes: 0 additions & 3 deletions stubs/openpyxl/METADATA.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1 @@
version = "3.1.*"

[tool.stubtest]
ignore_missing_stub = true
6 changes: 6 additions & 0 deletions stubs/openpyxl/openpyxl/__init__.pyi
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from typing import Protocol

from openpyxl.compat.numbers import NUMPY as NUMPY
from openpyxl.reader.excel import load_workbook as load_workbook
from openpyxl.workbook import Workbook as Workbook
Expand All @@ -13,3 +15,7 @@ from ._constants import (
)

open = load_workbook

# Utility type reused elsewhere
class _Decodable(Protocol): # noqa: Y046
def decode(self, __encoding: str) -> str: ...
75 changes: 41 additions & 34 deletions stubs/openpyxl/openpyxl/cell/cell.pyi
Original file line number Diff line number Diff line change
@@ -1,42 +1,49 @@
from _typeshed import Incomplete
from datetime import datetime
import datetime
from _typeshed import ReadableBuffer
from re import Pattern
from typing_extensions import Final, Literal, TypeAlias

from openpyxl.comments.comments import Comment
from openpyxl.compat.numbers import NUMERIC_TYPES as NUMERIC_TYPES, _NumericTypes
from openpyxl.styles.cell_style import StyleArray
from openpyxl.styles.styleable import StyleableObject
from openpyxl.workbook.child import _WorkbookChild
from openpyxl.worksheet.hyperlink import Hyperlink
from openpyxl.worksheet.worksheet import Worksheet

__docformat__: str
TIME_TYPES: Incomplete
TIME_FORMATS: Incomplete
STRING_TYPES: Incomplete
KNOWN_TYPES: Incomplete
ILLEGAL_CHARACTERS_RE: Incomplete
ERROR_CODES: Incomplete
TYPE_STRING: str
TYPE_FORMULA: str
TYPE_NUMERIC: str
TYPE_BOOL: str
TYPE_NULL: str
TYPE_INLINE: str
TYPE_ERROR: str
TYPE_FORMULA_CACHE_STRING: str
VALID_TYPES: Incomplete
_TimeTypes: TypeAlias = datetime.datetime | datetime.date | datetime.time | datetime.timedelta
TIME_TYPES: tuple[type[_TimeTypes], ...]
TIME_FORMATS: dict[type[_TimeTypes], str]
STRING_TYPES: tuple[type[str], type[bytes]]
_StringTypes: TypeAlias = str | bytes
_KnownTypes: TypeAlias = _NumericTypes | _TimeTypes | _StringTypes | bool | None
KNOWN_TYPES: tuple[type[_KnownTypes], ...]
ILLEGAL_CHARACTERS_RE: Pattern[str]
ERROR_CODES: Final[tuple[str, ...]]
TYPE_STRING: Final = "s"
TYPE_FORMULA: Final = "f"
TYPE_NUMERIC: Final = "n"
TYPE_BOOL: Final = "b"
TYPE_NULL: Final = "n"
TYPE_INLINE: Final = "inlineStr"
TYPE_ERROR: Final = "e"
TYPE_FORMULA_CACHE_STRING: Final = "str"

def get_type(t: type, value: object) -> str | None: ...
def get_time_format(t: datetime) -> str: ...
VALID_TYPES: Final[tuple[str, ...]]

def get_type(t: type, value: _KnownTypes) -> Literal["n", "s", "d", None]: ...
def get_time_format(t: _TimeTypes) -> str: ...

class Cell(StyleableObject):
row: int
column: int
row: int | None
column: int | None
data_type: str
def __init__(
self,
worksheet: Worksheet,
worksheet: _WorkbookChild,
row: int | None = ...,
column: int | None = ...,
value: str | float | datetime | None = ...,
value: _KnownTypes = ...,
style_array: StyleArray | None = ...,
) -> None: ...
@property
Expand All @@ -48,15 +55,15 @@ class Cell(StyleableObject):
@property
def encoding(self) -> str: ...
@property
def base_date(self) -> datetime: ...
def check_string(self, value: str): ...
def base_date(self) -> datetime.datetime: ...
def check_string(self, value: ReadableBuffer): ...
def check_error(self, value: object) -> str: ...
@property
def value(self) -> str | float | datetime | None: ...
def value(self) -> _KnownTypes: ...
@value.setter
def value(self, value: str | float | datetime | None) -> None: ...
def value(self, value: _KnownTypes) -> None: ...
@property
def internal_value(self) -> str | float | datetime | None: ...
def internal_value(self) -> _KnownTypes: ...
@property
def hyperlink(self) -> Hyperlink | None: ...
@hyperlink.setter
Expand All @@ -73,11 +80,11 @@ class MergedCell(StyleableObject):
data_type: str
comment: Comment | None
hyperlink: Hyperlink | None
row: int
column: int
def __init__(self, worksheet: Worksheet, row: int | None = ..., column: int | None = ...) -> None: ...
row: int | None
column: int | None
def __init__(self, worksheet: _WorkbookChild, row: int | None = ..., column: int | None = ...) -> None: ...
@property
def coordinate(self) -> str: ...
value: str | float | int | datetime | None
value: _KnownTypes

def WriteOnlyCell(ws: Worksheet | None = ..., value: str | float | datetime | None = ...) -> Cell: ...
def WriteOnlyCell(ws: _WorkbookChild | None = ..., value: _KnownTypes = ...) -> Cell: ...
Loading