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
Copy file name to clipboardExpand all lines: README.md
+26-5Lines changed: 26 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,7 +4,11 @@ RTF Parser. So far it can only de-encapsulate HTML content from an RTF, but it p
4
4
5
5
# Dependencies
6
6
7
-
See `requirements.txt`.
7
+
```
8
+
argcomplete
9
+
extract-msg
10
+
compressed_rtf
11
+
```
8
12
9
13
# Installation
10
14
@@ -16,7 +20,7 @@ Installation creates an executable file `rtfparse` in your python scripts folder
16
20
17
21
# First Run
18
22
19
-
When you run `rtfparse` for the first time it will start a configuration wizard which will guide you through the process of creating a default configuration file and specifying the location of its folders. (These folders don't mean much yet, they are more or less placeholders for upcoming program features.)
23
+
When you run `rtfparse` for the first time it will start a configuration wizard which will guide you through the process of creating a default configuration file and specifying the location of its folders. (These folders serve as locations for saving extracted rtf or html files.)
20
24
21
25
In the configuration wizard you can press `A` for care-free automatic configuration, which would look something like this:
22
26
@@ -48,17 +52,34 @@ Created directory C:\Users\nagidal\rtfparse\html
48
52
49
53
Use the `rtfparse` executable from the command line. For example if you want to de-encapsulate the HTML from an RTF file, do it like this:
Or you can de-encapsulate the HTML from an MS Outlook message, thanks to [extract_msg](https://github.com/TeamMsgExtractor/msg-extractor) and [compressed_rtf](https://github.com/delimitry/compressed_rtf):
54
58
55
59
rtfparse -m "path/to/email.msg" -d
56
60
57
-
Command reference is in `rtfparse --help`.
61
+
The resulting html file will be saved to the `html` folder you set in the `rtfparse_configuration.ini`. Command reference is in `rtfparse --help`.
58
62
59
63
# Usage in python module
60
64
61
-
See 'minimal.py' for an example.
65
+
```
66
+
import pathlib
67
+
from rtfparse.parser import Rtf_Parser
68
+
from rtfparse.renderers import de_encapsulate_html
# Check if the ANSI code page is set as a parameter of any of the control words:
45
45
cp=None
46
46
foriteminnames:
47
47
# if any item is a Control_Word which has a parameter, we assume that this is the parameter of \ansicpg, and that corresponds to the codepage we are looking for
0 commit comments