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 6 commits
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 < 8000 relative-time datetime="2024-11-25T05:02:17Z" class="no-wrap">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
17 changes: 9 additions & 8 deletions stubs/openpyxl/openpyxl/cell/cell.pyi
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import datetime
from datetime import date, datetime, time, timedelta
from decimal import Decimal
from re import Pattern
from typing import overload
Expand All @@ -13,17 +13,18 @@ from openpyxl.workbook.child import _WorkbookChild
from openpyxl.worksheet.formula import ArrayFormula, DataTableFormula
from openpyxl.worksheet.hyperlink import Hyperlink

_TimeTypes: TypeAlias = datetime.datetime | datetime.date | datetime.time | datetime.timedelta
_TimeTypes: TypeAlias = datetime | date | time | timedelta
_CellValue: TypeAlias = ( # if numpy is installed also numpy bool and number types
bool | float | Decimal | str | CellRichText | _TimeTypes | DataTableFormula | ArrayFormula
)

TIME_TYPES: tuple[type, ...]
TIME_FORMATS: dict[type[_TimeTypes], str]
STRING_TYPES: tuple[type, ...]
KNOWN_TYPES: tuple[type, ...]
__docformat__: Final = "restructuredtext en"
TIME_TYPES: Final[tuple[type, ...]]
TIME_FORMATS: Final[dict[type[_TimeTypes], str]]
STRING_TYPES: Final[tuple[type, ...]]
KNOWN_TYPES: Final[tuple[type, ...]]

ILLEGAL_CHARACTERS_RE: Pattern[str]
ILLEGAL_CHARACTERS_RE: Final[Pattern[str]]
ERROR_CODES: Final[tuple[str, ...]]

TYPE_STRING: Final = "s"
Expand Down Expand Up @@ -61,7 +62,7 @@ class Cell(StyleableObject):
@property
def encoding(self) -> str: ...
@property
def base_date(self) -> datetime.datetime: ...
def base_date(self) -> datetime: ...
@overload
def check_string(self, value: None) -> None: ...
@overload
Expand Down
4 changes: 2 additions & 2 deletions stubs/openpyxl/openpyxl/cell/text.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ from openpyxl.descriptors.base import Alias, Integer, NoneSet, Typed, _Convertib
from openpyxl.descriptors.nested import NestedString, NestedText
from openpyxl.descriptors.serialisable import Serialisable
from openpyxl.styles.colors import Color
from openpyxl.styles.fonts import Font, _UnderlineType
from openpyxl.styles.fonts import Font, _FontU

_PhoneticPropertiesType: TypeAlias = Literal["halfwidthKatakana", "fullwidthKatakana", "Hiragana", "noConversion"]
_PhoneticPropertiesAlignment: TypeAlias = Literal["noControl", "left", "center", "distributed"]
Expand Down Expand Up @@ -64,7 +64,7 @@ class InlineFont(Font):
extend: bool | None = None,
color: Color | None = None,
sz: float | None = None,
u: _UnderlineType = None,
u: _FontU | None = None,
vertAlign: Literal["superscript", "subscript", "baseline", None] = None,
scheme: Literal["major", "minor", None] = None,
) -> None: ...
Expand Down
6 changes: 3 additions & 3 deletions stubs/openpyxl/openpyxl/compat/numbers.pyi
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from decimal import Decimal
from typing_extensions import TypeAlias
from typing_extensions import Final, TypeAlias

# NOTE: Can't specify numpy as a dependency because openpyxl doesn't declare it as one
# import numpy
Expand All @@ -12,6 +12,6 @@ from typing_extensions import TypeAlias
# _NumericTypes: TypeAlias = int | float | Decimal | numpy.bool_ | numpy.floating[_NBitBase] | numpy.integer[_NBitBase]

_NumericTypes: TypeAlias = int | float | Decimal
NUMERIC_TYPES: tuple[type[_NumericTypes], ...]
NUMERIC_TYPES: Final[tuple[type[_NumericTypes], ...]]

NUMPY: bool
NUMPY: Final[bool]
1 change: 0 additions & 1 deletion stubs/openpyxl/openpyxl/descriptors/base.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ class Typed(Descriptor[_T], Generic[_T, _N]):
expected_type: type[_T]
allow_none: _N
nested: bool
__doc__: str

@overload
def __init__(
Expand Down
5 changes: 3 additions & 2 deletions stubs/openpyxl/openpyxl/reader/excel.pyi
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from _typeshed import Incomplete, StrPath
from typing import IO
from typing_extensions import Final
from typing_extensions import Final, Literal, TypeAlias
from zipfile import ZipFile

from openpyxl.chartsheet.chartsheet import Chartsheet
Expand All @@ -9,7 +9,8 @@ from openpyxl.packaging.relationship import Relationship
from openpyxl.reader.workbook import WorkbookParser
from openpyxl.workbook import Workbook

SUPPORTED_FORMATS: Final[tuple[str, ...]]
_SupportedFormats: TypeAlias = Literal[".xlsx", ".xlsm", ".xltx", ".xltm"]
SUPPORTED_FORMATS: Final[tuple[_SupportedFormats, ...]]

class ExcelReader:
archive: ZipFile
Expand Down
2 changes: 1 addition & 1 deletion stubs/openpyxl/openpyxl/styles/alignment.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ horizontal_alignments: Final[tuple[_HorizontalAlignmentsType, ...]]
vertical_aligments: Final[tuple[_VerticalAlignmentsType, ...]]

class Alignment(Serialisable):
tagname: str
tagname: ClassVar[str]
__fields__: ClassVar[tuple[str, ...]]
horizontal: NoneSet[_HorizontalAlignmentsType]
vertical: NoneSet[_VerticalAlignmentsType]
Expand Down
34 changes: 17 additions & 17 deletions stubs/openpyxl/openpyxl/styles/borders.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,6 @@ from typing_extensions import Final, Literal, TypeAlias
from openpyxl.descriptors.base import Alias, Bool, NoneSet, Typed, _ConvertibleToBool
from openpyxl.descriptors.serialisable import Serialisable

BORDER_NONE: None
BORDER_DASHDOT: Final = "dashDot"
BORDER_DASHDOTDOT: Final = "dashDotDot"
BORDER_DASHED: Final = "dashed"
BORDER_DOTTED: Final = "dotted"
BORDER_DOUBLE: Final = "double"
BORDER_HAIR: Final = "hair"
BORDER_MEDIUM: Final = "medium"
BORDER_MEDIUMDASHDOT: Final = "mediumDashDot"
BORDER_MEDIUMDASHDOTDOT: Final = "mediumDashDotDot"
BORDER_MEDIUMDASHED: Final = "mediumDashed"
BORDER_SLANTDASHDOT: Final = "slantDashDot"
BORDER_THICK: Final = "thick"
BORDER_THIN: Final = "thin"

_SideStyle: TypeAlias = Literal[
"dashDot",
"dashDotDot",
Expand All @@ -37,6 +22,21 @@ _SideStyle: TypeAlias = Literal[
"thin",
]

BORDER_NONE: Final = None
BORDER_DASHDOT: Final = "dashDot"
BORDER_DASHDOTDOT: Final = "dashDotDot"
BORDER_DASHED: Final = "dashed"
BORDER_DOTTED: Final = "dotted"
BORDER_DOUBLE: Final = "double"
BORDER_HAIR: Final = "hair"
BORDER_MEDIUM: Final = "medium"
BORDER_MEDIUMDASHDOT: Final = "mediumDashDot"
BORDER_MEDIUMDASHDOTDOT: Final = "mediumDashDotDot"
BORDER_MEDIUMDASHED: Final = "mediumDashed"
BORDER_SLANTDASHDOT: Final = "slantDashDot"
BORDER_THICK: Final = "thick"
BORDER_THIN: Final = "thin"

class Side(Serialisable):
__fields__: ClassVar[tuple[str, ...]]
color: Incomplete
Expand All @@ -50,7 +50,7 @@ class Side(Serialisable):
) -> None: ...

class Border(Serialisable):
tagname: str
tagname: ClassVar[str]
__fields__: ClassVar[tuple[str, ...]]
__elements__: ClassVar[tuple[str, ...]]
start: Typed[Side, Literal[True]]
Expand Down Expand Up @@ -84,4 +84,4 @@ class Border(Serialisable):
) -> None: ...
def __iter__(self) -> Generator[tuple[str, str], None, None]: ...

DEFAULT_BORDER: Border
DEFAULT_BORDER: Final[Border]
14 changes: 7 additions & 7 deletions stubs/openpyxl/openpyxl/styles/colors.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,19 @@ from _typeshed import Incomplete, Unused
from collections.abc import Generator
from re import Pattern
from typing import ClassVar, TypeVar, overload
from typing_extensions import Literal, Self
from typing_extensions import Final, Literal, Self

from openpyxl.descriptors import Strict, Typed
from openpyxl.descriptors.base import Bool, Integer, MinMax, String, _ConvertibleToBool, _ConvertibleToFloat, _ConvertibleToInt
from openpyxl.descriptors.serialisable import Serialisable

_S = TypeVar("_S", bound=Serialisable)

COLOR_INDEX: tuple[str, ...]
BLACK: str
WHITE: str
BLUE: str
aRGB_REGEX: Pattern[str]
COLOR_INDEX: Final[tuple[str, ...]]
BLACK: Final = "00000000"
WHITE: Final = "00FFFFFF"
BLUE: Final = "00FFFFFF"
aRGB_REGEX: Final[Pattern[str]]

class RGB(Typed[str, Incomplete]):
expected_type: type[str]
Expand Down Expand Up @@ -55,7 +55,7 @@ class ColorDescriptor(Typed[Color, Incomplete]):
def __set__(self, instance: Serialisable | Strict, value) -> None: ...

class RgbColor(Serialisable):
tagname: str
tagname: ClassVar[str]
rgb: RGB
def __init__(self, rgb: str) -> None: ...

Expand Down
4 changes: 2 additions & 2 deletions stubs/openpyxl/openpyxl/styles/fills.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,8 @@ class PatternFill(Fill):
) -> None: ...
def to_tree(self, tagname: Unused = None, idx: Unused = None): ... # type: ignore[override]

DEFAULT_EMPTY_FILL: PatternFill
DEFAULT_GRAY_FILL: PatternFill
DEFAULT_EMPTY_FILL: Final[PatternFill]
DEFAULT_GRAY_FILL: Final[PatternFill]

class Stop(Serialisable):
tagname: ClassVar[str]
Expand Down
2 changes: 1 addition & 1 deletion stubs/openpyxl/openpyxl/styles/fonts.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -75,4 +75,4 @@ class Font(Serialisable):
@classmethod
def from_tree(cls, node: _Element) -> Self: ...

DEFAULT_FONT: Font
DEFAULT_FONT: Final[Font]
87 changes: 44 additions & 43 deletions stubs/openpyxl/openpyxl/styles/numbers.pyi
Original file line number Diff line number Diff line change
@@ -1,54 +1,55 @@
from _typeshed import Incomplete, Unused
from re import Pattern
from typing import ClassVar, overload
from typing_extensions import Literal, TypeGuard
from typing_extensions import Final, Literal, TypeGuard

from openpyxl.descriptors import Strict, String
from openpyxl.descriptors.base import Integer, _ConvertibleToInt
from openpyxl.descriptors.serialisable import Serialisable

BUILTIN_FORMATS: dict[int, str]
BUILTIN_FORMATS_MAX_SIZE: int
BUILTIN_FORMATS_REVERSE: dict[str, int]
FORMAT_GENERAL: str
FORMAT_TEXT: str
FORMAT_NUMBER: str
FORMAT_NUMBER_00: str
FORMAT_NUMBER_COMMA_SEPARATED1: str
FORMAT_NUMBER_COMMA_SEPARATED2: str
FORMAT_PERCENTAGE: str
FORMAT_PERCENTAGE_00: str
FORMAT_DATE_YYYYMMDD2: str
FORMAT_DATE_YYMMDD: str
FORMAT_DATE_DDMMYY: str
FORMAT_DATE_DMYSLASH: str
FORMAT_DATE_DMYMINUS: str
FORMAT_DATE_DMMINUS: str
FORMAT_DATE_MYMINUS: str
FORMAT_DATE_XLSX14: str
FORMAT_DATE_XLSX15: str
FORMAT_DATE_XLSX16: str
FORMAT_DATE_XLSX17: str
FORMAT_DATE_XLSX22: str
FORMAT_DATE_DATETIME: str
FORMAT_DATE_TIME1: str
FORMAT_DATE_TIME2: str
FORMAT_DATE_TIME3: str
FORMAT_DATE_TIME4: str
FORMAT_DATE_TIME5: str
FORMAT_DATE_TIME6: str
FORMAT_DATE_TIME7: str
FORMAT_DATE_TIME8: str
FORMAT_DATE_TIMEDELTA: str
FORMAT_DATE_YYMMDDSLASH: str
FORMAT_CURRENCY_USD_SIMPLE: str
FORMAT_CURRENCY_USD: str
FORMAT_CURRENCY_EUR_SIMPLE: str
COLORS: str
LITERAL_GROUP: str
LOCALE_GROUP: str
STRIP_RE: Pattern[str]
TIMEDELTA_RE: Pattern[str]
BUILTIN_FORMATS: Final[dict[int, str]]
BUILTIN_FORMATS_MAX_SIZE: Final = 164
BUILTIN_FORMATS_REVERSE: Final[dict[str, int]]
FORMAT_GENERAL: Final = "General"
FORMAT_TEXT: Final = "@"
FORMAT_NUMBER: Final = "0"
FORMAT_NUMBER_00: Final = "0.00"
FORMAT_NUMBER_COMMA_SEPARATED1: Final = "#,##0.00"
FORMAT_NUMBER_COMMA_SEPARATED2: Final = "#,##0.00_-"
FORMAT_PERCENTAGE: Final = "0%"
FORMAT_PERCENTAGE_00: Final = "0.00%"
FORMAT_DATE_YYYYMMDD2: Final = "yyyy-mm-dd"
FORMAT_DATE_YYMMDD: Final = "yy-mm-dd"
FORMAT_DATE_DDMMYY: Final = "dd/mm/yy"
FORMAT_DATE_DMYSLASH: Final = "d/m/y"
FORMAT_DATE_DMYMINUS: Final = "d-m-y"
FORMAT_DATE_DMMINUS: Final = "d-m"
FORMAT_DATE_MYMINUS: Final = "m-y"
FORMAT_DATE_XLSX14: Final = "mm-dd-yy"
FORMAT_DATE_XLSX15: Final = "d-mmm-yy"
FORMAT_DATE_XLSX16: Final = "d-mmm"
FORMAT_DATE_XLSX17: Final = "mmm-yy"
FORMAT_DATE_XLSX22: Final = "m/d/yy h:mm"
FORMAT_DATE_DATETIME: Final = "yyyy-mm-dd h:mm:ss"
FORMAT_DATE_TIME1: Final = "h:mm AM/PM"
FORMAT_DATE_TIME2: Final = "h:mm:ss AM/PM"
FORMAT_DATE_TIME3: Final = "h:mm"
FORMAT_DATE_TIME4: Final = "h:mm:ss"
FORMAT_DATE_TIME5: Final = "mm:ss"
FORMAT_DATE_TIME6: Final = "h:mm:ss"
FORMAT_DATE_TIME7: Final = "i:s.S"
FORMAT_DATE_TIME8: Final = "h:mm:ss@"
FORMAT_DATE_TIMEDELTA: Final = "[hh]:mm:ss"
FORMAT_DATE_YYMMDDSLASH: Final = "yy/mm/dd@"
FORMAT_CURRENCY_USD_SIMPLE: Final = '"$"#,##0.00_-'
FORMAT_CURRENCY_USD: Final = "$#,##0_-"
FORMAT_CURRENCY_EUR_SIMPLE: Final = "[$EUR ]#,##0.00_-"

COLORS: Final[str]
LITERAL_GROUP: Final = r'".*?"'
LOCALE_GROUP: Final = r"\[(?!hh?\]|mm?\]|ss?\])[^\]]*\]"
STRIP_RE: Final[Pattern[str]]
TIMEDELTA_RE: Final[Pattern[str]]

def is_date_format(fmt: str | None) -> TypeGuard[str]: ...
def is_timedelta_format(fmt): ...
Expand Down
14 changes: 5 additions & 9 deletions stubs/openpyxl/openpyxl/styles/protection.pyi
Original file line number Diff line number Diff line change
@@ -1,14 +1,10 @@
from openpyxl.descriptors.base import _ConvertibleToBool
from typing_extensions import Literal

from openpyxl.descriptors.base import Bool, _ConvertibleToBool
from openpyxl.descriptors.serialisable import Serialisable

class Protection(Serialisable):
tagname: str
@property
def locked(self) -> bool: ...
@locked.setter
def locked(self, __value: _ConvertibleToBool) -> None: ...
@property
def hidden(self) -> bool: ...
@hidden.setter
def hidden(self, __value: _ConvertibleToBool) -> None: ...
locked: Bool[Literal[False]]
hidden: Bool[Literal[False]]
def __init__(self, locked: _ConvertibleToBool = True, hidden: _ConvertibleToBool = False) -> None: ...
15 changes: 8 additions & 7 deletions stubs/openpyxl/openpyxl/utils/cell.pyi
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
from collections.abc import Generator
from re import Pattern
from typing_extensions import Final

COORD_RE: Pattern[bytes]
COL_RANGE: str
ROW_RANGE: str
RANGE_EXPR: str
ABSOLUTE_RE: Pattern[bytes]
SHEET_TITLE: str
SHEETRANGE_RE: Pattern[bytes]
COORD_RE: Final[Pattern[str]]
COL_RANGE: Final = """[A-Z]{1,3}:[A-Z]{1,3}:"""
ROW_RANGE: Final = r"""\d+:\d+:"""
RANGE_EXPR: Final[str]
ABSOLUTE_RE: Final[Pattern[str]]
SHEET_TITLE: Final[str]
SHEETRANGE_RE: Final[Pattern[str]]

def get_column_interval(start: str | int, end: str | int) -> list[str]: ...
def coordinate_from_string(coord_string: str) -> tuple[str, int]: ...
Expand Down
3 changes: 2 additions & 1 deletion stubs/openpyxl/openpyxl/workbook/child.pyi
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
from collections.abc import Iterable
from re import Pattern
from typing_extensions import Final

from openpyxl import _Decodable
from openpyxl.workbook.workbook import Workbook
from openpyxl.worksheet.header_footer import HeaderFooter

INVALID_TITLE_REGEX: Pattern[str]
INVALID_TITLE_REGEX: Final[Pattern[str]]

def avoid_duplicate_name(names: Iterable[str], value: str) -> str: ...

Expand Down
2 changes: 1 addition & 1 deletion stubs/openpyxl/openpyxl/workbook/views.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ _CustomWorkbookViewShowComments: TypeAlias = Literal["commNone", "commIndicator"
_CustomWorkbookViewShowObjects: TypeAlias = Literal["all", "placeholders"]

class BookView(Serialisable):
tagname: str
tagname: ClassVar[str]
visibility: NoneSet[_VisibilityType]
minimized: Bool[Literal[True]]
showHorizontalScroll: Bool[Literal[True]]
Expand Down
4 changes: 3 additions & 1 deletion stubs/openpyxl/openpyxl/workbook/web.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,9 @@ class WebPublishObject(Serialisable):
) -> None: ...

class WebPublishObjectList(Serialisable):
tagname: str
tagname: ClassVar[str]
# Overwritten by property below
# count: Integer
webPublishObject: Incomplete
__elements__: ClassVar[tuple[str, ...]]
def __init__(self, count: Unused = None, webPublishObject=()) -> None: ...
Expand Down
Loading
0