Welcome to Isogeo - DOCX Exporter’s documentation!¶
- Author
Isogeo
- Source code
- Issues
Updated: 2020-11-03
Indices and tables¶
Package modules¶
isogeotodocx¶
isogeotodocx package¶
This package is used to export Isogeo metadata into Excel workbooks usng the Isogeo Python SDK and DocxTpl (feat. Python Docx).
Subpackages¶
isogeotodocx.utils package¶
-
class
isogeotodocx.utils.formatter.
Formatter
(lang='FR')[source]¶ Bases:
object
Metadata formatter to avoid repeat operations on metadata during export in different formats.
- Parameters
lang (str) – selected language
-
clean_xml
(invalid_xml: str, mode: str = 'soft', substitute: str = '_')[source]¶ Clean string of XML invalid characters.
source: https://stackoverflow.com/a/13322581/2556577
- Parameters
invalid_xml (str) – xml string to clean
substitute (str) – character to use for subtistution of special chars
modeaccents (str) –
mode to apply. Available options:
soft [default]: remove chars which are not accepted in XML
strict: remove additional chars
-
conditions
(md_conditions: list) → list[source]¶ Render input metadata CGUs as a new list.
- Parameters
md_conditions (list) – input list extracted from an Isogeo metadata
- Return type
tuple(dict)
-
limitations
(md_limitations: list) → list[source]¶ Format input metadata limitations as a tuple of 2 tuples of dictionaries, ready to be exported: one with limitations related to INSPIRE, one with other limitations.
- Parameters
md_limitations (list) – input list of metadata limitations
- Return type
tuple(tuple(dict), tuple(dict))
Submodules¶
isogeotodocx.isogeo2docx module¶
Get metadatas from Isogeo and dump each into a Word document.
-
class
isogeotodocx.isogeo2docx.
Isogeo2docx
(lang='FR', thumbnails: dict = None, url_base_edit: str = 'https://app.isogeo.com', url_base_view: str = 'https://open.isogeo.com')[source]¶ Bases:
object
IsogeoToDocx class.
- Parameters
lang (str) – selected language for output
thumbnails (dict) – dictionary of metadatas associated to an image path
url_base_edit (str) – base url to format edit links (basically app.isogeo.com)
url_base_view (str) – base url to format view links (basically open.isogeo.com)
-
md2docx
(docx_template: docxtpl.DocxTemplate, md: isogeo_pysdk.models.metadata.Metadata, share: isogeo_pysdk.models.share.Share = None)[source]¶ Dump Isogeo metadata into a docx template.
- Parameters
docx_template (DocxTemplate) – Word template to fill
metadata (Metadata) – metadata to dumpinto the template
share (Share) – share in which the metadata is. Used to build the view URL.