22
33import asyncio
44import dataclasses
5+ import datetime
56import io
67import pathlib
78from collections .abc import Sequence
@@ -85,6 +86,7 @@ def __init__( # noqa: PLR0913, D107
8586 keywords : str | None = None ,
8687 category : str | None = None ,
8788 comments : str | None = None ,
89+ version : str | None = None ,
8890 comment_author : str | None = None ,
8991 styles : (
9092 list [styles_mod .ParagraphStyleDefinition | styles_mod .TableStyleDefinition ]
@@ -99,6 +101,7 @@ def __init__( # noqa: PLR0913, D107
99101 self .description = description
100102 self .keywords = keywords
101103 self .category = category
104+ self .version = version
102105 self .comments = comments
103106 self .comment_author = comment_author
104107 self .styles = styles
@@ -137,6 +140,13 @@ async def to_docx( # noqa: C901
137140 docx_doc .core_properties .keywords = self .keywords
138141 if self .category :
139142 docx_doc .core_properties .category = self .category
143+ if self .version :
144+ docx_doc .core_properties .version = self .version
145+ if self .comments :
146+ docx_doc .core_properties .comments = self .comments
147+ now = datetime .datetime .now (datetime .UTC )
148+ docx_doc .core_properties .created = now
149+ docx_doc .core_properties .modified = now
140150
141151 if self .styles :
142152 _apply_style_definitions (docx_doc , self .styles )
0 commit comments