REFI-QDA projects (.qdpx from NVivo, ATLAS.ti, MAXQDA, QualCoder) as utterance × code tables
Python >=3.9 · License: MIT · API documentation · Source code
Also available for npm: @qe-libs/refi-qda
uv
uv add qe-refi-qda --index qe-libs=https://qe-libs.org/py/simple/
pip
pip install --extra-index-url https://qe-libs.org/py/simple/ qe-refi-qda
requirements.txt
--extra-index-url https://qe-libs.org/py/simple/ qe-refi-qda
Latest development build (0.1.2.9001)
pip install --extra-index-url https://qe-libs.org/py/dev/simple/ qe-refi-qda
uv add qe-refi-qda --index qe-libs-dev=https://qe-libs.org/py/dev/simple/
Development builds are built from main and served only by the
development index; the regular index installs releases.
README and API documentation for 0.1.2.9001.
Links in the wheel columns are the Python versions each wheel supports; pip and uv pick the right file automatically.
| Version | Published | Source | Wheel all platforms |
|---|---|---|---|
| 0.1.2.9001 | 2026-11-11 | .tar.gz | py3 |
| 0.1.2 | 2026-11-11 | .tar.gz | py3 |
| 0.1.1 | 2026-11-10 | .tar.gz | py3 |
| 0.1.0 | 2026-11-10 | .tar.gz | py3 |
For 0.1.2.
pandas (extra: pandas)pytest (extra: test)Reads REFI-QDA projects (.qdpx, exported by NVivo, ATLAS.ti, MAXQDA,
QualCoder and others) into the table ENA works on: one row per utterance,
a 0/1 column per code. A port of the JavaScript package
@qe-libs/refi-qda: the same functions, the same output
byte for byte, tested on the same fixtures. Pure Python, no dependencies.
pip install qe-refi-qda --extra-index-url https://qe-libs.org/py/simple/
Then import refi_qda. Releases are on qe-libs.org
(the PEP 503 index at py/simple/; dev builds of every push to main at
py/dev/simple/), published by cranqe.
from refi_qda import to_csv
r = to_csv("project.qdpx", coder="any")
r.csv # CSV text
r.fields # column names
r.rows # one list per row
r.report # counts, coders, notes, skipped sources
r.coders # the project's coders by name
to_csv and read_project take a path, bytes, a bytes-like object or an
open binary file.
coder chooses whose coding becomes the code columns, for projects coded
by more than one person (see coders_of):
coder |
Rows | A line is 1 for a code when… |
|---|---|---|
'any' (default) |
one per utterance | any coder coded it |
'all' |
one per utterance | every coder coded it |
'each' |
one per utterance per coder, with a Coder column |
that row's coder coded it |
'columns' |
one per utterance; each code once per coder, Code [Coder A] |
that column's coder coded it |
| a coder's name or GUID | one per utterance | that coder coded it |
unit="sentence" makes each sentence a row (a Sentence column follows
Line); lines="all" keeps lines without a Speaker: prefix, with the
previous speaker; min_overlap=2 ignores spans that reach two characters or
fewer into a row. They are the JS library's unit, lines and minOverlap,
with the same output. unit may also be a callable
(text, start) -> [(start, end, text)] that splits a line's text itself.
For pandas:
from refi_qda import read_project, to_table
df = to_table(read_project("project.qdpx"), coder="each").to_pandas()
| Function | Returns |
|---|---|
read_project(data) |
Project: name, users (GUID → name), codes (Code(guid, name, parent, codable, description, parent_guid)), sources (text, variables, coded spans), skipped |
coders_of(project) |
[Coder(guid, name, spans)]: who coded something, and how many coded spans |
to_table(project, coder=, unit=, lines=, min_overlap=) |
Table(fields, rows, report), with .to_pandas(); report["codebook"] is the hierarchy as [{name, parent}] per code column |
to_csv(data, coder=, unit=, lines=, min_overlap=) |
CSVResult: csv, fields, rows, report, coders, text_column |
write_csv(fields, rows) |
CSV text |
The XML inside a .qdpx is parsed with the standard library, with any
document type declaration refused: a REFI-QDA project declares no DTD or
entities, and refusing them rules out entity-expansion bombs and external
entity references from an untrusted file.
Errors are QdaErrors with a .code: not-zip, no-project, bad-xml,
no-coder, misaligned, no-sources. Their messages are written for the
person importing.
The table's columns, how lines become rows, the codebook hierarchy in
report["codebook"], and how coded positions are checked and read are
described in the main README.
cd python
pip install -e '.[test]'
pytest
The tests use ../tests/fixtures/, shared with the JavaScript tests.
The Python package releases on its own tag, apart from the npm package:
# set version = "X.Y.Z" in python/pyproject.toml, commit, then
git tag python/vX.Y.Z && git push origin python/vX.Y.Z
CI checks the tag against python/pyproject.toml, then cranqe builds the
wheel and sdist and publishes them to qe-libs.org. A bare vX.Y.Z tag
releases only the npm package.
| File | Size | SHA-256 |
|---|---|---|
| qe_refi_qda-0.1.2.9001.tar.gz | 17.5 KB | 9be53196d737a05b25cfeab64f683a454b1266aeea82ad2e6447853cfcff2e0a |
| qe_refi_qda-0.1.2.9001-py3-none-any.whl | 12.9 KB | 136d33bcab8814c9b238fec7c9cdf8f04b0735a92b0ded7812388c37dd461a6c |
| qe_refi_qda-0.1.2.tar.gz | 17.5 KB | 485f80b2fc1a8c8d0c817233764114743103344c315836cc5db0eca3635d3e8a |
| qe_refi_qda-0.1.2-py3-none-any.whl | 12.9 KB | b141c2182252f9a135d9a45be57e6c7bbf52743daa585c3f8c4c7c475b25d7ca |
| qe_refi_qda-0.1.1.tar.gz | 14.3 KB | 5433dc6f9bf1942e1abbd0b7371cd580ec3a81a81adde1384a787e63dddc0b92 |
| qe_refi_qda-0.1.1-py3-none-any.whl | 10.9 KB | 41d62ec581a296f32ef23f3e1dee3772afd95b5fd232e1e31173f62cb53425f9 |
| qe_refi_qda-0.1.0.tar.gz | 13.2 KB | 931fe47e9de97a6b5dcb89d61f5f0ec4c3de1fc0da2f63a2b03bcaf68c90e06d |
| qe_refi_qda-0.1.0-py3-none-any.whl | 10.5 KB | 8bd30375c546af1fa2dd6f4eb9c4f5c071b8eee2974be403b57f2a865a5f428c |