pyreqif 0.9__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- pyreqif/__init__.py +9 -0
- pyreqif/create.py +93 -0
- pyreqif/extractOleData.py +41 -0
- pyreqif/html.py +91 -0
- pyreqif/ole2rtf.py +16 -0
- pyreqif/pyreqif.py +729 -0
- pyreqif/reqif.py +410 -0
- pyreqif/rif.py +702 -0
- pyreqif/xlsx.py +126 -0
- pyreqif-0.9.data/scripts/reqif2html.py +11 -0
- pyreqif-0.9.data/scripts/reqif2xlsx.py +11 -0
- pyreqif-0.9.data/scripts/xlsx2reqif.py +236 -0
- pyreqif-0.9.dist-info/METADATA +50 -0
- pyreqif-0.9.dist-info/RECORD +17 -0
- pyreqif-0.9.dist-info/WHEEL +5 -0
- pyreqif-0.9.dist-info/licenses/LICENSE +25 -0
- pyreqif-0.9.dist-info/top_level.txt +1 -0
pyreqif/xlsx.py
ADDED
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
#!/usr/bin/env python2
|
|
2
|
+
import io
|
|
3
|
+
import os.path
|
|
4
|
+
from lxml import etree
|
|
5
|
+
import pyreqif.extractOleData
|
|
6
|
+
#import openpyxl
|
|
7
|
+
#from openpyxl.drawing.image import Image
|
|
8
|
+
import xlsxwriter
|
|
9
|
+
from PIL import Image
|
|
10
|
+
import urllib
|
|
11
|
+
|
|
12
|
+
def write_excel_line(worksheet, item, row, cols, depth, basepath, format):
|
|
13
|
+
row_height = 0
|
|
14
|
+
|
|
15
|
+
for col, value in item.items():
|
|
16
|
+
col_height = 0
|
|
17
|
+
files = []
|
|
18
|
+
if col not in cols:
|
|
19
|
+
continue
|
|
20
|
+
if type(value) is not bytes:
|
|
21
|
+
value = value.encode("utf8")
|
|
22
|
+
if value is not None:
|
|
23
|
+
if b"<" in value and b">" in value:
|
|
24
|
+
try:
|
|
25
|
+
tree = etree.parse(io.BytesIO(value))
|
|
26
|
+
root = tree.getroot()
|
|
27
|
+
for element in root.iter("object"):
|
|
28
|
+
rtfFilename = os.path.join(basepath, element.attrib["data"])
|
|
29
|
+
try:
|
|
30
|
+
rtfFilename = urllib.parse.unquote(rtfFilename)
|
|
31
|
+
except:
|
|
32
|
+
pass
|
|
33
|
+
if rtfFilename.endswith(".ole"):
|
|
34
|
+
files += pyreqif.extractOleData.extractOleData(rtfFilename)
|
|
35
|
+
else:
|
|
36
|
+
files += [rtfFilename]
|
|
37
|
+
if len(files) > 0 and files[0][-3:].lower() not in ["png","jpeg","jpg","bmp","wmf","emf"]:
|
|
38
|
+
for key in element.attrib:
|
|
39
|
+
del element.attrib[key]
|
|
40
|
+
element.tag = "a"
|
|
41
|
+
element.set("href", files[0])
|
|
42
|
+
element.text = "linked file: " + files[0]
|
|
43
|
+
value = "".join(root.itertext())
|
|
44
|
+
value = value.encode("utf8")
|
|
45
|
+
except:
|
|
46
|
+
pass
|
|
47
|
+
# worksheet.cell(row=row, column=cols.index(col)+1). value=value.decode("utf-8")
|
|
48
|
+
# worksheet.row_dimensions[row].outlineLevel = depth
|
|
49
|
+
worksheet.write(row, cols.index(col), value.decode("utf-8"))
|
|
50
|
+
for file in files:
|
|
51
|
+
if file[-3:].lower() in ["png", "jpeg", "jpg", "bmp", "wmf", "emf"]:
|
|
52
|
+
try:
|
|
53
|
+
im = Image.open(file)
|
|
54
|
+
_, height = im.size
|
|
55
|
+
col_height += height
|
|
56
|
+
im.close()
|
|
57
|
+
worksheet.insert_image(row, cols.index(col), file, {'y_offset' : col_height-height})
|
|
58
|
+
except:
|
|
59
|
+
print("Error with image: {}".format(file))
|
|
60
|
+
worksheet.write_string(row, cols.index(col), "Link to picture: " + os.path.join(basepath, file))
|
|
61
|
+
col_height = max(300, row_height)
|
|
62
|
+
col_height = max(300, row_height)
|
|
63
|
+
|
|
64
|
+
row_height = max(row_height, col_height)
|
|
65
|
+
if row_height == 0:
|
|
66
|
+
worksheet.set_row(row, None, format, {'level': depth})
|
|
67
|
+
else:
|
|
68
|
+
worksheet.set_row(row, row_height, None, {'level': depth})
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
def dump(myDoc, outfile, basepath = None):
|
|
72
|
+
if basepath is None:
|
|
73
|
+
basepath = os.path.dirname(outfile)
|
|
74
|
+
#workbook = openpyxl.Workbook()
|
|
75
|
+
#worksheet = workbook.active
|
|
76
|
+
#workbook.title = "Export"
|
|
77
|
+
workbook = xlsxwriter.Workbook(outfile)
|
|
78
|
+
worksheet = workbook.add_worksheet("Export")
|
|
79
|
+
|
|
80
|
+
cell_format = workbook.add_format()
|
|
81
|
+
cell_format.set_text_wrap()
|
|
82
|
+
|
|
83
|
+
cols = myDoc.fields + ["reqifId"]
|
|
84
|
+
colNr = 0
|
|
85
|
+
# colNr = 1
|
|
86
|
+
for col in cols:
|
|
87
|
+
worksheet.write(0, colNr, col)
|
|
88
|
+
# worksheet.cell(row=1, column=colNr).value = col
|
|
89
|
+
colNr += 1
|
|
90
|
+
worksheet.set_column(0, colNr, 20)
|
|
91
|
+
if "ReqIF.Text" in cols:
|
|
92
|
+
worksheet.set_column(cols.index("ReqIF.Text"), cols.index("ReqIF.Text"), 100)
|
|
93
|
+
row = 0
|
|
94
|
+
# row = 1
|
|
95
|
+
|
|
96
|
+
for child in myDoc.hierarchy:
|
|
97
|
+
for item, depth in myDoc.hierach_iterator(child, cols):
|
|
98
|
+
row += 1
|
|
99
|
+
write_excel_line(worksheet, item, row, cols, depth, basepath, cell_format)
|
|
100
|
+
|
|
101
|
+
#
|
|
102
|
+
# add dropdown lists for columns with an enumeration datatype
|
|
103
|
+
#
|
|
104
|
+
for reqType in myDoc.requirementTypeList:
|
|
105
|
+
for myType in reqType.myTypes.values():
|
|
106
|
+
if myType._longname is None or myType._longname not in cols:
|
|
107
|
+
continue
|
|
108
|
+
datatype = myDoc.datatypeById(myType._typeref)
|
|
109
|
+
if datatype is None or datatype.mytype != "enum" or len(datatype.valueTable) == 0:
|
|
110
|
+
continue
|
|
111
|
+
enumNames = sorted({value["longName"] for value in datatype.valueTable.values()
|
|
112
|
+
if "longName" in value})
|
|
113
|
+
if len(enumNames) == 0:
|
|
114
|
+
continue
|
|
115
|
+
colNr = cols.index(myType._longname)
|
|
116
|
+
if getattr(myType, "_multiValued", False):
|
|
117
|
+
validation = {"validate": "list", "source": enumNames,
|
|
118
|
+
"input_title": "allowed values",
|
|
119
|
+
"input_message": "multiple values allowed, comma separated"}
|
|
120
|
+
else:
|
|
121
|
+
validation = {"validate": "list", "source": enumNames,
|
|
122
|
+
"input_title": "allowed values"}
|
|
123
|
+
worksheet.data_validation(1, colNr, row, colNr, validation)
|
|
124
|
+
|
|
125
|
+
# workbook.save(filename=outfile)
|
|
126
|
+
workbook.close()
|
|
@@ -0,0 +1,236 @@
|
|
|
1
|
+
#!python
|
|
2
|
+
import os
|
|
3
|
+
import zipfile
|
|
4
|
+
import datetime
|
|
5
|
+
import xml.etree.ElementTree
|
|
6
|
+
import openpyxl
|
|
7
|
+
import pyreqif.create
|
|
8
|
+
import pyreqif.reqif
|
|
9
|
+
import io
|
|
10
|
+
import sys
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
def get_images_from_excel(excel_file):
|
|
14
|
+
in_excel = zipfile.ZipFile(excel_file)
|
|
15
|
+
if "xl/drawings/drawing1.xml" not in in_excel.namelist():
|
|
16
|
+
return []
|
|
17
|
+
|
|
18
|
+
out_zip = zipfile.ZipFile(document_title + ".reqifz", 'w', zipfile.ZIP_DEFLATED)
|
|
19
|
+
|
|
20
|
+
ns = "{http://schemas.openxmlformats.org/drawingml/2006/spreadsheetDrawing}"
|
|
21
|
+
a_ns = "{http://schemas.openxmlformats.org/drawingml/2006/main}"
|
|
22
|
+
|
|
23
|
+
drawing_source = in_excel.open("xl/drawings/drawing1.xml")
|
|
24
|
+
drawing_tree = xml.etree.ElementTree.parse(drawing_source)
|
|
25
|
+
drawing_root = drawing_tree.getroot()
|
|
26
|
+
|
|
27
|
+
images = [{"row":int(anchor.find(ns + "from/" + ns + "row").text),
|
|
28
|
+
"col": int(anchor.find(ns + "from/" + ns + "col").text),
|
|
29
|
+
"img_ref": anchor.find(ns + "pic/" + ns + "blipFill/" + a_ns + "blip").attrib[
|
|
30
|
+
"{http://schemas.openxmlformats.org/officeDocument/2006/relationships}embed"]}
|
|
31
|
+
for anchor in drawing_root]
|
|
32
|
+
|
|
33
|
+
drawing_source.close()
|
|
34
|
+
drawing_links_source = in_excel.open("xl/drawings/_rels/drawing1.xml.rels")
|
|
35
|
+
drawing_links_tree = xml.etree.ElementTree.parse(drawing_links_source)
|
|
36
|
+
drawing_links_root = drawing_links_tree.getroot()
|
|
37
|
+
|
|
38
|
+
for relation_ship in drawing_links_root:
|
|
39
|
+
id = relation_ship.attrib["Id"]
|
|
40
|
+
target = relation_ship.attrib["Target"]
|
|
41
|
+
for item in images:
|
|
42
|
+
if item["img_ref"] == id:
|
|
43
|
+
item["target"] = target.replace("../", "")
|
|
44
|
+
# copy all images to target:
|
|
45
|
+
out_zip.writestr(target.replace("../", ""), in_excel.read(target.replace("../", "xl/")),
|
|
46
|
+
zipfile.ZIP_DEFLATED)
|
|
47
|
+
drawing_links_source.close()
|
|
48
|
+
out_zip.close()
|
|
49
|
+
return images
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
def get_images(images, row, col):
|
|
53
|
+
return_pictures = []
|
|
54
|
+
for image in images:
|
|
55
|
+
if image["row"] == row and image["col"] == col:
|
|
56
|
+
return_pictures.append(image)
|
|
57
|
+
return return_pictures
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
file_name = sys.argv[1]
|
|
61
|
+
|
|
62
|
+
document_title, _ = os.path.splitext(os.path.basename(file_name))
|
|
63
|
+
|
|
64
|
+
images = get_images_from_excel(file_name)
|
|
65
|
+
wb = openpyxl.load_workbook(file_name)
|
|
66
|
+
ws = wb.active
|
|
67
|
+
|
|
68
|
+
columns = [ws.cell(1, col_nr).value for col_nr in range(1, ws.max_column+1)]
|
|
69
|
+
# ignore columns without a header cell (e.g. empty columns at the end of the sheet)
|
|
70
|
+
valid_columns = [col for col in columns if col not in (None, "")]
|
|
71
|
+
# optional: a column named "LONG-NAME" provides the SPEC-OBJECT long name instead of an attribute
|
|
72
|
+
long_name_column = "LONG-NAME" if "LONG-NAME" in valid_columns else None
|
|
73
|
+
attribute_columns = [col for col in valid_columns if col != long_name_column]
|
|
74
|
+
|
|
75
|
+
#
|
|
76
|
+
# detect columns with an enumeration datatype from the data validations:
|
|
77
|
+
# a validation with a literal value list (e.g. "A,B,C") over a data column
|
|
78
|
+
# turns this column into a ReqIF enumeration with a drop-down in the export
|
|
79
|
+
#
|
|
80
|
+
enum_columns = {} # excel column number (1-based) -> list of allowed values
|
|
81
|
+
for dv in ws.data_validations.dataValidation:
|
|
82
|
+
if dv.formula1 is None:
|
|
83
|
+
continue
|
|
84
|
+
formula = dv.formula1.strip()
|
|
85
|
+
if not (formula.startswith('"') and formula.endswith('"') and len(formula) > 2):
|
|
86
|
+
continue # skip validations referencing other ranges
|
|
87
|
+
for cell_range in dv.sqref.ranges:
|
|
88
|
+
if cell_range.min_row > 2:
|
|
89
|
+
continue
|
|
90
|
+
for col_nr in range(cell_range.min_col, cell_range.max_col + 1):
|
|
91
|
+
enum_columns.setdefault(col_nr, [])
|
|
92
|
+
for value in formula[1:-1].split(","):
|
|
93
|
+
value = value.strip()
|
|
94
|
+
if value and value not in enum_columns[col_nr]:
|
|
95
|
+
enum_columns[col_nr].append(value)
|
|
96
|
+
|
|
97
|
+
#
|
|
98
|
+
# collect the enum definitions per column: all cell values must be mappable
|
|
99
|
+
# to an enumeration value; unknown values are added to the enumeration
|
|
100
|
+
#
|
|
101
|
+
last_change = datetime.datetime.today().isoformat("T", "seconds")
|
|
102
|
+
enum_info = {} # column name -> {"valueIds": {name: id}, "multiValued": bool}
|
|
103
|
+
for col in attribute_columns:
|
|
104
|
+
col_nr = columns.index(col) + 1
|
|
105
|
+
if col_nr not in enum_columns:
|
|
106
|
+
continue
|
|
107
|
+
value_ids = {}
|
|
108
|
+
multi_valued = False
|
|
109
|
+
# start with all values from the validation list, so options that are not
|
|
110
|
+
# used in any cell are preserved in the datatype
|
|
111
|
+
for index, name in enumerate(enum_columns[col_nr]):
|
|
112
|
+
value_ids[name] = "_enumval_{}_{}".format(col.replace(" ", "_"), index)
|
|
113
|
+
for row_nr in range(2, ws.max_row + 1):
|
|
114
|
+
cell = ws.cell(row_nr, col_nr).value
|
|
115
|
+
if cell is None or not isinstance(cell, str):
|
|
116
|
+
continue
|
|
117
|
+
parts = [part.strip() for part in cell.split(",")]
|
|
118
|
+
if len(parts) > 1 and all(part in enum_columns[col_nr] for part in parts):
|
|
119
|
+
multi_valued = True
|
|
120
|
+
names = parts
|
|
121
|
+
else:
|
|
122
|
+
names = [cell.strip()]
|
|
123
|
+
for name in names:
|
|
124
|
+
if not name:
|
|
125
|
+
continue
|
|
126
|
+
if name not in value_ids:
|
|
127
|
+
if name in enum_columns[col_nr]:
|
|
128
|
+
index = enum_columns[col_nr].index(name)
|
|
129
|
+
value_ids[name] = "_enumval_{}_{}".format(col.replace(" ", "_"), index)
|
|
130
|
+
else:
|
|
131
|
+
print("Warning: value {!r} in column {!r} is not in the "
|
|
132
|
+
"validation list, adding it to the enumeration".format(name, col))
|
|
133
|
+
value_ids[name] = pyreqif.create.creatUUID()
|
|
134
|
+
if len(value_ids) > 0:
|
|
135
|
+
enum_info[col] = {"valueIds": value_ids, "multiValued": multi_valued}
|
|
136
|
+
|
|
137
|
+
document_reqif_id = "_{}ReqifId-Header".format(document_title)
|
|
138
|
+
spec_reqif_id = "_{}ReqifId--spec".format(document_title)
|
|
139
|
+
doc_type_ref = "_doc_type_ref"
|
|
140
|
+
|
|
141
|
+
#
|
|
142
|
+
# create doc:
|
|
143
|
+
#
|
|
144
|
+
mydoc = pyreqif.create.createDocument(document_reqif_id, title=document_title)
|
|
145
|
+
pyreqif.create.addDocType(doc_type_ref, mydoc)
|
|
146
|
+
# create primitive datatype
|
|
147
|
+
#
|
|
148
|
+
pyreqif.create.addDatatype("_datatype_ID", mydoc)
|
|
149
|
+
|
|
150
|
+
#
|
|
151
|
+
# create columns (with real enumeration datatypes where detected)
|
|
152
|
+
#
|
|
153
|
+
for col in attribute_columns:
|
|
154
|
+
if col in enum_info:
|
|
155
|
+
datatype_id = "_datatype_enum_for_" + col.replace(" ", "_")
|
|
156
|
+
values = {}
|
|
157
|
+
for name, value_id in enum_info[col]["valueIds"].items():
|
|
158
|
+
values[value_id] = {"identifier": value_id, "lastChange": last_change, "longName": name}
|
|
159
|
+
pyreqif.create.addDatatype(datatype_id, mydoc, type="enum", longName=col + "_type", values=values)
|
|
160
|
+
pyreqif.create.addReqType("_some_requirement_type_id", "requirement Type",
|
|
161
|
+
"_reqtype_for_" + col.replace(" ", "_"),
|
|
162
|
+
col, datatype_id, mydoc, type="enum",
|
|
163
|
+
multiValued=enum_info[col]["multiValued"])
|
|
164
|
+
else:
|
|
165
|
+
pyreqif.create.addReqType("_some_requirement_type_id", "requirement Type",
|
|
166
|
+
"_reqtype_for_" + col.replace(" ", "_"),
|
|
167
|
+
col, "_datatype_ID", mydoc)
|
|
168
|
+
|
|
169
|
+
#
|
|
170
|
+
# create document hierarchy head
|
|
171
|
+
#
|
|
172
|
+
myHierarch = pyreqif.create.createHierarchHead(document_title, typeRef=doc_type_ref, id=spec_reqif_id)
|
|
173
|
+
|
|
174
|
+
#
|
|
175
|
+
# create child elements
|
|
176
|
+
#
|
|
177
|
+
hierarch_stack = []
|
|
178
|
+
last_hierarch_element = myHierarch
|
|
179
|
+
for row_nr in range(2, ws.max_row+1):
|
|
180
|
+
xls_req = dict(zip(columns, [ws.cell(row_nr, x).value for x in range(1, ws.max_column + 1)]))
|
|
181
|
+
if "reqifId" not in xls_req:
|
|
182
|
+
xls_req["reqifId"] = pyreqif.create.creatUUID()
|
|
183
|
+
# the optional column "LONG-NAME" provides the SPEC-OBJECT long name
|
|
184
|
+
long_name = xls_req[long_name_column] if long_name_column else None
|
|
185
|
+
for col in attribute_columns:
|
|
186
|
+
# do images:
|
|
187
|
+
pictures = get_images(images, row_nr - 1, columns.index(col))
|
|
188
|
+
if type(xls_req[col]) == str:
|
|
189
|
+
xls_req[col] = xls_req[col].replace(">", ">")
|
|
190
|
+
xls_req[col] = xls_req[col].replace("<", "<")
|
|
191
|
+
if len(pictures) > 0:
|
|
192
|
+
for pic in pictures:
|
|
193
|
+
xls_req[col] = "" if xls_req[col] is None else xls_req[col]
|
|
194
|
+
xls_req[col] += "<img src={}>".format(pic["target"])
|
|
195
|
+
if xls_req[col] is not None:
|
|
196
|
+
if col in enum_info:
|
|
197
|
+
# map the cell content to enumeration value references
|
|
198
|
+
parts = [part.strip() for part in str(xls_req[col]).split(",")]
|
|
199
|
+
value_ids = enum_info[col]["valueIds"]
|
|
200
|
+
if all(part in value_ids for part in parts if part) and any(parts):
|
|
201
|
+
pyreqif.create.addReq(xls_req["reqifId"], "_some_requirement_type_id",
|
|
202
|
+
None, "_reqtype_for_" + col.replace(" ", "_"),
|
|
203
|
+
mydoc, longName=long_name,
|
|
204
|
+
contentRef=[value_ids[part] for part in parts if part])
|
|
205
|
+
else:
|
|
206
|
+
print("Warning: value {!r} in column {!r} does not match the "
|
|
207
|
+
"enumeration values, skipping it".format(xls_req[col], col))
|
|
208
|
+
else:
|
|
209
|
+
pyreqif.create.addReq(xls_req["reqifId"], "_some_requirement_type_id",
|
|
210
|
+
"<div>" + str(xls_req[col]) + "</div>", "_reqtype_for_" + col.replace(" ", "_"),
|
|
211
|
+
mydoc, longName=long_name)
|
|
212
|
+
|
|
213
|
+
# do hierarchy
|
|
214
|
+
hierarch_element = pyreqif.create.createHierarchElement(xls_req["reqifId"])
|
|
215
|
+
level = ws.row_dimensions[row_nr].outline_level + 1
|
|
216
|
+
if level > len(hierarch_stack):
|
|
217
|
+
hierarch_stack.append(last_hierarch_element)
|
|
218
|
+
elif level < len(hierarch_stack):
|
|
219
|
+
hierarch_stack = hierarch_stack[0:level]
|
|
220
|
+
|
|
221
|
+
current_head = hierarch_stack[level - 1]
|
|
222
|
+
current_head.addChild(hierarch_element)
|
|
223
|
+
last_hierarch_element = hierarch_element
|
|
224
|
+
|
|
225
|
+
mydoc.hierarchy.append(myHierarch)
|
|
226
|
+
|
|
227
|
+
#
|
|
228
|
+
# safe reqif to string
|
|
229
|
+
strIO = io.StringIO()
|
|
230
|
+
pyreqif.reqif.dump(mydoc, strIO)
|
|
231
|
+
|
|
232
|
+
# add reqifz as zip-file
|
|
233
|
+
zip = zipfile.ZipFile(document_title + ".reqifz", 'a', zipfile.ZIP_DEFLATED)
|
|
234
|
+
zip.writestr(document_title + '.reqif', strIO.getvalue())
|
|
235
|
+
|
|
236
|
+
zip.close()
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: pyreqif
|
|
3
|
+
Version: 0.9
|
|
4
|
+
Summary: very basic python implementation of reqif object model with import and export feature
|
|
5
|
+
Author-email: Eduard Broecker <eduard@gmx.de>
|
|
6
|
+
License: BSD
|
|
7
|
+
Project-URL: Homepage, https://github.com/ebroecker/pyreqif
|
|
8
|
+
Keywords: reqif,requirements,interchange,format
|
|
9
|
+
Classifier: Development Status :: 4 - Beta
|
|
10
|
+
Classifier: Environment :: Console
|
|
11
|
+
Classifier: License :: OSI Approved :: BSD License
|
|
12
|
+
Classifier: Topic :: Scientific/Engineering
|
|
13
|
+
Classifier: Programming Language :: Python :: 3
|
|
14
|
+
Requires-Python: >=3.8
|
|
15
|
+
Description-Content-Type: text/markdown
|
|
16
|
+
License-File: LICENSE
|
|
17
|
+
Requires-Dist: lxml
|
|
18
|
+
Requires-Dist: oletools
|
|
19
|
+
Requires-Dist: openpyxl
|
|
20
|
+
Requires-Dist: pillow
|
|
21
|
+
Requires-Dist: xlsxwriter
|
|
22
|
+
Dynamic: license-file
|
|
23
|
+
|
|
24
|
+
# pyreqif
|
|
25
|
+
|
|
26
|
+
[](https://github.com/ebroecker/pyreqif/actions/workflows/ci.yml)
|
|
27
|
+
|
|
28
|
+
## simple python representation of RIF/REQIF (Exerpt/HIS/...) Objects in Python ##
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
currently some basic support to convert:
|
|
32
|
+
* reqif2html.py:
|
|
33
|
+
converts given rif/reqif-File to html-File
|
|
34
|
+
* reqif2xlsx.py
|
|
35
|
+
converts given rif/reqif-File to xlsx-File (Excel)
|
|
36
|
+
* xlsx2reqif.py
|
|
37
|
+
converts given xlsx-File (Excel) to rif/reqif-File
|
|
38
|
+
* example.py
|
|
39
|
+
use for own implementations (e.g. for import reqif-objects in own system)
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
## Howto Install ##
|
|
43
|
+
* from PyPI (after next release): `pip install pyreqif`
|
|
44
|
+
* from source:
|
|
45
|
+
* git clone https://github.com/ebroecker/pyreqif.git
|
|
46
|
+
* `pip install .` (or `pip install -e .` for development)
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
pyreqif/__init__.py,sha256=PWhRTPKuuekizt1EIQk99ymZByawsVev3E2gY7wFKJ4,271
|
|
2
|
+
pyreqif/create.py,sha256=QAVtvJ2IhtjdpoGvWbkAZ1Zlh8es5cQ7p4pxYMu6apY,4136
|
|
3
|
+
pyreqif/extractOleData.py,sha256=jztEA7Ox5yGaIS_vqm0pUhLYcMZ5Wr57teOglxLd3B4,1543
|
|
4
|
+
pyreqif/html.py,sha256=3p7z1vOwF8eYH-Ni2WMzwh0-wwYJETlDr7-Nds3UMU0,3179
|
|
5
|
+
pyreqif/ole2rtf.py,sha256=gyz5agNszTbJPkDzYI4XnHBBB5ffXja6QWRb5Efc87A,471
|
|
6
|
+
pyreqif/pyreqif.py,sha256=Ps0L5X-gvAo50qyKkqXhvBTd3kFEgaP20mOhG3poY2U,21732
|
|
7
|
+
pyreqif/reqif.py,sha256=ODyOuNxoqRs7SPSzjEw_162v0Ag3f5a9sRbWdKjMG-o,21275
|
|
8
|
+
pyreqif/rif.py,sha256=9dSHrNEFgyHaKfBiS9zeecdhj97EHgyZ9amRHUebEyY,33689
|
|
9
|
+
pyreqif/xlsx.py,sha256=lKQsBfoZaN1e8O99v4IjCrzdhFJJRan1i4gM08BqhKI,5185
|
|
10
|
+
pyreqif-0.9.data/scripts/reqif2html.py,sha256=xpm50b3jPsQ_5CfgShXv-bTfdqaKTEXx_yzKE2A2gJg,199
|
|
11
|
+
pyreqif-0.9.data/scripts/reqif2xlsx.py,sha256=sn6o_eg43zyKvOfhm7oxVjFrj-5AU1aBlLVbEThtSe0,199
|
|
12
|
+
pyreqif-0.9.data/scripts/xlsx2reqif.py,sha256=fxYGWe2CQcblQNx8rzZcauDyM2ifgqC91aBgNDHVrZY,10010
|
|
13
|
+
pyreqif-0.9.dist-info/licenses/LICENSE,sha256=hYgKFcuvB3XVqZHkVfV2QASV4QHtLGjzsay_QMbdoSw,1320
|
|
14
|
+
pyreqif-0.9.dist-info/METADATA,sha256=SNZCJ0pZZmf3n5Nh0eE4WbhVPgjzaBjPeHxCjFM_7uk,1551
|
|
15
|
+
pyreqif-0.9.dist-info/WHEEL,sha256=mOdXR9C3wMVov7cSY8PY-XCzo3SmmWCHvGQr5csJoao,91
|
|
16
|
+
pyreqif-0.9.dist-info/top_level.txt,sha256=Zk418mfePq7VTmO0IyAF_nYq4-Cv2kqYAxvW5W5-WBI,8
|
|
17
|
+
pyreqif-0.9.dist-info/RECORD,,
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
BSD 2-Clause License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2017, Eduard Bröcker
|
|
4
|
+
All rights reserved.
|
|
5
|
+
|
|
6
|
+
Redistribution and use in source and binary forms, with or without
|
|
7
|
+
modification, are permitted provided that the following conditions are met:
|
|
8
|
+
|
|
9
|
+
* Redistributions of source code must retain the above copyright notice, this
|
|
10
|
+
list of conditions and the following disclaimer.
|
|
11
|
+
|
|
12
|
+
* Redistributions in binary form must reproduce the above copyright notice,
|
|
13
|
+
this list of conditions and the following disclaimer in the documentation
|
|
14
|
+
and/or other materials provided with the distribution.
|
|
15
|
+
|
|
16
|
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
|
17
|
+
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
18
|
+
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
|
19
|
+
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
|
20
|
+
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
21
|
+
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
|
22
|
+
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
|
23
|
+
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
|
24
|
+
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
25
|
+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
pyreqif
|