Skip to content

Latest commit

 

History

3 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 

Repository files navigation

MAXQDA QDC Codebook Export Converter

This repository provides a Python script to convert MAXQDA-exported QDC codebooks (REFI-QDA Codebook format, XML) into human-readable tabular formats such as Excel or CSV.
It is particularly useful if you want to extract Code Sets (which are otherwise not exportable from MAXQDA) and their relationships with codes.

Features

  • Parses MAXQDA .qdc files (REFI-QDA Codebook XML).
  • Extracts:
    • Code GUIDs and Names
    • Code Descriptions (memos/context)
    • Parent/Child hierarchy (parent GUID and name)
    • Code Set memberships (a code can belong to multiple sets)
  • Outputs two tables:
    1. Normal version: one row per code, Code Sets are stored as lists.
    2. Flattened version: one row per Code ↔ Set relationship, optimized for e.g. importing into databases like Baserow

Input

  • QDC file exported from MAXQDA (Code system > Export > REFI-QDA Codebook (.qdc)).
  • Example snippet of the XML structure:
<CodeBook xmlns="urn:QDA-XML:codebook:0:4">
  <Codes>
    <Code guid="{085e...}" name="Example Code A">
      <Description>Some description</Description>
    </Code>
  </Codes>
  <Sets>
    <Set guid="{d4c7...}" name="Example Set X">
      <MemberCode guid="{085e...}"/>
    </Set>
  </Sets>
</CodeBook>

Output

Two files are generated (choose .csv or .xlsx via the output file extension in the script):

  • code_system_export.xlsx (normal version)

  • code_system_export_flat.xlsx (flattened version, suitable for Baserow)

Columns

Normal version:

  • Code_GUID

  • Code_Name

  • Description

  • Parent_Code_GUID

  • Parent_Code_Name

  • CodeSet_GUIDs (list)

  • CodeSet_Names (list)

Flattened version:

  • Code_GUID

  • Code_Name

  • Description

  • Parent_Code_GUID

  • Parent_Code_Name

  • CodeSet_GUID

  • CodeSet_Name

Requirements

  • Python 3.9+

  • Dependencies:

pip install pandas openpyxl

If you only use CSV export, openpyxl is not required.

Usage

  1. Export your code system from MAXQDA as REFI-QDA Codebook (.qdc file).

  2. Place the .qdc file in the project directory.

  3. Adjust the file_path variable in the script to point to your file.

  4. Run the script inside a Jupyter Notebook or as a Python script.

  5. The converted files will be written to the project folder.

License

This project is released under the MIT License.

Co-Developed with ChatGPT (GPT4o).

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages