openpyxl.comments.comment_sheet module

class openpyxl.comments.comment_sheet.CommentRecord(ref='', authorId=0, guid=None, shapeId=0, text=None, commentPr=None, author=None, height=79, width=144)[源代码]

基类:openpyxl.descriptors.serialisable.Serialisable

author

Values must be of type <class ‘str’>

authorId

Values must be of type <class ‘int’>

commentPr

Values must be of type <class ‘openpyxl.comments.comment_sheet.Properties’>

content

Remove all inline formatting and stuff

classmethod from_cell(cell)[源代码]

Class method to convert cell comment

guid
ref

Values must be of type <class ‘str’>

shapeId

Values must be of type <class ‘int’>

tagname = 'comment'
text

Values must be of type <class ‘openpyxl.cell.text.Text’>

class openpyxl.comments.comment_sheet.CommentSheet(authors=None, commentList=None, extLst=None)[源代码]

基类:openpyxl.descriptors.serialisable.Serialisable

authors

Values must be of type <class ‘openpyxl.comments.author.AuthorList’>

commentList

Wrap a sequence in an containing object

comments

Return a dictionary of comments keyed by coord

extLst

Values must be of type <class ‘openpyxl.descriptors.excel.ExtensionList’>

classmethod from_comments(comments)[源代码]

Create a comment sheet from a list of comments for a particular worksheet

mime_type = 'application/vnd.openxmlformats-officedocument.spreadsheetml.comments+xml'
path

Return path within the archive

tagname = 'comments'
to_tree()[源代码]
write_shapes(vml=None)[源代码]

Create the VML for comments

class openpyxl.comments.comment_sheet.Properties(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)[源代码]

基类:openpyxl.descriptors.serialisable.Serialisable

altText

Values must be of type <class ‘str’>

autoFill

Values must be of type <class ‘bool’>

autoLine

Values must be of type <class ‘bool’>

autoScale

Values must be of type <class ‘bool’>

colHidden

Values must be of type <class ‘bool’>

defaultSize

Values must be of type <class ‘bool’>

disabled

Values must be of type <class ‘bool’>

justLastX

Values must be of type <class ‘bool’>

lockText

Values must be of type <class ‘bool’>

locked

Values must be of type <class ‘bool’>

rowHidden

Values must be of type <class ‘bool’>

textHAlign

Value must be one of {‘center’, ‘right’, ‘left’, ‘justify’, ‘distributed’}

textVAlign

Value must be one of {‘bottom’, ‘top’, ‘center’, ‘justify’, ‘distributed’}

uiObject

Values must be of type <class ‘bool’>

openpyxl.comments.comment_sheet.tostring(element, *, encoding='utf-8', method=None, short_empty_elements=True)

Generate string representation of XML element.

All subelements are included. If encoding is “unicode”, a string is returned. Otherwise a bytestring is returned.

element is an Element instance, encoding is an optional output encoding defaulting to US-ASCII, method is an optional output which can be one of “xml” (default), “html”, “text” or “c14n”.

Returns an (optionally) encoded string containing the XML data.