Parse a P6 .xer file to a Python dictionary object.
Project description
xerparser
xerparser
reads a P6 .xer file and converts it into a Python dictionary object containing key, value pairs:
-
"version": Version of P6 the .xer file was exported as.
-
"export_date": Date the .xer file was exported from P6 (datetime object).
-
"errors": A list of potential errors in the .xer file based on common issues encountered when analyzing .xer files:
- Minimum required tables for a valid P6 schedule are:
- CALENDAR
- PROJECT
- PROJWBS
- TASK
- TASKPRED
- Required table pairs are:
- TASKFIN <> FINDATES : (Financial Period Data)
- TRSRCFIN <> FINDATES (Financial Period Data)
- TASKRSRC <> RSRC (Resource Data)
- TASKMEMO <> MEMOTYPE (Notebook Data)
- ACTVCODE <> ACTVTYPE (Activity Code Data)
- TASKACTV <> ACTVCODE (Activity Code Data)
- Non-existent calendars assigned to activities.
- Minimum required tables for a valid P6 schedule are:
-
"tables": Dictionay of each table included in the .xer file.
Examples: PROJECT, PROJWBS, CALENDAR, TASK, TASKPRED, etc... See Oracle Documentation for mapping and schema of P6 database tables.
The table name (e.g TASK) is the key, and the value is a list of the table entries, which can be accessed the same as any Python dictionary object:xer["tables"]["TASK"]
or
xer["tables"].get("TASK")Each table entry is a dictionary object where the key is the field name (e.g. task_id, task_code, and task_name) from the table schema.
for task in xer["tables"].get["TASK", []]:
print(task["task_code"], task["task_name"])
Example Code
from xerparser import xer_to_dict
xer = xer_to_dict("path to file.xer")
xer["version"] # -> 15.2
xer["export_date"] # -> datetime.datetime(2022, 11, 30, 0, 0)
xer["errors"] # -> [ ]xer["tables"].get("TASK") # -> [{"task_id": 12345, ...}, {"task_id": 12346,...}]
len(xer["tables"].get("TASK",[])) # -> 950
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for xerparser-0.2.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | bef8cd685d45de70b181438a743282af446a09b072b5b6e9fdbea821c0113662 |
|
MD5 | d05174b4e79dab977b301dd476b6f0c2 |
|
BLAKE2b-256 | 2790c34fc7df7ee33b15910f3fffaa076b2d94a174d2b5de4452412106db30f3 |