Plug in API Export - czcorpus/kontext GitHub Wiki

Plug-ins / [export]

  • type: required
  • interface: plugins.abstract.export.AbstractExport
  • client-side code: -
  • purpose: export of a concordance to a file

This is kind of a special plug-in in terms of its structure and configuration. The plug-in module itself is just a loader which loads and imports modules providing export to concrete formats (see default_csv.py, default_xlsx.py and default_xml.py).

The configuration also differs from other plug-ins. There is no module element (because the module is in fact the mentioned loader located in the exports package) and custom export modules are specified within tags named by exported formats:

<export>
  <csv>default_csv</csv>
  <xml>default_xml</xml>
  <xlsx>default_xlsx</xlsx>
  <ods>my_custom_oo_export</ods>
</export>

Currently we recommend to use default configuration and modules. But in case you want to implement a custom format please note that KonText currently does not offer automatic menu and respective page forms update based on the export element. In other words, current export formats are hardcoded in main menu and page forms.

# AbstractExport.set_corpnames(corpnames)

# AbstractExport.content_type()

# AbstractExport.raw_content()

# AbstractExport.writerow(line_num, *lang_rows)

# AbstractExport.set_col_types(*types)

# AbstractExport.writeheading(data)

⚠️ **GitHub.com Fallback** ⚠️