summaryrefslogtreecommitdiff
path: root/build-aux/mypy-stubs/xlwt/__init__.pyi
blob: 551344948b2e9cb5d101ae1057747c780c93d9f6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
# build-aux/mypy-stubs/xlwt/__init__.pyi - Type stubs for xlwt
#
# Copyright (C) 2025  Luke T. Shumaker <lukeshu@lukeshu.com>
# SPDX-License-Identifier: AGPL-3.0-or-later

import datetime
import decimal
import typing

import xlwt.Cell

from .ExcelFormula import Formula as Formula
from .Formatting import Alignment as Alignment
from .Formatting import Borders as Borders
from .Formatting import Font as Font
from .Formatting import Pattern as Pattern
from .Formatting import Protection as Protection
from .Style import XFStyle as XFStyle
from .Style import add_palette_colour as add_palette_colour
from .Style import easyfont as easyfont
from .Style import easyxf as easyxf

__VERSION__: str

class Workbook:
    def __init__(self, encoding: str = "ascii", style_compression: int = 0) -> None: ...
    def add_sheet(
        self, sheetname: str, cell_overwrite_ok: bool = False
    ) -> Worksheet: ...
    def save(self, filename_or_stream: str | typing.BinaryIO) -> None: ...

type _RichText = list[str | tuple[str, Font]]
type _Date = datetime.datetime | datetime.date | datetime.time
type _Number = int | decimal.Decimal | float
type _Label = str | _Number | bytes | _Date | bool | None | Formula | _RichText

class Worksheet:
    def write(
        self,
        r: int,
        c: int,
        label: _Label = "",
        style: XFStyle = ...,
    ) -> None: ...
    def write_merge(
        self,
        r1: int,
        r2: int,
        c1: int,
        c2: int,
        label: _Label = "",
        style: XFStyle = ...,
    ) -> None: ...
    def col(self, indx: int) -> Column: ...
    def row(self, indx: int) -> Row: ...

class Column:
    width: int
    def set_width(self, width: int) -> None: ...
    def get_width(self) -> int: ...
    def set_style(self, style: XFStyle) -> None: ...
    def width_in_pixels(self) -> int: ...

class Row:
    height: int
    has_default_height: typing.Literal[0, 1]
    height_mismatch: typing.Literal[0, 1]
    level: typing.Literal[0, 1, 2, 3, 4, 5, 6, 7]
    collapse: typing.Literal[0, 1]
    hidden: typing.Literal[0, 1]
    space_above: typing.Literal[0, 1]
    space_below: typing.Literal[0, 1]

    def get_height_in_pixels(self) -> int: ...
    def set_style(self, style: XFStyle) -> None: ...
    def get_xf_index(self) -> int: ...
    def get_cells_count(self) -> int: ...
    def get_min_col(self) -> int: ...
    def get_max_col(self) -> int: ...
    def insert_cell(self, col_index: int, cell_obj: xlwt.Cell._Cell) -> None: ...
    def inert_mulcells(
        self, colx1: int, colx2: int, cell_obj: xlwt.Cell._Cell
    ) -> None: ...
    def get_index(self) -> int: ...
    def set_cell_text(self, colx: int, value: str, style: XFStyle = ...) -> None: ...
    def set_cell_blank(self, colx: int, style: XFStyle = ...) -> None: ...
    def set_cell_mulblanks(
        self, first_colx: int, last_colx: int, style: XFStyle = ...
    ) -> None: ...
    def set_cell_number(
        self, colx: int, number: _Number, style: XFStyle = ...
    ) -> None: ...
    def set_cell_date(
        self,
        colx: int,
        datetime_obj: _Date,
        style: XFStyle = ...,
    ) -> None: ...
    def set_cell_formula(
        self, colx: int, formula: Formula, style: XFStyle = ..., calc_flags: int = 0
    ) -> None: ...
    def set_cell_boolean(
        self, colx: int, value: bool, style: XFStyle = ...
    ) -> None: ...
    def set_cell_error(
        self, colx: int, error_string_or_code: str | int, style: XFStyle = ...
    ) -> None: ...
    def set_cell_rich_text(
        self, col: int, rich_text_list: _RichText, style: XFStyle = ...
    ) -> None: ...
    def write(self, col: int, label: _Label, style: XFStyle = ...) -> None: ...