You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Read the contents of a Primavera P6 XER file using Python.
3
+
Read the contents of a Primavera P6 XER file using Python.
4
4
5
5
Xer-Reader makes it easy to read, parse, and convert the data in a XER file to other formats.
6
6
7
-
*Refer to the [Oracle Documentation](https://docs.oracle.com/cd/F25600_01/English/Mapping_and_Schema/xer_import_export_data_map_project/index.htm) for more information regarding how data is mapped to the XER format.
8
-
Tested on XER files exported as versions 15.2 through 19.12.*
7
+
_Refer to the [Oracle Documentation](https://docs.oracle.com/cd/F25600_01/English/Mapping_and_Schema/xer_import_export_data_map_project/index.htm) for more information regarding how data is mapped to the XER format.
8
+
Tested on XER files exported as versions 15.2 through 19.12._
9
9
10
10
## Install
11
11
@@ -21,9 +21,10 @@ pip install xer-reader
21
21
pip3 install xer-reader
22
22
```
23
23
24
-
## Usage
24
+
## Usage
25
25
26
26
Import the `XerReader` class from `xer_reader`.
27
+
27
28
```python
28
29
from xer_reader import XerReader
29
30
```
@@ -35,59 +36,60 @@ file = r"/path/to/file.xer"
35
36
reader = XerReader(file)
36
37
```
37
38
38
-
### Attributes
39
+
### Attributes
39
40
40
-
*`data`[str] - *The contents of the XER file as a string.*
41
-
*`export_date`[datetime] - *The date the XER file was exported.*
42
-
*`export_user`[str] - *The P6 user who export the XER file.*
43
-
*`export_version`[str] - *The P6 verison used to export the XER file.*
44
-
*`file_name`[str] - *The name of the file without the '.xer' extension.*
41
+
-`data`[str] - _The contents of the XER file as a string._
42
+
-`export_date`[datetime] - _The date the XER file was exported._
43
+
-`export_user`[str] - _The P6 user who export the XER file._
44
+
-`export_version`[str] - _The P6 verison used to export the XER file._
45
+
-`file_name`[str] - _The name of the file without the '.xer' extension._
45
46
46
47
### Methods
47
48
48
-
**`check_errors()`** -> *list[str]*
49
-
Checks the XER file for missing tables and orphan data, and returns the results as a list of errors.
49
+
**`check_errors()`** -> _list[str]_
50
+
Checks the XER file for missing tables and orphan data, and returns the results as a list of errors.
50
51
51
-
* Missing tables can occur when an entry in *Table 1* points to an entry in *Table 2* but *Table 2* does not exist at all.
52
-
* Orphan data occurs when an entry in *Table 1* points to an entry *Table 2* but the entry in *Table 2* does not exist.
52
+
- Missing tables can occur when an entry in _Table 1_ points to an entry in _Table 2_ but _Table 2_ does not exist at all.
53
+
- Orphan data occurs when an entry in _Table 1_ points to an entry _Table 2_ but the entry in _Table 2_ does not exist.
53
54
54
-
**`delete_tables(*table_names: str)`** -> *str*
55
-
Delete a variable number of tables (*table_names*) from the XER file data and returns a new string (*Does not modify `XerReader.data`attribute*).
55
+
**`delete_tables(*table_names: str)`** -> _str_
56
+
Delete a variable number of tables (_table_names_) from the XER file data and returns a new string (_Does not modify `XerReader.data`attribute_).
56
57
57
58
In the following example the tables associated with User Defined Fields are removed from the XER file contents and stored in a new variable `new_xer_data`, which can then be written to a new XER file:
0 commit comments