Skip to content

Const

Constants, XML tags and ODF headers.

Attributes:

Name Type Description
BODY_ALLOW_NAMED_RANGE_TAGS
FOLDER
ODF_CHART
ODF_CHART_TEMPLATE
ODF_CLASSES
ODF_COLOR_PROPERTY
ODF_CONTENT
ODF_DRAWING
ODF_DRAWING_TEMPLATE
ODF_EXTENSIONS
ODF_FLAT_EXTENSIONS
ODF_FORMULA
ODF_FORMULA_TEMPLATE
ODF_IMAGE
ODF_IMAGE_TEMPLATE
ODF_MANIFEST
ODF_MANIFEST_NAME
ODF_MANIFEST_RDF
ODF_MANIFEST_RDF_TYPE
ODF_MASTER
ODF_META
ODF_MIMETYPES
ODF_MIMETYPE_TO_FLAT_EXTENSION
ODF_PARTS
ODF_PRESENTATION
ODF_PRESENTATION_TEMPLATE
ODF_PROPERTIES
ODF_SETTINGS
ODF_SPREADSHEET
ODF_SPREADSHEET_TEMPLATE
ODF_STYLES
ODF_TEMPLATES
ODF_TEXT
ODF_TEXT_TEMPLATE
ODF_WEB
OFFICE_PREFIX
OFFICE_VERSION
PACKAGING
USE_LO_EXTENSIONS
XML
ZIP

BODY_ALLOW_NAMED_RANGE_TAGS module-attribute

BODY_ALLOW_NAMED_RANGE_TAGS = {
    "office:chart",
    "office:database",
    "office:drawing",
    "office:image",
    "office:presentation",
    "office:spreadsheet",
    "office:text",
}

FOLDER module-attribute

FOLDER = 'folder'

ODF_CHART module-attribute

ODF_CHART = 'application/vnd.oasis.opendocument.chart'

ODF_CHART_TEMPLATE module-attribute

ODF_CHART_TEMPLATE = (
    "application/vnd.oasis.opendocument.chart-template"
)

ODF_CLASSES module-attribute

ODF_CLASSES = (
    "title",
    "outline",
    "subtitle",
    "text",
    "graphic",
    "object",
    "chart",
    "table",
    "orgchart",
    "page",
    "notes",
    "handout",
)

ODF_COLOR_PROPERTY module-attribute

ODF_COLOR_PROPERTY = {
    "dr3d:ambient-color",
    "dr3d:diffuse-color",
    "dr3d:emissive-color",
    "dr3d:specular-color",
    "draw:fill-color",
    "draw:secondary-fill-color",
    "draw:shadow-color",
    "fo:background-color",
    "fo:color",
    "smil:fadeColor",
    "style:layout-grid-color",
    "style:text-line-through-color",
    "style:text-overline-color",
    "style:text-underline-color",
    "svg:stroke-color",
}

ODF_CONTENT module-attribute

ODF_CONTENT = 'content.xml'

ODF_DRAWING module-attribute

ODF_DRAWING = 'application/vnd.oasis.opendocument.graphics'

ODF_DRAWING_TEMPLATE module-attribute

ODF_DRAWING_TEMPLATE = (
    "application/vnd.oasis.opendocument.graphics-template"
)

ODF_EXTENSIONS module-attribute

ODF_EXTENSIONS = {
    "odt": ODF_TEXT,
    "ott": ODF_TEXT_TEMPLATE,
    "ods": ODF_SPREADSHEET,
    "ots": ODF_SPREADSHEET_TEMPLATE,
    "odp": ODF_PRESENTATION,
    "otp": ODF_PRESENTATION_TEMPLATE,
    "odg": ODF_DRAWING,
    "otg": ODF_DRAWING_TEMPLATE,
    "odc": ODF_CHART,
    "otc": ODF_CHART_TEMPLATE,
    "odi": ODF_IMAGE,
    "oti": ODF_IMAGE_TEMPLATE,
    "odf": ODF_FORMULA,
    "otf": ODF_FORMULA_TEMPLATE,
    "odm": ODF_MASTER,
    "oth": ODF_WEB,
}

ODF_FLAT_EXTENSIONS module-attribute

ODF_FLAT_EXTENSIONS = {
    ".fodt",
    ".fods",
    ".fodp",
    ".fodg",
    ".fodc",
    ".fodi",
    ".fodf",
}

ODF_FORMULA module-attribute

ODF_FORMULA = 'application/vnd.oasis.opendocument.formula'

ODF_FORMULA_TEMPLATE module-attribute

ODF_FORMULA_TEMPLATE = (
    "application/vnd.oasis.opendocument.formula-template"
)

ODF_IMAGE module-attribute

ODF_IMAGE = 'application/vnd.oasis.opendocument.image'

ODF_IMAGE_TEMPLATE module-attribute

ODF_IMAGE_TEMPLATE = (
    "application/vnd.oasis.opendocument.image-template"
)

ODF_MANIFEST module-attribute

ODF_MANIFEST = 'META-INF/manifest.xml'

ODF_MANIFEST_NAME module-attribute

ODF_MANIFEST_NAME = 'manifest.xml'

ODF_MANIFEST_RDF module-attribute

ODF_MANIFEST_RDF = 'manifest.rdf'

ODF_MANIFEST_RDF_TYPE module-attribute

ODF_MANIFEST_RDF_TYPE = 'application/rdf+xml'

ODF_MASTER module-attribute

ODF_MASTER = (
    "application/vnd.oasis.opendocument.text-master"
)

ODF_META module-attribute

ODF_META = 'meta.xml'

ODF_MIMETYPES module-attribute

ODF_MIMETYPES = {
    ODF_TEXT: "odt",
    ODF_TEXT_TEMPLATE: "ott",
    ODF_SPREADSHEET: "ods",
    ODF_SPREADSHEET_TEMPLATE: "ots",
    ODF_PRESENTATION: "odp",
    ODF_PRESENTATION_TEMPLATE: "otp",
    ODF_DRAWING: "odg",
    ODF_DRAWING_TEMPLATE: "otg",
    ODF_CHART: "odc",
    ODF_CHART_TEMPLATE: "otc",
    ODF_IMAGE: "odi",
    ODF_IMAGE_TEMPLATE: "oti",
    ODF_FORMULA: "odf",
    ODF_FORMULA_TEMPLATE: "otf",
    ODF_MASTER: "odm",
    ODF_WEB: "oth",
}

ODF_MIMETYPE_TO_FLAT_EXTENSION module-attribute

ODF_MIMETYPE_TO_FLAT_EXTENSION = {
    ODF_TEXT: ".fodt",
    ODF_SPREADSHEET: ".fods",
    ODF_PRESENTATION: ".fodp",
    ODF_DRAWING: ".fodg",
    ODF_CHART: ".fodc",
    ODF_IMAGE: ".fodi",
    ODF_FORMULA: ".fodf",
}

ODF_PARTS module-attribute

ODF_PARTS = (
    "content",
    "meta",
    "settings",
    "styles",
    "manifest",
)

ODF_PRESENTATION module-attribute

ODF_PRESENTATION = (
    "application/vnd.oasis.opendocument.presentation"
)

ODF_PRESENTATION_TEMPLATE module-attribute

ODF_PRESENTATION_TEMPLATE = "application/vnd.oasis.opendocument.presentation-template"

ODF_PROPERTIES module-attribute

ODF_PROPERTIES = {
    "chart:angle-offset",
    "chart:auto-position",
    "chart:auto-size",
    "chart:automatic-content",
    "chart:axis-label-position",
    "chart:axis-position",
    "chart:connect-bars",
    "chart:data-label-number",
    "chart:data-label-symbol",
    "chart:data-label-text",
    "chart:deep",
    "chart:display-equation",
    "chart:display-label",
    "chart:display-r-square",
    "chart:error-category",
    "chart:error-lower-indicator",
    "chart:error-lower-limit",
    "chart:error-lower-range",
    "chart:error-margin",
    "chart:error-percentage",
    "chart:error-upper-indicator",
    "chart:error-upper-limit",
    "chart:error-upper-range",
    "chart:gap-width",
    "chart:group-bars-per-axis",
    "chart:hole-size",
    "chart:include-hidden-cells",
    "chart:interpolation",
    "chart:interval-major",
    "chart:interval-minor-divisor",
    "chart:japanese-candle-stick",
    "chart:label-arrangement",
    "chart:label-position",
    "chart:label-position-negative",
    "chart:lines",
    "chart:link-data-style-to-source",
    "chart:logarithmic",
    "chart:maximum",
    "chart:mean-value",
    "chart:minimum",
    "chart:origin",
    "chart:overlap",
    "chart:percentage",
    "chart:pie-offset",
    "chart:regression-type",
    "chart:reverse-direction",
    "chart:right-angled-axes",
    "chart:scale-text",
    "chart:series-source",
    "chart:solid-type",
    "chart:sort-by-x-values",
    "chart:spline-order",
    "chart:spline-resolution",
    "chart:stacked",
    "chart:symbol-height",
    "chart:symbol-name",
    "chart:symbol-type",
    "chart:symbol-width",
    "chart:text-overlap",
    "chart:three-dimensional",
    "chart:tick-mark-position",
    "chart:tick-marks-major-inner",
    "chart:tick-marks-major-outer",
    "chart:tick-marks-minor-inner",
    "chart:tick-marks-minor-outer",
    "chart:treat-empty-cells",
    "chart:vertical",
    "chart:visible",
    "db:additional-column-statement",
    "db:append-table-alias-name",
    "db:apply-command",
    "db:as-template",
    "db:base-dn",
    "db:boolean-comparison-mode",
    "db:catalog-name",
    "db:command",
    "db:data-source-setting-is-list",
    "db:data-source-setting-name",
    "db:data-source-setting-type",
    "db:data-type",
    "db:database-name",
    "db:decimal",
    "db:default-cell-style-name",
    "db:default-row-style-name",
    "db:delete-rule",
    "db:description",
    "db:enable-sql92-check",
    "db:encoding",
    "db:escape-processing",
    "db:extension",
    "db:field",
    "db:hostname",
    "db:ignore-driver-privileges",
    "db:is-ascending",
    "db:is-autoincrement",
    "db:is-clustered",
    "db:is-empty-allowed",
    "db:is-first-row-header-line",
    "db:is-nullable",
    "db:is-password-required",
    "db:is-table-name-length-limited",
    "db:is-unique",
    "db:local-socket",
    "db:login-timeout",
    "db:max-row-count",
    "db:media-type",
    "db:name",
    "db:parameter-name-substitution",
    "db:port",
    "db:precision",
    "db:referenced-table-name",
    "db:related-column-name",
    "db:row-retrieving-statement",
    "db:scale",
    "db:schema-name",
    "db:show-deleted",
    "db:string",
    "db:style-name",
    "db:suppress-version-columns",
    "db:system-driver-settings",
    "db:thousand",
    "db:title",
    "db:type",
    "db:type-name",
    "db:update-rule",
    "db:use-catalog",
    "db:use-system-user",
    "db:user-name",
    "db:visible",
    "dr3d:ambient-color",
    "dr3d:back-scale",
    "dr3d:backface-culling",
    "dr3d:close-back",
    "dr3d:close-front",
    "dr3d:depth",
    "dr3d:diffuse-color",
    "dr3d:edge-rounding",
    "dr3d:edge-rounding-mode",
    "dr3d:emissive-color",
    "dr3d:end-angle",
    "dr3d:horizontal-segments",
    "dr3d:lighting-mode",
    "dr3d:normals-direction",
    "dr3d:normals-kind",
    "dr3d:shadow",
    "dr3d:shininess",
    "dr3d:specular-color",
    "dr3d:texture-filter",
    "dr3d:texture-generation-mode-x",
    "dr3d:texture-generation-mode-y",
    "dr3d:texture-kind",
    "dr3d:texture-mode",
    "dr3d:vertical-segments",
    "draw:auto-grow-height",
    "draw:auto-grow-width",
    "draw:background-size",
    "draw:blue",
    "draw:caption-angle",
    "draw:caption-angle-type",
    "draw:caption-escape",
    "draw:caption-escape-direction",
    "draw:caption-fit-line-length",
    "draw:caption-gap",
    "draw:caption-line-length",
    "draw:caption-type",
    "draw:color-inversion",
    "draw:color-mode",
    "draw:contrast",
    "draw:decimal-places",
    "draw:display-name",
    "draw:draw-aspect",
    "draw:end-guide",
    "draw:end-line-spacing-horizontal",
    "draw:end-line-spacing-vertical",
    "draw:escape-direction",
    "draw:fill",
    "draw:fill-color",
    "draw:fill-gradient-name",
    "draw:fill-hatch-name",
    "draw:fill-hatch-solid",
    "draw:fill-image-height",
    "draw:fill-image-name",
    "draw:fill-image-ref-point",
    "draw:fill-image-ref-point-x",
    "draw:fill-image-ref-point-y",
    "draw:fill-image-width",
    "draw:fit-to-contour",
    "draw:fit-to-size",
    "draw:frame-display-border",
    "draw:frame-display-scrollbar",
    "draw:frame-margin-horizontal",
    "draw:frame-margin-vertical",
    "draw:gamma",
    "draw:gradient-step-count",
    "draw:green",
    "draw:guide-distance",
    "draw:guide-overhang",
    "draw:id",
    "draw:image-opacity",
    "draw:line-distance",
    "draw:luminance",
    "draw:marker-end",
    "draw:marker-end-center",
    "draw:marker-end-width",
    "draw:marker-start",
    "draw:marker-start-center",
    "draw:marker-start-width",
    "draw:measure-align",
    "draw:measure-vertical-align",
    "draw:name",
    "draw:ole-draw-aspect",
    "draw:opacity",
    "draw:opacity-name",
    "draw:parallel",
    "draw:placing",
    "draw:red",
    "draw:secondary-fill-color",
    "draw:shadow",
    "draw:shadow-color",
    "draw:shadow-offset-x",
    "draw:shadow-offset-y",
    "draw:shadow-opacity",
    "draw:show-unit",
    "draw:start-guide",
    "draw:start-line-spacing-horizontal",
    "draw:start-line-spacing-vertical",
    "draw:stroke",
    "draw:stroke-dash",
    "draw:stroke-dash-names",
    "draw:stroke-linejoin",
    "draw:symbol-color",
    "draw:textarea-horizontal-align",
    "draw:textarea-vertical-align",
    "draw:tile-repeat-offset",
    "draw:unit",
    "draw:visible-area-height",
    "draw:visible-area-left",
    "draw:visible-area-top",
    "draw:visible-area-width",
    "draw:wrap-influence-on-position",
    "fo:background-color",
    "fo:border",
    "fo:border-bottom",
    "fo:border-left",
    "fo:border-right",
    "fo:border-top",
    "fo:break-after",
    "fo:break-before",
    "fo:clip",
    "fo:color",
    "fo:country",
    "fo:font-family",
    "fo:font-size",
    "fo:font-style",
    "fo:font-variant",
    "fo:font-weight",
    "fo:height",
    "fo:hyphenate",
    "fo:hyphenation-keep",
    "fo:hyphenation-ladder-count",
    "fo:hyphenation-push-char-count",
    "fo:hyphenation-remain-char-count",
    "fo:keep-together",
    "fo:keep-with-next",
    "fo:language",
    "fo:letter-spacing",
    "fo:line-height",
    "fo:margin",
    "fo:margin-bottom",
    "fo:margin-left",
    "fo:margin-right",
    "fo:margin-top",
    "fo:max-height",
    "fo:max-width",
    "fo:min-height",
    "fo:min-width",
    "fo:orphans",
    "fo:padding",
    "fo:padding-bottom",
    "fo:padding-left",
    "fo:padding-right",
    "fo:padding-top",
    "fo:page-height",
    "fo:page-width",
    "fo:script",
    "fo:text-align",
    "fo:text-align-last",
    "fo:text-indent",
    "fo:text-shadow",
    "fo:text-transform",
    "fo:widows",
    "fo:width",
    "fo:wrap-option",
    "form:allow-deletes",
    "form:allow-inserts",
    "form:allow-updates",
    "form:apply-filter",
    "form:command",
    "form:command-type",
    "form:control-implementation",
    "form:datasource",
    "form:detail-fields",
    "form:enctype",
    "form:filter",
    "form:id",
    "form:ignore-result",
    "form:label",
    "form:linked-cell",
    "form:list-linkage-type",
    "form:master-fields",
    "form:method",
    "form:name",
    "form:navigation-mode",
    "form:order",
    "form:property-name",
    "form:repeat",
    "form:source-cell-range",
    "form:spin-button",
    "form:tabcycle",
    "form:value",
    "form:xforms-list-source",
    "form:xforms-submission",
    "grddl:transformation",
    "number:rfc-language-tag",
    "number:script",
    "presentation:background-objects-visible",
    "presentation:background-visible",
    "presentation:display-date-time",
    "presentation:display-footer",
    "presentation:display-header",
    "presentation:display-page-number",
    "presentation:duration",
    "presentation:transition-speed",
    "presentation:transition-style",
    "presentation:transition-type",
    "presentation:visibility",
    "smil:direction",
    "smil:fadeColor",
    "smil:subtype",
    "smil:type",
    "style:auto-text-indent",
    "style:background-transparency",
    "style:border-line-width",
    "style:border-line-width-bottom",
    "style:border-line-width-left",
    "style:border-line-width-right",
    "style:border-line-width-top",
    "style:cell-protect",
    "style:column-width",
    "style:country-asian",
    "style:country-complex",
    "style:decimal-places",
    "style:diagonal-bl-tr",
    "style:diagonal-bl-tr-widths",
    "style:diagonal-tl-br",
    "style:diagonal-tl-br-widths",
    "style:direction",
    "style:display-name",
    "style:dynamic-spacing",
    "style:editable",
    "style:first-page-number",
    "style:flow-with-text",
    "style:font-charset",
    "style:font-charset-asian",
    "style:font-charset-complex",
    "style:font-family-asian",
    "style:font-family-complex",
    "style:font-family-generic",
    "style:font-family-generic-asian",
    "style:font-family-generic-complex",
    "style:font-independent-line-spacing",
    "style:font-name",
    "style:font-name-asian",
    "style:font-name-complex",
    "style:font-pitch",
    "style:font-pitch-asian",
    "style:font-pitch-complex",
    "style:font-relief",
    "style:font-size-asian",
    "style:font-size-complex",
    "style:font-size-rel",
    "style:font-size-rel-asian",
    "style:font-size-rel-complex",
    "style:font-style-asian",
    "style:font-style-complex",
    "style:font-style-name",
    "style:font-style-name-asian",
    "style:font-style-name-complex",
    "style:font-weight-asian",
    "style:font-weight-complex",
    "style:footnote-max-height",
    "style:glyph-orientation-vertical",
    "style:horizontal-pos",
    "style:horizontal-rel",
    "style:join-border",
    "style:justify-single-word",
    "style:language-asian",
    "style:language-complex",
    "style:layout-grid-base-height",
    "style:layout-grid-base-width",
    "style:layout-grid-color",
    "style:layout-grid-display",
    "style:layout-grid-lines",
    "style:layout-grid-mode",
    "style:layout-grid-print",
    "style:layout-grid-ruby-below",
    "style:layout-grid-ruby-height",
    "style:layout-grid-snap-to",
    "style:layout-grid-standard-mode",
    "style:letter-kerning",
    "style:line-break",
    "style:line-height-at-least",
    "style:line-spacing",
    "style:list-level",
    "style:master-page-name",
    "style:may-break-between-rows",
    "style:min-row-height",
    "style:mirror",
    "style:name",
    "style:num-format",
    "style:num-letter-sync",
    "style:num-prefix",
    "style:num-suffix",
    "style:number-wrapped-paragraphs",
    "style:overflow-behavior",
    "style:page-layout-name",
    "style:page-number",
    "style:paper-tray-name",
    "style:percentage-data-style-name",
    "style:print",
    "style:print-content",
    "style:print-orientation",
    "style:print-page-order",
    "style:protect",
    "style:punctuation-wrap",
    "style:register-true",
    "style:register-truth-ref-style-name",
    "style:rel-column-width",
    "style:rel-height",
    "style:rel-width",
    "style:repeat",
    "style:repeat-content",
    "style:rfc-language-tag",
    "style:rfc-language-tag-asian",
    "style:rfc-language-tag-complex",
    "style:rotation-align",
    "style:rotation-angle",
    "style:row-height",
    "style:ruby-align",
    "style:ruby-position",
    "style:run-through",
    "style:scale-to",
    "style:scale-to-pages",
    "style:script-asian",
    "style:script-complex",
    "style:script-type",
    "style:shadow",
    "style:shrink-to-fit",
    "style:snap-to-layout-grid",
    "style:tab-stop-distance",
    "style:table-centering",
    "style:text-align-source",
    "style:text-autospace",
    "style:text-blinking",
    "style:text-combine",
    "style:text-combine-end-char",
    "style:text-combine-start-char",
    "style:text-emphasize",
    "style:text-line-through-color",
    "style:text-line-through-mode",
    "style:text-line-through-style",
    "style:text-line-through-text",
    "style:text-line-through-text-style",
    "style:text-line-through-type",
    "style:text-line-through-width",
    "style:text-outline",
    "style:text-overline-color",
    "style:text-overline-mode",
    "style:text-overline-style",
    "style:text-overline-type",
    "style:text-overline-width",
    "style:text-position",
    "style:text-rotation-angle",
    "style:text-rotation-scale",
    "style:text-scale",
    "style:text-underline-color",
    "style:text-underline-mode",
    "style:text-underline-style",
    "style:text-underline-type",
    "style:text-underline-width",
    "style:use-optimal-column-width",
    "style:use-optimal-row-height",
    "style:use-window-font-color",
    "style:vertical-align",
    "style:vertical-pos",
    "style:vertical-rel",
    "style:width",
    "style:wrap",
    "style:wrap-contour",
    "style:wrap-contour-mode",
    "style:wrap-dynamic-threshold",
    "style:writing-mode",
    "style:writing-mode-automatic",
    "svg:fill-rule",
    "svg:height",
    "svg:stroke-color",
    "svg:stroke-linecap",
    "svg:stroke-opacity",
    "svg:stroke-width",
    "svg:width",
    "svg:x",
    "svg:y",
    "table:align",
    "table:border-model",
    "table:display",
    "table:embedded-number-behavior",
    "table:first-row-end-column",
    "table:first-row-start-column",
    "table:last-row-end-column",
    "table:last-row-start-column",
    "table:paragraph-style-name",
    "table:protection-key-digest-algorithm",
    "table:rfc-language-tag",
    "table:script",
    "table:template-name",
    "table:use-banding-columns-styles",
    "table:use-banding-rows-styles",
    "table:use-first-column-styles",
    "table:use-first-row-styles",
    "table:use-last-column-styles",
    "table:use-last-row-styles",
    "table:use-wildcards",
    "text:anchor-page-number",
    "text:anchor-type",
    "text:animation",
    "text:animation-delay",
    "text:animation-direction",
    "text:animation-repeat",
    "text:animation-start-inside",
    "text:animation-steps",
    "text:animation-stop-inside",
    "text:condition",
    "text:continue-list",
    "text:display",
    "text:dont-balance-text-columns",
    "text:id",
    "text:label-followed-by",
    "text:label",
    "text:line-break",
    "text:line-number",
    "text:list-id",
    "text:list-level-position-and-space-mode",
    "text:list-tab-stop-position",
    "text:min-label-distance",
    "text:min-label-width",
    "text:name",
    "text:number-lines",
    "text:protection-key-digest-algorithm",
    "text:space-before",
    "text:style-name",
    "text:style-override",
    "xforms:bind",
    "xhtml:about",
    "xhtml:content",
    "xhtml:datatype",
    "xhtml:property",
    "xml:id",
}

ODF_SETTINGS module-attribute

ODF_SETTINGS = 'settings.xml'

ODF_SPREADSHEET module-attribute

ODF_SPREADSHEET = (
    "application/vnd.oasis.opendocument.spreadsheet"
)

ODF_SPREADSHEET_TEMPLATE module-attribute

ODF_SPREADSHEET_TEMPLATE = "application/vnd.oasis.opendocument.spreadsheet-template"

ODF_STYLES module-attribute

ODF_STYLES = 'styles.xml'

ODF_TEMPLATES module-attribute

ODF_TEMPLATES = {
    "text": "text.ott",
    "texte": "text.ott",
    "odt": "text.ott",
    "spreadsheet": "spreadsheet.ots",
    "tableur": "spreadsheet.ots",
    "ods": "spreadsheet.ots",
    "presentation": "presentation.otp",
    "odp": "presentation.otp",
    "drawing": "drawing.otg",
    "odg": "drawing.otg",
    "graphics": "drawing.otg",
    "graphic": "drawing.otg",
}

ODF_TEXT module-attribute

ODF_TEXT = 'application/vnd.oasis.opendocument.text'

ODF_TEXT_TEMPLATE module-attribute

ODF_TEXT_TEMPLATE = (
    "application/vnd.oasis.opendocument.text-template"
)

ODF_WEB module-attribute

ODF_WEB = 'application/vnd.oasis.opendocument.text-web'

OFFICE_PREFIX module-attribute

OFFICE_PREFIX = _generate_office_prefix()

OFFICE_VERSION module-attribute

OFFICE_VERSION = '1.2'

PACKAGING module-attribute

PACKAGING = {FOLDER, XML, ZIP}

USE_LO_EXTENSIONS module-attribute

USE_LO_EXTENSIONS = True

XML module-attribute

XML = 'xml'

ZIP module-attribute

ZIP = 'zip'

_OFFICE_PREFIX_CORE module-attribute

_OFFICE_PREFIX_CORE = [
    b'<?xml version="1.0" encoding="UTF-8"?>',
    b"<office:document",
    b'  xmlns:office="urn:oasis:names:tc:opendocument:xmlns:office:1.0"',
    b'  xmlns:style="urn:oasis:names:tc:opendocument:xmlns:style:1.0"',
    b'  xmlns:text="urn:oasis:names:tc:opendocument:xmlns:text:1.0"',
    b'  xmlns:table="urn:oasis:names:tc:opendocument:xmlns:table:1.0"',
    b'  xmlns:draw="urn:oasis:names:tc:opendocument:xmlns:drawing:1.0"',
    b'  xmlns:fo="urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0"',
    b'  xmlns:xlink="http://www.w3.org/1999/xlink"',
    b'  xmlns:dc="http://purl.org/dc/elements/1.1/"',
    b'  xmlns:meta="urn:oasis:names:tc:opendocument:xmlns:meta:1.0"',
    b'  xmlns:number="urn:oasis:names:tc:opendocument:xmlns:datastyle:1.0"',
    b'  xmlns:presentation="urn:oasis:names:tc:opendocument:xmlns:presentation:1.0"',
    b'  xmlns:svg="urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0"',
    b'  xmlns:chart="urn:oasis:names:tc:opendocument:xmlns:chart:1.0"',
    b'  xmlns:dr3d="urn:oasis:names:tc:opendocument:xmlns:dr3d:1.0"',
    b'  xmlns:math="http://www.w3.org/1998/Math/MathML"',
    b'  xmlns:form="urn:oasis:names:tc:opendocument:xmlns:form:1.0"',
    b'  xmlns:script="urn:oasis:names:tc:opendocument:xmlns:script:1.0"',
    b'  xmlns:xforms="http://www.w3.org/2002/xforms"',
    b'  xmlns:xsd="http://www.w3.org/2001/XMLSchema"',
    b'  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"',
    b'  xmlns:anim="urn:oasis:names:tc:opendocument:xmlns:animation:1.0"',
    b'  xmlns:smil="urn:oasis:names:tc:opendocument:xmlns:smil-compatible:1.0"',
    b'  xmlns:of="urn:oasis:names:tc:opendocument:xmlns:of:1.2"',
    b'  xmlns:xhtml="http://www.w3.org/1999/xhtml"',
    b'  xmlns:grddl="http://www.w3.org/2003/g/data-view#"',
    b'  xmlns:config="urn:oasis:names:tc:opendocument:xmlns:config:1.0"',
    b'  xmlns:dom="http://www.w3.org/2001/xml-events"',
    b'  xmlns:manifest="urn:oasis:names:tc:opendocument:xmlns:manifest:1.0"',
    b'  xmlns:rdfa="http://docs.oasis-open.org/opendocument/meta/rdfa#"',
    b'  xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"',
    b'  xmlns:pkg="http://docs.oasis-open.org/ns/office/1.2/meta/pkg#"',
    b'  xmlns:dsig="urn:oasis:names:tc:opendocument:xmlns:digitalsignature:1.0"',
]

_OFFICE_PREFIX_EXTENSIONS module-attribute

_OFFICE_PREFIX_EXTENSIONS = [
    b'  xmlns:ooo="http://openoffice.org/2004/office"',
    b'  xmlns:oooc="http://openoffice.org/2004/calc"',
    b'  xmlns:ooow="http://openoffice.org/2004/writer"',
    b'  xmlns:officeooo="http://openoffice.org/2009/office"',
    b'  xmlns:tableooo="http://openoffice.org/2009/table"',
    b'  xmlns:drawooo="http://openoffice.org/2010/draw"',
    b'  xmlns:calcext="urn:org:documentfoundation:names:experimental:calc:xmlns:calcext:1.0"',
    b'  xmlns:loext="urn:org:documentfoundation:names:experimental:office:xmlns:loext:1.0"',
    b'  xmlns:field="urn:openoffice:names:experimental:ooo-ms-interop:xmlns:field:1.0"',
    b'  xmlns:formx="urn:openoffice:names:experimental:ooxml-odf-interop:xmlns:form:1.0"',
    b'  xmlns:css3t="http://www.w3.org/TR/css3-text/"',
    b'  xmlns:rpt="http://openoffice.org/2005/report"',
    b'  xmlns:presentationooo="http://openoffice.org/2012/presentation"',
    b'  xmlns:formooo="http://openoffice.org/2011/form"',
    b'  xmlns:chartooo="http://openoffice.org/2010/chart"',
]

_OFFICE_PREFIX_EXTENSIONS_NAMES module-attribute

_OFFICE_PREFIX_EXTENSIONS_NAMES = {
    (decode()) for line in _OFFICE_PREFIX_EXTENSIONS
}

_generate_office_prefix

_generate_office_prefix() -> bytes
Source code in odfdo/const.py
210
211
212
213
214
def _generate_office_prefix() -> bytes:
    lines = _OFFICE_PREFIX_CORE[:]
    if USE_LO_EXTENSIONS:
        lines.extend(_OFFICE_PREFIX_EXTENSIONS)
    return b"\n".join(lines) + b" "