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.
- Parses MAXQDA
.qdcfiles (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:
- Normal version: one row per code, Code Sets are stored as lists.
- Flattened version: one row per Code ↔ Set relationship, optimized for e.g. importing into databases like Baserow
- 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>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)
-
Code_GUID
-
Code_Name
-
Description
-
Parent_Code_GUID
-
Parent_Code_Name
-
CodeSet_GUIDs (list)
-
CodeSet_Names (list)
-
Code_GUID
-
Code_Name
-
Description
-
Parent_Code_GUID
-
Parent_Code_Name
-
CodeSet_GUID
-
CodeSet_Name
-
Python 3.9+
-
Dependencies:
pip install pandas openpyxlIf you only use CSV export, openpyxl is not required.
-
Export your code system from MAXQDA as REFI-QDA Codebook (
.qdcfile). -
Place the
.qdcfile in the project directory. -
Adjust the file_path variable in the script to point to your file.
-
Run the script inside a Jupyter Notebook or as a Python script.
-
The converted files will be written to the project folder.
This project is released under the MIT License.
Co-Developed with ChatGPT (GPT4o).