Skip to content
This repository was archived by the owner on Dec 11, 2023. It is now read-only.

Commit 544c9e0

Browse files
author
clittle
committed
Tweaked documentation slightly
1 parent 893f9ab commit 544c9e0

1 file changed

Lines changed: 19 additions & 1 deletion

File tree

layers/README.md

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,16 +129,34 @@ out_layer6.to_file("C:\demo_layer6.json") # Save combined co
129129

130130
## to_excel.py
131131
to_excel.py provides the ToExcel class, which is a way to export an existing layer file as an Excel spreadsheet. The ToExcel class has an optional parameter for the export function, `to_file()`, that tells the exporter to build the output matrix based on live data from cti-taxii.mitre.org. Otherwise, it will use the cached subtechniques data. If matrix template lacks elements included in a layer's technique listing, those elements will not be visible in the output file.
132+
133+
##### ToExcel()
134+
```python
135+
x = ToExcel(layer=None)
136+
```
137+
The ToExcel constructor takes an options layer argument during instantiation. If no layer is loaded at this time, it must be loaded later before exporting `x.layer = Layer()`.
138+
139+
##### .to_file() Method
140+
```python
141+
x.to_file(filepath="layer.xlsx", fresh=False)
142+
```
143+
The to_file method exports the layer file loaded in the ToExcel class (`x`), as an excel file to the
144+
filepath specified. The fresh parameter is an optional parameter that bases the export on a matrix built
145+
from the live data on the taxii server (`True`), or based on cached data (`False`).
146+
147+
132148
#### Example Usage
133149
```python
134150
from layers import Layer
135151
from layers import ToExcel
136152

137153
lay = Layer()
138154
lay.from_file("path/to/layer/file.json")
139-
t = ToExcel(lay)
140155
# Using cached data for template
156+
t = ToExcel(lay)
141157
t.to_file("demo.xlsx")
142158
# Using live data for templates
159+
t2 = ToExcel()
160+
t2.layer = lay
143161
t.to_file("demo2.xlsx", fresh=True)
144162
```

0 commit comments

Comments
 (0)