openpyxl.worksheet.filters module¶
- class openpyxl.worksheet.filters.AutoFilter(ref=None, filterColumn=(), sortState=None, extLst=None)[源代码]¶
基类:
openpyxl.descriptors.serialisable.Serialisable
- add_filter_column(col_id, vals, blank=False)[源代码]¶
Add row filter for specified column.
- 参数
col_id (int) – Zero-origin column id. 0 means first column.
vals (str[]) – Value list to show.
blank (bool) – Show rows that have blank cell if True (default=``False``)
- add_sort_condition(ref, descending=False)[源代码]¶
Add sort condition for cpecified range of cells.
- 参数
ref (string) – range of the cells (e.g. ‘A2:A150’)
descending (bool) – Descending sort order (default=``False``)
- extLst¶
Values must be of type <class ‘openpyxl.descriptors.excel.ExtensionList’>
- filterColumn¶
A sequence (list or tuple) that may only contain objects of the declared type
- ref¶
- sortState¶
Values must be of type <class ‘openpyxl.worksheet.filters.SortState’>
- tagname = 'autoFilter'¶
- class openpyxl.worksheet.filters.ColorFilter(dxfId=None, cellColor=None)[源代码]¶
基类:
openpyxl.descriptors.serialisable.Serialisable
- cellColor¶
Values must be of type <class ‘bool’>
- dxfId¶
Values must be of type <class ‘int’>
- tagname = 'colorFilter'¶
- class openpyxl.worksheet.filters.CustomFilter(operator=None, val=None)[源代码]¶
基类:
openpyxl.descriptors.serialisable.Serialisable
- operator¶
Value must be one of {‘lessThan’, ‘greaterThan’, ‘equal’, ‘notEqual’, ‘lessThanOrEqual’, ‘greaterThanOrEqual’}
- tagname = 'customFilter'¶
- val¶
Values must be of type <class ‘str’>
- class openpyxl.worksheet.filters.CustomFilters(_and=None, customFilter=())[源代码]¶
基类:
openpyxl.descriptors.serialisable.Serialisable
- customFilter¶
A sequence (list or tuple) that may only contain objects of the declared type
- tagname = 'customFilters'¶
- class openpyxl.worksheet.filters.DateGroupItem(year=None, month=None, day=None, hour=None, minute=None, second=None, dateTimeGrouping=None)[源代码]¶
基类:
openpyxl.descriptors.serialisable.Serialisable
- dateTimeGrouping¶
Value must be one of {‘hour’, ‘year’, ‘day’, ‘second’, ‘minute’, ‘month’}
- day¶
Values must be of type <class ‘float’>
- hour¶
Values must be of type <class ‘float’>
- minute¶
Values must be of type <class ‘float’>
- month¶
Values must be of type <class ‘float’>
- second¶
Values must be of type <class ‘int’>
- tagname = 'dateGroupItem'¶
- year¶
Values must be of type <class ‘int’>
- class openpyxl.worksheet.filters.DynamicFilter(type=None, val=None, valIso=None, maxVal=None, maxValIso=None)[源代码]¶
基类:
openpyxl.descriptors.serialisable.Serialisable
- maxVal¶
Values must be of type <class ‘float’>
- maxValIso¶
Values must be of type <class ‘datetime.datetime’>
- tagname = 'dynamicFilter'¶
- type¶
Value must be one of {‘thisWeek’, ‘tomorrow’, ‘null’, ‘Q3’, ‘M8’, ‘M11’, ‘M6’, ‘today’, ‘Q2’, ‘nextQuarter’, ‘lastMonth’, ‘M1’, ‘lastYear’, ‘aboveAverage’, ‘thisYear’, ‘yearToDate’, ‘lastQuarter’, ‘thisMonth’, ‘nextMonth’, ‘M3’, ‘nextYear’, ‘M9’, ‘thisQuarter’, ‘M12’, ‘M7’, ‘nextWeek’, ‘yesterday’, ‘M2’, ‘M4’, ‘M5’, ‘Q1’, ‘belowAverage’, ‘lastWeek’, ‘M10’, ‘Q4’}
- val¶
Values must be of type <class ‘float’>
- valIso¶
Values must be of type <class ‘datetime.datetime’>
- class openpyxl.worksheet.filters.FilterColumn(colId=None, hiddenButton=None, showButton=None, filters=None, top10=None, customFilters=None, dynamicFilter=None, colorFilter=None, iconFilter=None, extLst=None, blank=None, vals=None)[源代码]¶
基类:
openpyxl.descriptors.serialisable.Serialisable
- colId¶
Values must be of type <class ‘int’>
- col_id¶
Aliases can be used when either the desired attribute name is not allowed or confusing in Python (eg. “type”) or a more descriptve name is desired (eg. “underline” for “u”)
- colorFilter¶
Values must be of type <class ‘openpyxl.worksheet.filters.ColorFilter’>
- customFilters¶
Values must be of type <class ‘openpyxl.worksheet.filters.CustomFilters’>
- dynamicFilter¶
Values must be of type <class ‘openpyxl.worksheet.filters.DynamicFilter’>
- extLst¶
Values must be of type <class ‘openpyxl.descriptors.excel.ExtensionList’>
- filters¶
Values must be of type <class ‘openpyxl.worksheet.filters.Filters’>
Values must be of type <class ‘bool’>
- iconFilter¶
Values must be of type <class ‘openpyxl.worksheet.filters.IconFilter’>
- showButton¶
Values must be of type <class ‘bool’>
- tagname = 'filterColumn'¶
- top10¶
Values must be of type <class ‘openpyxl.worksheet.filters.Top10’>
- class openpyxl.worksheet.filters.Filters(blank=None, calendarType=None, filter=(), dateGroupItem=())[源代码]¶
基类:
openpyxl.descriptors.serialisable.Serialisable
- blank¶
Values must be of type <class ‘bool’>
- calendarType¶
Value must be one of {‘gregorianXlitEnglish’, ‘gregorian’, ‘taiwan’, ‘gregorianUs’, ‘thai’, ‘hebrew’, ‘gregorianXlitFrench’, ‘saka’, ‘korea’, ‘gregorianMeFrench’, ‘hijri’, ‘japan’, ‘gregorianArabic’}
- dateGroupItem¶
A sequence (list or tuple) that may only contain objects of the declared type
- filter¶
A sequence of primitive types that are stored as a single attribute. “val” is the default attribute
- tagname = 'filters'¶
- class openpyxl.worksheet.filters.IconFilter(iconSet=None, iconId=None)[源代码]¶
基类:
openpyxl.descriptors.serialisable.Serialisable
- iconId¶
Values must be of type <class ‘int’>
- iconSet¶
Value must be one of {‘4ArrowsGray’, ‘4RedToBlack’, ‘3TrafficLights1’, ‘5Quarters’, ‘4TrafficLights’, ‘5Rating’, ‘3Signs’, ‘3Symbols2’, ‘3Flags’, ‘5Arrows’, ‘3Arrows’, ‘3ArrowsGray’, ‘4Arrows’, ‘4Rating’, ‘3TrafficLights2’, ‘3Symbols’, ‘5ArrowsGray’}
- tagname = 'iconFilter'¶
- class openpyxl.worksheet.filters.SortCondition(ref=None, descending=None, sortBy=None, customList=None, dxfId=None, iconSet=None, iconId=None)[源代码]¶
基类:
openpyxl.descriptors.serialisable.Serialisable
- customList¶
Values must be of type <class ‘str’>
- descending¶
Values must be of type <class ‘bool’>
- dxfId¶
Values must be of type <class ‘int’>
- iconId¶
Values must be of type <class ‘int’>
- iconSet¶
Value must be one of {‘4ArrowsGray’, ‘4RedToBlack’, ‘3TrafficLights1’, ‘5Quarters’, ‘4TrafficLights’, ‘5Rating’, ‘3Signs’, ‘3Symbols2’, ‘3Flags’, ‘5Arrows’, ‘3Arrows’, ‘3ArrowsGray’, ‘4Arrows’, ‘4Rating’, ‘3TrafficLights2’, ‘3Symbols’, ‘5ArrowsGray’}
- ref¶
- sortBy¶
Value must be one of {‘icon’, ‘value’, ‘cellColor’, ‘fontColor’}
- tagname = 'sortCondition'¶
- class openpyxl.worksheet.filters.SortState(columnSort=None, caseSensitive=None, sortMethod=None, ref=None, sortCondition=(), extLst=None)[源代码]¶
基类:
openpyxl.descriptors.serialisable.Serialisable
- caseSensitive¶
Values must be of type <class ‘bool’>
- columnSort¶
Values must be of type <class ‘bool’>
- extLst¶
Values must be of type <class ‘openpyxl.descriptors.excel.ExtensionList’>
- ref¶
- sortCondition¶
A sequence (list or tuple) that may only contain objects of the declared type
- sortMethod¶
Value must be one of {‘pinYin’, ‘stroke’}
- tagname = 'sortState'¶
- class openpyxl.worksheet.filters.Top10(top=None, percent=None, val=None, filterVal=None)[源代码]¶
基类:
openpyxl.descriptors.serialisable.Serialisable
- filterVal¶
Values must be of type <class ‘float’>
- percent¶
Values must be of type <class ‘bool’>
- tagname = 'top10'¶
- top¶
Values must be of type <class ‘bool’>
- val¶
Values must be of type <class ‘float’>