class Properties(Serialisable): locked = Bool(allow_none=True) defaultSize = Bool(allow_none=True) _print = Bool(allow_none=True) disabled = Bool(allow_none=True) uiObject = Bool(allow_none=True) autoFill = Bool(allow_none=True) autoLine = Bool(allow_none=True) altText = String(allow_none=True) textHAlign = Set(values=(['left', 'center', 'right', 'justify', 'distributed'])) textVAlign = Set(values=(['top', 'center', 'bottom', 'justify', 'distributed'])) lockText = Bool(allow_none=True) justLastX = Bool(allow_none=True) autoScale = Bool(allow_none=True) rowHidden = Bool(allow_none=True) colHidden = Bool(allow_none=True) anchor = Typed(expected_type=ObjectAnchor, ) __elements__ = ('anchor',) def __init__(self, locked=None, defaultSize=None, _print=None, disabled=None, uiObject=None, autoFill=None, autoLine=None, altText=None, textHAlign=None, textVAlign=None, lockText=None, justLastX=None, autoScale=None, rowHidden=None, colHidden=None, anchor=None, ): self.locked = locked self.defaultSize = defaultSize self._print = _print self.disabled = disabled self.uiObject = uiObject self.autoFill = autoFill self.autoLine = autoLine self.altText = altText self.textHAlign = textHAlign self.textVAlign = textVAlign self.lockText = lockText self.justLastX = justLastX self.autoScale = autoScale self.rowHidden = rowHidden self.colHidden = colHidden self.anchor = anchor
class DynamicFilter(Serialisable): tagname = "dynamicFilter" type = Set(values=(['null', 'aboveAverage', 'belowAverage', 'tomorrow', 'today', 'yesterday', 'nextWeek', 'thisWeek', 'lastWeek', 'nextMonth', 'thisMonth', 'lastMonth', 'nextQuarter', 'thisQuarter', 'lastQuarter', 'nextYear', 'thisYear', 'lastYear', 'yearToDate', 'Q1', 'Q2', 'Q3', 'Q4', 'M1', 'M2', 'M3', 'M4', 'M5', 'M6', 'M7', 'M8', 'M9', 'M10', 'M11', 'M12'])) val = Float(allow_none=True) valIso = DateTime(allow_none=True) maxVal = Float(allow_none=True) maxValIso = DateTime(allow_none=True) def __init__(self, type=None, val=None, valIso=None, maxVal=None, maxValIso=None, ): self.type = type self.val = val self.valIso = valIso self.maxVal = maxVal self.maxValIso = maxValIso
class DateGroupItem(Serialisable): tagname = "dateGroupItem" year = Integer() month = MinMax(min=1, max=12, allow_none=True) day = MinMax(min=1, max=31, allow_none=True) hour = MinMax(min=0, max=23, allow_none=True) minute = MinMax(min=0, max=59, allow_none=True) second = Integer(min=0, max=59, allow_none=True) dateTimeGrouping = Set(values=(['year', 'month', 'day', 'hour', 'minute', 'second'])) def __init__(self, year=None, month=None, day=None, hour=None, minute=None, second=None, dateTimeGrouping=None, ): self.year = year self.month = month self.day = day self.hour = hour self.minute = minute self.second = second self.dateTimeGrouping = dateTimeGrouping
class WebPublishItem(Serialisable): tagname = "webPublishItem" id = Integer() divId = String() sourceType = Set(values=([ 'sheet', 'printArea', 'autoFilter', 'range', 'chart', 'pivotTable', 'query', 'label' ])) sourceRef = String() sourceObject = String(allow_none=True) destinationFile = String() title = String(allow_none=True) autoRepublish = Bool(allow_none=True) def __init__( self, id=None, divId=None, sourceType=None, sourceRef=None, sourceObject=None, destinationFile=None, title=None, autoRepublish=None, ): self.id = id self.divId = divId self.sourceType = sourceType self.sourceRef = sourceRef self.sourceObject = sourceObject self.destinationFile = destinationFile self.title = title self.autoRepublish = autoRepublish
class CustomChartsheetView(Serialisable): tagname = "customSheetView" guid = Guid() scale = Integer() state = Set(values=(['visible', 'hidden', 'veryHidden'])) zoomToFit = Bool(allow_none=True) pageMargins = Typed(expected_type=PageMargins, allow_none=True) pageSetup = Typed(expected_type=PrintPageSetup, allow_none=True) headerFooter = Typed(expected_type=HeaderFooter, allow_none=True) __elements__ = ('pageMargins', 'pageSetup', 'headerFooter') def __init__(self, guid=None, scale=None, state='visible', zoomToFit=None, pageMargins=None, pageSetup=None, headerFooter=None, ): self.guid = guid self.scale = scale self.state = state self.zoomToFit = zoomToFit self.pageMargins = pageMargins self.pageSetup = pageSetup self.headerFooter = headerFooter
class TableStyleElement(Serialisable): tagname = "tableStyleElement" type = Set(values=([ 'wholeTable', 'headerRow', 'totalRow', 'firstColumn', 'lastColumn', 'firstRowStripe', 'secondRowStripe', 'firstColumnStripe', 'secondColumnStripe', 'firstHeaderCell', 'lastHeaderCell', 'firstTotalCell', 'lastTotalCell', 'firstSubtotalColumn', 'secondSubtotalColumn', 'thirdSubtotalColumn', 'firstSubtotalRow', 'secondSubtotalRow', 'thirdSubtotalRow', 'blankRow', 'firstColumnSubheading', 'secondColumnSubheading', 'thirdColumnSubheading', 'firstRowSubheading', 'secondRowSubheading', 'thirdRowSubheading', 'pageFieldLabels', 'pageFieldValues' ])) size = Integer(allow_none=True) dxfId = Integer(allow_none=True) def __init__( self, type=None, size=None, dxfId=None, ): self.type = type self.size = size self.dxfId = dxfId
class ConditionalFormat(Serialisable): tagname = "conditionalFormat" scope = Set(values=(['selection', 'data', 'field'])) type = NoneSet(values=(['all', 'row', 'column'])) priority = Integer() pivotAreas = NestedSequence(expected_type=PivotArea) extLst = Typed(expected_type=ExtensionList, allow_none=True) __elements__ = ('pivotAreas', ) def __init__( self, scope=None, type=None, priority=None, pivotAreas=(), extLst=None, ): self.scope = scope self.type = type self.priority = priority self.pivotAreas = pivotAreas self.extLst = extLst
class RangePr(Serialisable): tagname = "rangePr" autoStart = Bool(allow_none=True) autoEnd = Bool(allow_none=True) groupBy = Set(values=(['range', 'seconds', 'minutes', 'hours', 'days', 'months', 'quarters', 'years'])) startNum = Float(allow_none=True) endNum = Float(allow_none=True) startDate = DateTime(allow_none=True) endDate = DateTime(allow_none=True) groupInterval = Float(allow_none=True) def __init__(self, autoStart=True, autoEnd=True, groupBy=range, startNum=None, endNum=None, startDate=None, endDate=None, groupInterval=1, ): self.autoStart = autoStart self.autoEnd = autoEnd self.groupBy = groupBy self.startNum = startNum self.endNum = endNum self.startDate = startDate self.endDate = endDate self.groupInterval = groupInterval
class RowColItem(Serialisable): tagname = "i" t = Set(values=([ 'data', 'default', 'sum', 'countA', 'avg', 'max', 'min', 'product', 'count', 'stdDev', 'stdDevP', 'var', 'varP', 'grand', 'blank' ])) r = Integer() i = Integer() x = NestedInteger(allow_none=True, attribute="v") __elements__ = ('x', ) def __init__( self, t="data", r=0, i=0, x=None, ): self.t = t self.r = r self.i = i self.x = x
class PresetShadowEffect(ColorChoice): prst = Set(values=(['shdw1', 'shdw2', 'shdw3', 'shdw4', 'shdw5', 'shdw6', 'shdw7', 'shdw8', 'shdw9', 'shdw10', 'shdw11', 'shdw12', 'shdw13', 'shdw14', 'shdw15', 'shdw16', 'shdw17', 'shdw18', 'shdw19', 'shdw20'])) dist = Float() dir = Integer() # uses element group EG_ColorChoice scrgbClr = ColorChoice.scrgbClr srgbClr = ColorChoice.srgbClr hslClr = ColorChoice.hslClr sysClr = ColorChoice.sysClr schemeClr = ColorChoice.schemeClr prstClr = ColorChoice.prstClr __elements__ = ('scrgbClr', 'srgbClr', 'hslClr', 'sysClr', 'schemeClr', 'prstClr') def __init__(self, prst=None, dist=None, dir=None, **kw ): self.prst = prst self.dist = dist self.dir = dir super(PresetShadowEffect, self).__init__(**kw)
class FillOverlayEffect(Serialisable): blend = Set(values=(['over', 'mult', 'screen', 'darken', 'lighten'])) def __init__(self, blend=None, ): self.blend = blend
class GradientFill(Fill): """Fill areas with gradient Two types of gradient fill are supported: - A type='linear' gradient interpolates colours between a set of specified Stops, across the length of an area. The gradient is left-to-right by default, but this orientation can be modified with the degree attribute. A list of Colors can be provided instead and they will be positioned with equal distance between them. - A type='path' gradient applies a linear gradient from each edge of the area. Attributes top, right, bottom, left specify the extent of fill from the respective borders. Thus top="0.2" will fill the top 20% of the cell. """ tagname = "gradientFill" type = Set(values=('linear', 'path')) fill_type = Alias("type") degree = Float() left = Float() right = Float() top = Float() bottom = Float() stop = StopList() def __init__(self, type="linear", degree=0, left=0, right=0, top=0, bottom=0, stop=()): self.degree = degree self.left = left self.right = right self.top = top self.bottom = bottom self.stop = stop self.type = type def __iter__(self): for attr in self.__attrs__: value = getattr(self, attr) if value: yield attr, safe_string(value) def to_tree(self, tagname=None, namespace=None, idx=None): parent = Element("fill") el = super(GradientFill, self).to_tree() parent.append(el) return parent
class TabStop(Serialisable): pos = Typed(expected_type=Coordinate, allow_none=True) algn = Typed(expected_type=Set(values=(['l', 'ctr', 'r', 'dec']))) def __init__(self, pos=None, algn=None, ): self.pos = pos self.algn = algn
class EffectContainer(Serialisable): type = Set(values=(['sib', 'tree'])) name = String(allow_none=True) def __init__(self, type=None, name=None, ): self.type = type self.name = name
class PathShadeProperties(Serialisable): path = Set(values=(['shape', 'circle', 'rect'])) fillToRect = Typed(expected_type=RelativeRect, allow_none=True) def __init__( self, path=None, fillToRect=None, ): self.path = path self.fillToRect = fillToRect
class DataField(Serialisable): tagname = "dataField" name = String(allow_none=True) fld = Integer() subtotal = Set(values=([ 'average', 'count', 'countNums', 'max', 'min', 'product', 'stdDev', 'stdDevp', 'sum', 'var', 'varp' ])) showDataAs = Set(values=([ 'normal', 'difference', 'percent', 'percentDiff', 'runTotal', 'percentOfRow', 'percentOfCol', 'percentOfTotal', 'index' ])) baseField = Integer() baseItem = Integer() numFmtId = Integer(allow_none=True) extLst = Typed(expected_type=ExtensionList, allow_none=True) __elements__ = () def __init__( self, name=None, fld=None, subtotal="sum", showDataAs="normal", baseField=-1, baseItem=1048832, numFmtId=None, extLst=None, ): self.name = name self.fld = fld self.subtotal = subtotal self.showDataAs = showDataAs self.baseField = baseField self.baseItem = baseItem self.numFmtId = numFmtId self.extLst = extLst
class LightRig(Serialisable): tagname = "lightRig" rig = Set(values=[ 'legacyFlat1', 'legacyFlat2', 'legacyFlat3', 'legacyFlat4', 'legacyNormal1', 'legacyNormal2', 'legacyNormal3', 'legacyNormal4', 'legacyHarsh1', 'legacyHarsh2', 'legacyHarsh3', 'legacyHarsh4', 'threePt', 'balanced', 'soft', 'harsh', 'flood', 'contrasting', 'morning', 'sunrise', 'sunset', 'chilly', 'freezing', 'flat', 'twoPt', 'glow', 'brightRoom' ]) dir = Set(values=(['tl', 't', 'tr', 'l', 'r', 'bl', 'b', 'br'])) rot = Typed(expected_type=SphereCoords, allow_none=True) def __init__( self, rig=None, dir=None, rot=None, ): self.rig = rig self.dir = dir self.rot = rot
class IconFilter(Serialisable): tagname = "iconFilter" iconSet = Set(values=(['3Arrows', '3ArrowsGray', '3Flags', '3TrafficLights1', '3TrafficLights2', '3Signs', '3Symbols', '3Symbols2', '4Arrows', '4ArrowsGray', '4RedToBlack', '4Rating', '4TrafficLights', '5Arrows', '5ArrowsGray', '5Rating', '5Quarters'])) iconId = Integer(allow_none=True) def __init__(self, iconSet=None, iconId=None, ): self.iconSet = iconSet self.iconId = iconId
class Camera(Serialisable): tagname = "camera" prst = Set(values=[ 'legacyObliqueTopLeft', 'legacyObliqueTop', 'legacyObliqueTopRight', 'legacyObliqueLeft', 'legacyObliqueFront', 'legacyObliqueRight', 'legacyObliqueBottomLeft', 'legacyObliqueBottom', 'legacyObliqueBottomRight', 'legacyPerspectiveTopLeft', 'legacyPerspectiveTop', 'legacyPerspectiveTopRight', 'legacyPerspectiveLeft', 'legacyPerspectiveFront', 'legacyPerspectiveRight', 'legacyPerspectiveBottomLeft', 'legacyPerspectiveBottom', 'legacyPerspectiveBottomRight', 'orthographicFront', 'isometricTopUp', 'isometricTopDown', 'isometricBottomUp', 'isometricBottomDown', 'isometricLeftUp', 'isometricLeftDown', 'isometricRightUp', 'isometricRightDown', 'isometricOffAxis1Left', 'isometricOffAxis1Right', 'isometricOffAxis1Top', 'isometricOffAxis2Left', 'isometricOffAxis2Right', 'isometricOffAxis2Top', 'isometricOffAxis3Left', 'isometricOffAxis3Right', 'isometricOffAxis3Bottom', 'isometricOffAxis4Left', 'isometricOffAxis4Right', 'isometricOffAxis4Bottom', 'obliqueTopLeft', 'obliqueTop', 'obliqueTopRight', 'obliqueLeft', 'obliqueRight', 'obliqueBottomLeft', 'obliqueBottom', 'obliqueBottomRight', 'perspectiveFront', 'perspectiveLeft', 'perspectiveRight', 'perspectiveAbove', 'perspectiveBelow', 'perspectiveAboveLeftFacing', 'perspectiveAboveRightFacing', 'perspectiveContrastingLeftFacing', 'perspectiveContrastingRightFacing', 'perspectiveHeroicLeftFacing', 'perspectiveHeroicRightFacing', 'perspectiveHeroicExtremeLeftFacing', 'perspectiveHeroicExtremeRightFacing', 'perspectiveRelaxed', 'perspectiveRelaxedModerately' ]) fov = Typed(expected_type=Integer, allow_none=True) zoom = Typed(expected_type=Percentage, allow_none=True) rot = Typed(expected_type=SphereCoords, allow_none=True) def __init__( self, prst=None, fov=None, zoom=None, rot=None, ): self.prst = prst self.fov = fov self.zoom = zoom self.rot = rot
class ReflectionEffect(Serialisable): blurRad = Float() stA = Integer() stPos = Integer() endA = Integer() endPos = Integer() dist = Float() dir = Integer() fadeDir = Integer() sx = Integer() sy = Integer() kx = Integer() ky = Integer() algn = Set(values=(['tl', 't', 'tr', 'l', 'ctr', 'r', 'bl', 'b', 'br'])) rotWithShape = Bool(allow_none=True) def __init__(self, blurRad=None, stA=None, stPos=None, endA=None, endPos=None, dist=None, dir=None, fadeDir=None, sx=None, sy=None, kx=None, ky=None, algn=None, rotWithShape=None, ): self.blurRad = blurRad self.stA = stA self.stPos = stPos self.endA = endA self.endPos = endPos self.dist = dist self.dir = dir self.fadeDir = fadeDir self.sx = sx self.sy = sy self.kx = kx self.ky = ky self.algn = algn self.rotWithShape = rotWithShape
class OuterShadow(ColorChoice): tagname = "outerShdw" blurRad = Float(allow_none=True) dist = Float(allow_none=True) dir = Integer(allow_none=True) sx = Integer(allow_none=True) sy = Integer(allow_none=True) kx = Integer(allow_none=True) ky = Integer(allow_none=True) algn = Set(values=['tl', 't', 'tr', 'l', 'ctr', 'r', 'bl', 'b', 'br']) rotWithShape = Bool(allow_none=True) # uses element group EG_ColorChoice scrgbClr = ColorChoice.scrgbClr srgbClr = ColorChoice.srgbClr hslClr = ColorChoice.hslClr sysClr = ColorChoice.sysClr schemeClr = ColorChoice.schemeClr prstClr = ColorChoice.prstClr __elements__ = ('scrgbClr', 'srgbClr', 'hslClr', 'sysClr', 'schemeClr', 'prstClr') def __init__(self, blurRad=None, dist=None, dir=None, sx=None, sy=None, kx=None, ky=None, algn=None, rotWithShape=None, **kw ): self.blurRad = blurRad self.dist = dist self.dir = dir self.sx = sx self.sy = sy self.kx = kx self.ky = ky self.algn = algn self.rotWithShape = rotWithShape super(OuterShadow, self).__init__(**kw)
class FieldItem(Serialisable): tagname = "item" n = String(allow_none=True) t = Set(values=([ 'data', 'default', 'sum', 'countA', 'avg', 'max', 'min', 'product', 'count', 'stdDev', 'stdDevP', 'var', 'varP', 'grand', 'blank' ])) h = Bool(allow_none=True) s = Bool(allow_none=True) sd = Bool(allow_none=True) f = Bool(allow_none=True) m = Bool(allow_none=True) c = Bool(allow_none=True) x = Integer(allow_none=True) d = Bool(allow_none=True) e = Bool(allow_none=True) def __init__( self, n=None, t="data", h=None, s=None, sd=True, f=None, m=None, c=None, x=None, d=None, e=None, ): self.n = n self.t = t self.h = h self.s = s self.sd = sd self.f = f self.m = m self.c = c self.x = x self.d = d self.e = e
class FormatObject(Serialisable): tagname = "cfvo" type = Set(values=(['num', 'percent', 'max', 'min', 'formula', 'percentile'])) val = ValueDescriptor(allow_none=True) gte = Bool(allow_none=True) extLst = Typed(expected_type=ExtensionList, allow_none=True) __elements__ = () def __init__(self, type, val=None, gte=None, extLst=None, ): self.type = type self.val = val self.gte = gte
class AutonumberBullet(Serialisable): type = Set(values=(['alphaLcParenBoth', 'alphaUcParenBoth', 'alphaLcParenR', 'alphaUcParenR', 'alphaLcPeriod', 'alphaUcPeriod', 'arabicParenBoth', 'arabicParenR', 'arabicPeriod', 'arabicPlain', 'romanLcParenBoth', 'romanUcParenBoth', 'romanLcParenR', 'romanUcParenR', 'romanLcPeriod', 'romanUcPeriod', 'circleNumDbPlain', 'circleNumWdBlackPlain', 'circleNumWdWhitePlain', 'arabicDbPeriod', 'arabicDbPlain', 'ea1ChsPeriod', 'ea1ChsPlain', 'ea1ChtPeriod', 'ea1ChtPlain', 'ea1JpnChsDbPeriod', 'ea1JpnKorPlain', 'ea1JpnKorPeriod', 'arabic1Minus', 'arabic2Minus', 'hebrew2Minus', 'thaiAlphaPeriod', 'thaiAlphaParenR', 'thaiAlphaParenBoth', 'thaiNumPeriod', 'thaiNumParenR', 'thaiNumParenBoth', 'hindiAlphaPeriod', 'hindiNumPeriod', 'hindiNumParenR', 'hindiAlpha1Period'])) startAt = Integer() def __init__(self, type=None, startAt=None, ): self.type = type self.startAt = startAt
class PresetTextShape(Serialisable): prst = Typed(expected_type=Set(values=( ['textNoShape', 'textPlain','textStop', 'textTriangle', 'textTriangleInverted', 'textChevron', 'textChevronInverted', 'textRingInside', 'textRingOutside', 'textArchUp', 'textArchDown', 'textCircle', 'textButton', 'textArchUpPour', 'textArchDownPour', 'textCirclePour', 'textButtonPour', 'textCurveUp', 'textCurveDown', 'textCanUp', 'textCanDown', 'textWave1', 'textWave2', 'textDoubleWave1', 'textWave4', 'textInflate', 'textDeflate', 'textInflateBottom', 'textDeflateBottom', 'textInflateTop', 'textDeflateTop', 'textDeflateInflate', 'textDeflateInflateDeflate', 'textFadeRight', 'textFadeLeft', 'textFadeUp', 'textFadeDown', 'textSlantUp', 'textSlantDown', 'textCascadeUp', 'textCascadeDown' ] ))) avLst = Typed(expected_type=GeomGuideList, allow_none=True) def __init__(self, prst=None, avLst=None, ): self.prst = prst self.avLst = avLst
class CacheSource(Serialisable): tagname = "cacheSource" type = Set(values=(['worksheet', 'external', 'consolidation', 'scenario'])) connectionId = Integer(allow_none=True) # some elements are choice worksheetSource = Typed(expected_type=WorksheetSource, allow_none=True) consolidation = Typed(expected_type=Consolidation, allow_none=True) extLst = Typed(expected_type=ExtensionList, allow_none=True) __elements__ = ('worksheetSource', 'consolidation',) def __init__(self, type=None, connectionId=None, worksheetSource=None, consolidation=None, extLst=None, ): self.type = type self.connectionId = connectionId self.worksheetSource = worksheetSource self.consolidation = consolidation
class TileInfoProperties(Serialisable): tx = Integer(allow_none=True) ty = Integer(allow_none=True) sx = Integer(allow_none=True) sy = Integer(allow_none=True) flip = NoneSet(values=(['x', 'y', 'xy'])) algn = Set(values=(['tl', 't', 'tr', 'l', 'ctr', 'r', 'bl', 'b', 'br'])) def __init__( self, tx=None, ty=None, sx=None, sy=None, flip=None, algn=None, ): self.tx = tx self.ty = ty self.sx = sx self.sy = sy self.flip = flip self.algn = algn
class PivotFilter(Serialisable): fld = Integer() mpFld = Integer(allow_none=True) type = Set(values=([ 'unknown', 'count', 'percent', 'sum', 'captionEqual', 'captionNotEqual', 'captionBeginsWith', 'captionNotBeginsWith', 'captionEndsWith', 'captionNotEndsWith', 'captionContains', 'captionNotContains', 'captionGreaterThan', 'captionGreaterThanOrEqual', 'captionLessThan', 'captionLessThanOrEqual', 'captionBetween', 'captionNotBetween', 'valueEqual', 'valueNotEqual', 'valueGreaterThan', 'valueGreaterThanOrEqual', 'valueLessThan', 'valueLessThanOrEqual', 'valueBetween', 'valueNotBetween', 'dateEqual', 'dateNotEqual', 'dateOlderThan', 'dateOlderThanOrEqual', 'dateNewerThan', 'dateNewerThanOrEqual', 'dateBetween', 'dateNotBetween', 'tomorrow', 'today', 'yesterday', 'nextWeek', 'thisWeek', 'lastWeek', 'nextMonth', 'thisMonth', 'lastMonth', 'nextQuarter', 'thisQuarter', 'lastQuarter', 'nextYear', 'thisYear', 'lastYear', 'yearToDate', 'Q1', 'Q2', 'Q3', 'Q4', 'M1', 'M2', 'M3', 'M4', 'M5', 'M6', 'M7', 'M8', 'M9', 'M10', 'M11', 'M12' ])) evalOrder = Integer(allow_none=True) id = Integer() iMeasureHier = Integer(allow_none=True) iMeasureFld = Integer(allow_none=True) name = String(allow_none=True) description = String() stringValue1 = String() stringValue2 = String() autoFilter = Typed(expected_type=AutoFilter, ) extLst = Typed(expected_type=ExtensionList, allow_none=True) __elements__ = ('autoFilter', ) def __init__( self, fld=None, mpFld=None, type=None, evalOrder=None, id=None, iMeasureHier=None, iMeasureFld=None, name=None, description=None, stringValue1=None, stringValue2=None, autoFilter=None, extLst=None, ): self.fld = fld self.mpFld = mpFld self.type = type self.evalOrder = evalOrder self.id = id self.iMeasureHier = iMeasureHier self.iMeasureFld = iMeasureFld self.name = name self.description = description self.stringValue1 = stringValue1 self.stringValue2 = stringValue2 self.autoFilter = autoFilter self.extLst = extLst
class PivotField(Serialisable): tagname = "pivotField" items = NestedSequence(expected_type=FieldItem, count=True) autoSortScope = Typed(expected_type=AutoSortScope, allow_none=True) extLst = Typed(expected_type=ExtensionList, allow_none=True) name = String(allow_none=True) axis = NoneSet(values=(['axisRow', 'axisCol', 'axisPage', 'axisValues'])) dataField = Bool(allow_none=True) subtotalCaption = String(allow_none=True) showDropDowns = Bool(allow_none=True) hiddenLevel = Bool(allow_none=True) uniqueMemberProperty = String(allow_none=True) compact = Bool(allow_none=True) allDrilled = Bool(allow_none=True) numFmtId = Integer(allow_none=True) outline = Bool(allow_none=True) subtotalTop = Bool(allow_none=True) dragToRow = Bool(allow_none=True) dragToCol = Bool(allow_none=True) multipleItemSelectionAllowed = Bool(allow_none=True) dragToPage = Bool(allow_none=True) dragToData = Bool(allow_none=True) dragOff = Bool(allow_none=True) showAll = Bool(allow_none=True) insertBlankRow = Bool(allow_none=True) serverField = Bool(allow_none=True) insertPageBreak = Bool(allow_none=True) autoShow = Bool(allow_none=True) topAutoShow = Bool(allow_none=True) hideNewItems = Bool(allow_none=True) measureFilter = Bool(allow_none=True) includeNewItemsInFilter = Bool(allow_none=True) itemPageCount = Integer(allow_none=True) sortType = Set(values=(['manual', 'ascending', 'descending'])) dataSourceSort = Bool(allow_none=True) nonAutoSortDefault = Bool(allow_none=True) rankBy = Integer(allow_none=True) defaultSubtotal = Bool(allow_none=True) sumSubtotal = Bool(allow_none=True) countASubtotal = Bool(allow_none=True) avgSubtotal = Bool(allow_none=True) maxSubtotal = Bool(allow_none=True) minSubtotal = Bool(allow_none=True) productSubtotal = Bool(allow_none=True) countSubtotal = Bool(allow_none=True) stdDevSubtotal = Bool(allow_none=True) stdDevPSubtotal = Bool(allow_none=True) varSubtotal = Bool(allow_none=True) varPSubtotal = Bool(allow_none=True) showPropCell = Bool(allow_none=True) showPropTip = Bool(allow_none=True) showPropAsCaption = Bool(allow_none=True) defaultAttributeDrillState = Bool(allow_none=True) __elements__ = ( 'items', 'autoSortScope', ) def __init__( self, items=(), autoSortScope=None, name=None, axis=None, dataField=None, subtotalCaption=None, showDropDowns=True, hiddenLevel=None, uniqueMemberProperty=None, compact=True, allDrilled=None, numFmtId=None, outline=True, subtotalTop=True, dragToRow=True, dragToCol=True, multipleItemSelectionAllowed=None, dragToPage=True, dragToData=True, dragOff=True, showAll=True, insertBlankRow=None, serverField=None, insertPageBreak=None, autoShow=None, topAutoShow=True, hideNewItems=None, measureFilter=None, includeNewItemsInFilter=None, itemPageCount=10, sortType="manual", dataSourceSort=None, nonAutoSortDefault=None, rankBy=None, defaultSubtotal=True, sumSubtotal=None, countASubtotal=None, avgSubtotal=None, maxSubtotal=None, minSubtotal=None, productSubtotal=None, countSubtotal=None, stdDevSubtotal=None, stdDevPSubtotal=None, varSubtotal=None, varPSubtotal=None, showPropCell=None, showPropTip=None, showPropAsCaption=None, defaultAttributeDrillState=None, extLst=None, ): self.items = items self.autoSortScope = autoSortScope self.name = name self.axis = axis self.dataField = dataField self.subtotalCaption = subtotalCaption self.showDropDowns = showDropDowns self.hiddenLevel = hiddenLevel self.uniqueMemberProperty = uniqueMemberProperty self.compact = compact self.allDrilled = allDrilled self.numFmtId = numFmtId self.outline = outline self.subtotalTop = subtotalTop self.dragToRow = dragToRow self.dragToCol = dragToCol self.multipleItemSelectionAllowed = multipleItemSelectionAllowed self.dragToPage = dragToPage self.dragToData = dragToData self.dragOff = dragOff self.showAll = showAll self.insertBlankRow = insertBlankRow self.serverField = serverField self.insertPageBreak = insertPageBreak self.autoShow = autoShow self.topAutoShow = topAutoShow self.hideNewItems = hideNewItems self.measureFilter = measureFilter self.includeNewItemsInFilter = includeNewItemsInFilter self.itemPageCount = itemPageCount self.sortType = sortType self.dataSourceSort = dataSourceSort self.nonAutoSortDefault = nonAutoSortDefault self.rankBy = rankBy self.defaultSubtotal = defaultSubtotal self.sumSubtotal = sumSubtotal self.countASubtotal = countASubtotal self.avgSubtotal = avgSubtotal self.maxSubtotal = maxSubtotal self.minSubtotal = minSubtotal self.productSubtotal = productSubtotal self.countSubtotal = countSubtotal self.stdDevSubtotal = stdDevSubtotal self.stdDevPSubtotal = stdDevPSubtotal self.varSubtotal = varSubtotal self.varPSubtotal = varPSubtotal self.showPropCell = showPropCell self.showPropTip = showPropTip self.showPropAsCaption = showPropAsCaption self.defaultAttributeDrillState = defaultAttributeDrillState
class Chartsheet(_WorkbookChild, Serialisable): tagname = "chartsheet" _default_title = "Chart" _rel_type = "chartsheet" _path = "/xl/chartsheets/sheet{0}.xml" mime_type = "application/vnd.openxmlformats-officedocument.spreadsheetml.chartsheet+xml" sheetPr = Typed(expected_type=ChartsheetProperties, allow_none=True) sheetViews = Typed(expected_type=ChartsheetViewList) sheetProtection = Typed(expected_type=ChartsheetProtection, allow_none=True) customSheetViews = Typed(expected_type=CustomChartsheetViews, allow_none=True) pageMargins = Typed(expected_type=PageMargins, allow_none=True) pageSetup = Typed(expected_type=PrintPageSetup, allow_none=True) drawing = Typed(expected_type=Drawing, allow_none=True) drawingHF = Typed(expected_type=DrawingHF, allow_none=True) picture = Typed(expected_type=SheetBackgroundPicture, allow_none=True) webPublishItems = Typed(expected_type=WebPublishItems, allow_none=True) extLst = Typed(expected_type=ExtensionList, allow_none=True) sheet_state = Set(values=('visible', 'hidden', 'veryHidden')) __elements__ = ( 'sheetPr', 'sheetViews', 'sheetProtection', 'customSheetViews', 'pageMargins', 'pageSetup', 'headerFooter', 'drawing', 'drawingHF', 'picture', 'webPublishItems') __attrs__ = () def __init__(self, sheetPr=None, sheetViews=None, sheetProtection=None, customSheetViews=None, pageMargins=None, pageSetup=None, headerFooter=None, drawing=None, drawingHF=None, picture=None, webPublishItems=None, extLst=None, parent=None, title="", sheet_state='visible', ): # hack to simplify testing if parent is not None: super(Chartsheet, self).__init__(parent, title) self._charts = [] self.sheetPr = sheetPr if sheetViews is None: sheetViews = ChartsheetViewList() self.sheetViews = sheetViews self.sheetProtection = sheetProtection self.customSheetViews = customSheetViews self.pageMargins = pageMargins self.pageSetup = pageSetup self.headerFooter = headerFooter self.drawing = Drawing("rId1") self.drawingHF = drawingHF self.picture = picture self.webPublishItems = webPublishItems self.sheet_state = sheet_state def add_chart(self, chart): chart.anchor = AbsoluteAnchor() self._charts.append(chart) def to_tree(self): self._drawing = SpreadsheetDrawing() self._drawing.charts = self._charts tree = super(Chartsheet, self).to_tree() tree.set("xmlns", SHEET_MAIN_NS) return tree