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.1.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 61fd1d9665f18fa8a3d79386ae756600181148dcf71770049defb8d7418ccf85 |
|
MD5 | df21e8ec3f6c4e12a1d199e36d72a363 |
|
BLAKE2b-256 | 64cd1049a053e8e37545463ec83b620527a36e2c8af422f87f4fc88ed5f85e8c |