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 P6XerParser 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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file xerparser-0.1.0.tar.gz.
File metadata
- Download URL: xerparser-0.1.0.tar.gz
- Upload date:
- Size: 15.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.2.2 CPython/3.10.6 Linux/5.10.16.3-microsoft-standard-WSL2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3fd0bcfba112be975b2d6f5ea86c162d21f3158e5a89a49078fa5a74773db0a5
|
|
| MD5 |
8cb0d7c8fa6c8922fa81e5517c360ec5
|
|
| BLAKE2b-256 |
1f109295a8b2b8883bc65d95cb4bcb2befa0d37df04b8d7dbd6a7423879a4525
|
File details
Details for the file xerparser-0.1.0-py3-none-any.whl.
File metadata
- Download URL: xerparser-0.1.0-py3-none-any.whl
- Upload date:
- Size: 16.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.2.2 CPython/3.10.6 Linux/5.10.16.3-microsoft-standard-WSL2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
36fe0c2a07c50e893f98da4baa4e6e332e741e36d0bb56ae39fad50edec62166
|
|
| MD5 |
5f61433bad909b7eaa45c1ba4f58e291
|
|
| BLAKE2b-256 |
e63495301e7bebc474df3876e4f890ce49d9a25da060da1d68938d76fcde8ab7
|