xerparser.model.classes.xer_table

Generic storage for XER tables that have no dedicated model class.

PyP6Xer models the commonly used P6 tables with typed classes. Every other table in an export (PROJCOST, WBSSTEP, TASKMEMO, …) used to be silently dropped on read. XerTable/XerTables preserve those records losslessly — original headers, column order and row values — and expose them with dict- and attribute-style access, so a parse followed by a write round-trips any table the library has no typed model for.

Classes

XerRecord

One %R row of a generic table.

XerTable

All records of one non-modeled XER table, in file order.

XerTables

Container for every non-modeled table in a file, in first-seen order.

Module Contents

class xerparser.model.classes.xer_table.XerRecord(table, headers, values)[source]

One %R row of a generic table.

Supports attribute access (record.task_id), mapping access (record['task_id']) and .get() — missing columns yield None so older schemas (short rows) never raise.

__getattr__(name)[source]
__getitem__(name)[source]
__contains__(name)[source]
__repr__()[source]
get(name, default=None)[source]
keys()[source]
to_dict()[source]
class xerparser.model.classes.xer_table.XerTable(name)[source]

All records of one non-modeled XER table, in file order.

Handles files where the same table appears in several blocks with different header sets (each block is preserved separately).

name[source]
add_block(headers, rows)[source]
add(headers, values)[source]
property headers[source]
property records[source]
property raw_rows[source]
__len__()[source]
__getitem__(index)[source]
__iter__()[source]
find_by_id(id)[source]

Best-effort lookup by the table’s own id column.

Uses the header that matches the table name when present (e.g. wbs_step_id for WBSSTEP), otherwise the most plausible non-foreign-key *_id column. Returns None when the table has no usable id column (e.g. TASKFDBK) or no record matches.

get_tsv()[source]

Re-emit this table exactly as parsed (%T/%F/%R blocks, in order).

class xerparser.model.classes.xer_table.XerTables[source]

Container for every non-modeled table in a file, in first-seen order.

add(table_name, headers, values)[source]
get(table_name)[source]
__getitem__(table_name)[source]
__contains__(table_name)[source]
__iter__()[source]
__len__()[source]
property table_names[source]