hyb
2025-11-10 e0a856b5072c5a09f3f6de6da85abf90e00ee704
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
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
Ë
dñúh¥:ãó—ddlmZddlmZddlmZddlmZddlmZddlm    Z    ddl
m Z m Z m Z mZGd„d    e    «ZGd
„d e«Zy ) é)Úcopy)Ú
attrgetter)ÚStrict)ÚMinMax)ÚUniqueSequence)Ú Serialisable)Úrange_boundariesÚrange_to_tupleÚget_column_letterÚquote_sheetnamecó¢—eZdZdZedde¬«Zedde¬«Zedde¬«Zedde¬«Z            d&d„Z
e d„«Z e d    „«Z e d
„«Ze d „«Ze d „«Zd „Zd„Zd„Zd„Zd„Zd'd„Zd„Zd„Zd„ZeZd„Zd„Zd„ZeZd„Zd„Z d„Z!d„Z"e"Z#d„Z$e$Z%d„Z&d(d„Z'd(d „Z(e d!„«Z)e d"„«Z*e d#„«Z+e d$„«Z,e d%„«Z-y))Ú    CellRangeaÜ
    Represents a range in a sheet: title and coordinates.
 
    This object is used to perform operations on ranges, like:
 
    - shift, expand or shrink
    - union/intersection with another sheet range,
 
    We can check whether a range is:
 
    - equal or not equal to another,
    - disjoint of another,
    - contained in another.
 
    We can get:
 
    - the size of a range.
    - the range bounds (vertices)
    - the coordinates,
    - the string representation,
 
    éifG)ÚminÚmaxÚ expected_typeiNcó*—|(d|vrt|«\}\}}}}nt|«\}}}}||_||_||_||_||_||kDrd}t|j||¬««‚||kDrd}t|j||¬««‚y)Nú!z({max_col} must be greater than {min_col})Úmin_colÚmax_colz({max_row} must be greater than {min_row})Úmin_rowÚmax_row)    r
r    rrrrÚtitleÚ
ValueErrorÚformat)ÚselfÚ range_stringrrrrrÚfmts        úPH:\Change_password\venv_build\Lib\site-packages\openpyxl/worksheet/cell_range.pyÚ__init__zCellRange.__init__0s­€à Ð #ؐlÑ"Ü>LÈ\Ó>ZÑ;Ñ;˜ ¨'±7ä5EÀlÓ5SÑ2˜ '¨7àˆŒ ؈Œ ؈Œ ؈Œ ؈Œ
à WÒ Ø<ˆCܘSŸZ™Z°À˜ZÓIÓJÐ JØ WÒ Ø<ˆCܘSŸZ™Z°À˜ZÓIÓJÐ Jð ócó^—|j|j|j|jfS)z2
        Vertices of the range as a tuple
        ©rrrr©rs rÚboundszCellRange.boundsFs#€ð
|‰|˜TŸ\™\¨4¯<©<¸¿¹ÐEÐEr!có —d}|j|jk(r|j|jk(rd}|j    t |j«|jt |j«|j¬«S)z9
        Excel-style representation of the range
        z%{min_col}{min_row}:{max_col}{max_row}z{min_col}{min_row}r#)rrrrrr ©rrs  rÚcoordzCellRange.coordNsj€ð
6ˆØ L‰L˜DŸL™LÒ (Ø— ‘  § ¡ Ò,Ø&ˆCàz‰zÜ% d§l¡lÓ3Ø—L‘LÜ% d§l¡lÓ3Ø—L‘Lð    ó
ð    
r!c#óÐK—t|j|jdz«D]7}t|j|jdz«Dcgc]}||f‘Œc}–—Œ9ycc}w­w)z1
        Return cell coordinates as rows
        rN)Úrangerrrr)rÚrowÚcols   rÚrowszCellRange.rows_óWèø€ô
˜Ÿ™ t§|¡|°A¡~Ó6ò    NˆCÜ).¨t¯|©|¸T¿\¹\È!¹^Ó)LÖM #C˜’:ÒMÓ Mñ    NùÚMùó‚A A&Á A!Á A&c#óÐK—t|j|jdz«D]7}t|j|jdz«Dcgc]}||f‘Œc}–—Œ9ycc}w­w)z4
        Return cell coordinates as columns
        rN)r*rrrr)rr,r+s   rÚcolszCellRange.colshr.r/có¤—ddlm}|t|j|jdz«t|j
|j dz««S)Nr)Úproductr)Ú    itertoolsr3r*rrrr)rr3s  rÚcellszCellRange.cellsqs=€å%Ù”u˜TŸ\™\¨4¯<©<¸©>Ó:¼EÀ$Ç,Á,ÐPT×P\ÑP\Ð]^ÑP^Ó<_Ó`Ð`r!cóÀ—t|t«sttt    |«««‚|j
r%|j
|j
k7r t d«‚yy)z²
        Check whether comparisons between ranges are possible.
        Cannot compare ranges from different worksheets
        Skip if the range passed in has no title.
        z1Cannot work with ranges from different worksheetsN)Ú
isinstancerÚ    TypeErrorÚreprÚtyperr©rÚothers  rÚ _check_titlezCellRange._check_titlewsK€ô ˜%¤Ô+ÜœD¤ e£Ó-Ó.Ð .à ;Š;˜4Ÿ:™:¨¯©Ò4ÜÐPÓQÐ Qð5ˆ;r!cóš—d}|jrd}|j|jj|j|j¬«S)Nz<{cls} {coord}>z<{cls} {title!r}!{coord}>)Úclsrr()rrÚ    __class__Ú__name__r(r's  rÚ__repr__zCellRange.__repr__„s:€Ø ˆØ :Š:Ø.ˆC؏z‰z˜dŸn™n×5Ñ5¸T¿Z¹ZÈtÏzÉzˆzÓZÐZr!cóp—t|j|j|j|jf«S©N)Úhashrrrrr$s rÚ__hash__zCellRange.__hash__‹s&€ÜT—\‘\ 4§<¡<°·±¸t¿|¹|ÐLÓMÐMr!cóv—d}|j}|r d}t|«}|j||j¬«S)Nz{coord}z{title}!{coord})rr()rr rr()rrrs   rÚ__str__zCellRange.__str__s9€ØˆØ—
‘
ˆÙ Ø$ˆCÜ# EÓ*ˆE؏z‰z ¨T¯Z©ZˆzÓ8Ð8r!có’—|j|j|j|j|j|j
¬«S)N©rrrrr)r@rrrrrr$s rÚ__copy__zCellRange.__copy__˜s8€Ø~‰~ d§l¡l¸D¿L¹LØ&*§l¡l¸D¿L¹LØ$(§J¡Jðó0ð    0r!có*—|j|zdks|j|zdkrtdj||««‚|xj|z c_|xj|z c_|xj|z c_|xj
|z c_y)a{
        Shift the focus of the range according to the shift values (*col_shift*, *row_shift*).
 
        :type col_shift: int
        :param col_shift: number of columns to be moved by, can be negative
        :type row_shift: int
        :param row_shift: number of rows to be moved by, can be negative
        :raise: :class:`ValueError` if any row or column index < 1
        rz1Invalid shift value: col_shift={0}, row_shift={1}N)rrrrrr)rÚ    col_shiftÚ    row_shifts   rÚshiftzCellRange.shiftžsy€ð L‰L˜9Ñ $¨Ò )؏|‰|˜iÑ'¨1Ò,ÜÐP×WÑWÐXaÐclÓmÓnÐ nØ  Š ˜    Ñ! Ø  Š ˜    Ñ! Ø  Š ˜    Ñ! Ø  Š ˜    Ñ!Ž r!có—    |j|«|j|jk7xsO|j|jk7xs4|j|jk7xs|j
|j
k7S#t$rYywxYw)zÏ
        Test whether the ranges are not equal.
 
        :type other: openpyxl.worksheet.cell_range.CellRange
        :param other: Other sheet range
        :return: ``True`` if *range* != *other*.
        T)r=rrrrrr;s  rÚ__ne__zCellRange.__ne__²s€ð    Ø × Ñ ˜eÔ $ð
M‰M˜TŸ\™\Ñ )ò -؏|‰|˜uŸ}™}Ñ,ò -à}‰} § ¡ Ñ,ò -ð|‰|˜uŸ}™}Ñ,ð        
øôò    Ùð    ús‚A=Á=    B    ÂB    có&—|j|« S)zË
        Test whether the ranges are equal.
 
        :type other: openpyxl.worksheet.cell_range.CellRange
        :param other: Other sheet range
        :return: ``True`` if *range* == *other*.
        )rQr;s  rÚ__eq__zCellRange.__eq__Çs€ð—;‘;˜uÓ%Ð%Ð%r!cóF—|j|«|j|«S)zâ
        Test whether every cell in this range is also in *other*.
 
        :type other: openpyxl.worksheet.cell_range.CellRange
        :param other: Other sheet range
        :return: ``True`` if *range* <= *other*.
        ©r=Ú_CellRange__supersetr;s  rÚissubsetzCellRange.issubsetÒs#€ð     ×ј%Ô à×Ñ Ó%Ð%r!cóJ—|j|«xr|j|«S)zé
        Test whether *other* contains every cell of this range, and more.
 
        :type other: openpyxl.worksheet.cell_range.CellRange
        :param other: Other sheet range
        :return: ``True`` if *range* < *other*.
        )Ú__le__rQr;s  rÚ__lt__zCellRange.__lt__áó!€ð{‰{˜5Ó!Ò8 d§k¡k°%Ó&8Ð8r!có—|j|jcxkxr!|jcxkxr|jkncxr@|j|jcxkxr!|jcxkxr|jkScSrD)rrrrr;s  rÚ
__supersetzCellRange.__supersetìs\€à \‰\˜UŸ]™]Ö K¨e¯m©mÖ K¸t¿|¹|Ô Kò Mà \‰\˜UŸ]™]Ö K¨e¯m©mÖ K¸t¿|¹|Ñ Kð    
ñLð    
r!cóF—|j|«|j|«S)zõ
        Test whether every cell in *other* is in this range.
 
        :type other: openpyxl.worksheet.cell_range.CellRange
        :param other: Other sheet range
        :return: ``True`` if *range* >= *other* (or *other* in *range*).
        rUr;s  rÚ
issupersetzCellRange.issupersetôs!€ð     ×ј%Ô à‰˜uÓ%Ð%r!cóF—|j|«}|j|«S)zO
        Check whether the range contains a particular cell coordinate
        )r@rV©rr(Úcrs   rÚ __contains__zCellRange.__contains__s!€ð^‰^˜EÓ "ˆØ‰˜rÓ"Ð"r!cóJ—|j|«xr|j|«S)zé
        Test whether this range contains every cell in *other*, and more.
 
        :type other: openpyxl.worksheet.cell_range.CellRange
        :param other: Other sheet range
        :return: ``True`` if *range* > *other*.
        )Ú__ge__rQr;s  rÚ__gt__zCellRange.__gt__ r[r!cóü—|j|«|j|jkDr||}}|j|jkxs4|j|j
kxs|j|j
kS)aV
        Return ``True`` if this range has no cell in common with *other*.
        Ranges are disjoint if and only if their intersection is the empty range.
 
        :type other: openpyxl.worksheet.cell_range.CellRange
        :param other: Other sheet range.
        :return: ``True`` if the range has no cells in common with other.
        )r=r%rrrrr;s  rÚ
isdisjointzCellRange.isdisjointsl€ð     ×ј%Ô ð ;‰;˜Ÿ™Ò %Ø %ˆDà— ‘ ˜uŸ}™}Ñ,ò0Ø—<‘< %§-¡-Ñ/ò0à—=‘= 4§<¡<Ñ/ð    1r!cóx—|j|«rtdj||««‚t|j|j«}t |j |j «}t|j|j«}t |j|j«}t||||¬«S)aN
        Return a new range with cells common to this range and *other*
 
        :type other: openpyxl.worksheet.cell_range.CellRange
        :param other: Other sheet range.
        :return: the intersecting sheet range.
        :raise: :class:`ValueError` if the *other* range doesn't intersect
            with this range.
        zRange {0} doesn't intersect {0}r#)
rhrrrrrrrrr©rr<rrrrs      rÚ intersectionzCellRange.intersection*s€ð ?‰?˜5Ô !ÜÐ>×EÑEÀdÈEÓRÓSÐ Säd—l‘l E§M¡MÓ2ˆÜd—l‘l E§M¡MÓ2ˆÜd—l‘l E§M¡MÓ2ˆÜd—l‘l E§M¡MÓ2ˆä °'À7Ø!(ô*ð    *r!cóX—|j|«t|j|j«}t|j|j«}t|j
|j
«}t|j |j «}t|||||j¬«S)a
        Return the minimal superset of this range and *other*. This new range
        will contain all cells from this range, *other*, and any additional
        cells required to form a rectangular ``CellRange``.
 
        :type other: openpyxl.worksheet.cell_range.CellRange
        :param other: Other sheet range.
        :return: a ``CellRange`` that is a superset of this and *other*.
        rJ)    r=rrrrrrrrrjs      rÚunionzCellRange.unionBs~€ð     ×ј%Ô äd—l‘l E§M¡MÓ2ˆÜd—l‘l E§M¡MÓ2ˆÜd—l‘l E§M¡MÓ2ˆÜd—l‘l E§M¡MÓ2ˆÜ °'À7Ø!(°·
±
ô<ð    <r!c#ó^K—|jD]}|dk(rŒ    t||«}||f–—Œy­w)zC
        For use as a dictionary elsewhere in the library.
        rN)Ú    __attrs__Úgetattr)rÚxÚvs   rÚ__iter__zCellRange.__iter__Xs:èø€ð—‘ò    ˆAؐGŠ|ØÜ˜˜aÓ ˆAؐQ$‹Jñ        ùs‚+-có¬—|xj|zc_|xj|zc_|xj|z c_|xj|z c_y)a¦
        Expand the range by the dimensions provided.
 
        :type right: int
        :param right: expand range to the right by this number of cells
        :type down: int
        :param down: expand range down by this number of cells
        :type left: int
        :param left: expand range to the left by this number of cells
        :type up: int
        :param up: expand range up by this number of cells
        Nr#)rÚrightÚdownÚleftÚups     rÚexpandzCellRange.expandcs<€ð      Š ˜Ñ Ø  Š ˜Ñ Ø  Š ˜Ñ Ø  Š ˜ÑŽ r!có¬—|xj|z c_|xj|z c_|xj|zc_|xj|zc_y)a¿
        Shrink the range by the dimensions provided.
 
        :type right: int
        :param right: shrink range from the right by this number of cells
        :type down: int
        :param down: shrink range from the top by this number of cells
        :type left: int
        :param left: shrink range from the left by this number of cells
        :type up: int
        :param up: shrink range from the bottom by this number of cells
        Nr#)rruÚbottomrwÚtops     rÚshrinkzCellRange.shrinkvs<€ð      Š ˜Ñ Ø  Š ˜Ñ Ø  Š ˜Ñ Ø  Š ˜ÑŽ r!có|—|jdz|jz
}|jdz|jz
}||dœS)zC Return the size of the range as a dictionary of rows and columns. r)Úcolumnsr-)rrrr)rr1r-s   rÚsizezCellRange.size‰s=€ð|‰|˜aÑ $§,¡,Ñ.ˆØ|‰|˜aÑ $§,¡,Ñ.ˆØ tÑ,Ð,r!có†—t|j|jdz«Dcgc]}|j|f‘Œc}Scc}w)z=A list of cell coordinates that comprise the top of the ranger)r*rrr©rr,s  rr|z CellRange.top‘ó5€ô05°T·\±\À4Ç<Á<ÐPQÁ>Ó/RÖS¨—‘˜sÒ#ÒSÐSùÒSó¦>có†—t|j|jdz«Dcgc]}|j|f‘Œc}Scc}w)z@A list of cell coordinates that comprise the bottom of the ranger)r*rrrr‚s  rr{zCellRange.bottom—rƒr„có†—t|j|jdz«Dcgc]}||jf‘Œc}Scc}w)zCA list of cell coordinates that comprise the left-side of the ranger)r*rrr©rr+s  rrwzCellRange.leftó5€ô05°T·\±\À4Ç<Á<ÐPQÁ>Ó/RÖS¨d—l‘lÒ#ÒSÐSùÒSr„có†—t|j|jdz«Dcgc]}||jf‘Œc}Scc}w)zDA list of cell coordinates that comprise the right-side of the ranger)r*rrrr‡s  rruzCellRange.right£rˆr„)NNNNNN)rr)rrrr).rAÚ
__module__Ú __qualname__Ú__doc__rÚintrrrrr Úpropertyr%r(r-r1r5r=rBrFrHrKrOrQrSrWrYrZrVr_rercrfrhrkÚ__and__rmÚ__or__rsryr}r€r|r{rwru©r!rrrs¬„ññ.˜ °SÔ9€GÙ˜ °sÔ;€GÙ˜ °SÔ9€GÙ˜ °sÔ;€GðAEØ37óKð,ñFóðFðñ
óð
ð ñNóðNðñNóðNðñaóðaò
 
Rò[òNò9ò0ó "ò(
ò*&ò
&ð€Fò9ò
ò
&ð€Fò#ò9ò1ò(*ð*€Gò<ð&€Fòóó&ð&ñ-óð-ðñTóðTð
ñTóðTð
ñTóðTð
ñTóñTr!rcó€—eZdZee¬«Ze«fd„Zd„Zd„Z    d„Z
d„Z d„Z d„Z d    „Zd
„Zd „Zd „Zd „Zd„Zd„Zy)ÚMultiCellRange)rcóš—t|t«r&|j«Dcgc] }t|«‘Œ}}t    |«|_ycc}wrD)r7ÚstrÚsplitrÚsetÚranges)rr˜Úrs   rr zMultiCellRange.__init__¯s9€Ü fœcÔ "Ø,2¯L©L«NÖ; q”i •lÐ;ˆFÐ;ܘ&“kˆ ùò<s£Acój—t|t«r t|«}|jD]    }||ksŒ    yy)NTF)r7r•rr˜)rr(r™s   rrczMultiCellRange.__contains__µs8€Ü eœSÔ !ܘeÓ$ˆEØ—‘ò    ˆAؘ‹zÙð    ðr!có²—dj|j«Dcgc] }t|«‘Œc}«}d|jj›d|›dScc}w)Nú ú<z [z]>)ÚjoinÚsortedr•r@rA©rr™r˜s   rrBzMultiCellRange.__repr__¾sJ€Ø—‘¨4¯;©;«=Ö9 aœ3˜q6Ò9Ó:ˆØ4—>‘>×*Ñ*Ð+¨2¨f¨X°RÐ8Ð8ùò:sžAcó|—dj|j«Dcgc] }t|«‘Œc}«}|Scc}w)Nrœ)ržrŸr•r s   rrHzMultiCellRange.__str__Ãs/€Ø—‘¨D¯K©K«MÖ: qœC FÒ:Ó;ˆØˆ ùò;sž9có*—tt|««SrD)rEr•r$s rrFzMultiCellRange.__hash__Ès€Ü”C˜“I‹Ðr!c    óH—t|jtdddd«¬«S)z/
        Return a sorted list of items
        rrrr)Úkey)rŸr˜rr$s rrŸzMultiCellRange.sortedÌs!€ôd—k‘k¤z°)¸YÈ    ÐS\Ó']Ô^Ð^r!có¶—|}t|t«r t|«}nt|t«s td«‚||vr|jj |«yy)z4
        Add a cell coordinate or CellRange
        zYou can only add CellRangesN)r7r•rrr˜Úaddras   rr¦zMultiCellRange.addÓsO€ðˆÜ eœSÔ !ܘ5Ó!‰BܘE¤9Ô-ÜÐ:Ó;Ð ;Ø T‰>Ø K‰KO‰O˜BÕ ð r!có(—|j|«|SrD)r¦©rr(s  rÚ__iadd__zMultiCellRange.__iadd__às€Ø ‰ŒØˆ r!cóv—t|t«r|j|«}|j|jk(SrD)r7r•r@r˜r;s  rrSzMultiCellRange.__eq__ås-€Ü uœcÔ "Ø—N‘N 5Ó)ˆE؏{‰{˜eŸl™lÑ*Ð*r!có—||k( SrDr‘r;s  rrQzMultiCellRange.__ne__ës€Ø˜5‘=РРr!có,—t|j«SrD)Úboolr˜r$s rÚ__bool__zMultiCellRange.__bool__ïs€ÜD—K‘KӠРr!cóp—t|t«s t|«}|jj|«yrD)r7rr˜Úremover¨s  rr°zMultiCellRange.removeós(€Ü˜%¤Ô+ܘeÓ$ˆEØ  ‰ ×ј5Õ!r!c#ó6K—|jD]}|–—Œy­wrD)r˜)rrbs  rrszMultiCellRange.__iter__ùsèø€Ø—+‘+ò    ˆBØ‹Hñ    ùs‚cóf—|jDchc] }t|«’Œ}}t|«Scc}wrD)r˜rr“r s   rrKzMultiCellRange.__copy__þs-€Ø#'§;¡;Ö/˜a”$q•'Ð/ˆÐ/ܘfÓ%Ð%ùò0s.N)rArŠr‹rrr˜r—r rcrBrHrFrŸr¦r©rSrQr®r°rsrKr‘r!rr“r“©s\„ñ¨)Ô 4€Fñ"›eó"ò ò9ò
ò
ò_ò
 òò
+ò !ò!ò"ò ó
&r!r“N)rÚoperatorrÚopenpyxl.descriptorsrrÚopenpyxl.descriptors.sequencerÚ!openpyxl.descriptors.serialisablerÚopenpyxl.utilsr    r
r r rr“r‘r!rú<module>r¸sBðõÝå'Ý'Ý8Ý:÷óôTT ôTTôn W&VõW&r!