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
+53-3Lines changed: 53 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,10 +1,60 @@
1
1
# rtfparse
2
2
3
-
RTF Parser
3
+
RTF Parser. So far it can only de-encapsulate HTML content from an RTF, but it properly parses the RTF structure and allows you to write your own custom RTF renderers. The HTML de-encapsulator provided with `rtfparse` is just one such custom renderer which liberates the HTML content from its RTF encapsulation and saves it in a given html file.
4
4
5
-
## Call for collaboration
5
+
#Dependencies
6
6
7
-
This RTF parser needs your collaboration. Refer to the RTF Specification and create new parsable objects.
7
+
See `requirements.txt`.
8
+
9
+
# Installation
10
+
11
+
Install rtfparse from your local repository with pip:
12
+
13
+
pip install ./rtfparse
14
+
15
+
Installation creates an executable file `rtfparse` in your python scripts folder which should be in your $PATH.
16
+
17
+
# First Run
18
+
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.)
20
+
21
+
In the configuration wizard you can press `A` for care-free automatic configuration, which would look something like this:
22
+
23
+
```
24
+
$ rtfparse
25
+
Config file missing, creating new default config file
◊ email_rtf (C:\Users\nagidal\rtfparse\email_rtf) does not exist!
34
+
35
+
(A) Automatically configure this and all remaining rtfparse settings
36
+
(C) Create this path automatically
37
+
(M) Manually input correct path to use or to create
38
+
(Q) Quit and edit `email_rtf` in rtfparse_configuration.ini
39
+
40
+
Created directory C:\Users\nagidal\rtfparse
41
+
Created directory C:\Users\nagidal\rtfparse\email_rtf
42
+
Created directory C:\Users\nagidal\rtfparse\html
43
+
```
44
+
45
+
`rtfparse` also creates the folder `.rtfparse` (beginning with a dot) in your home directory where it saves its default configuration and its log files.
46
+
47
+
# Usage
48
+
49
+
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):
parser.add_argument("-f", "--file", action="store", metavar="PATH", type=pathlib.Path, help="path to the rtf file").completer=EC
50
53
parser.add_argument("-m", "--msg", action="store", metavar="PATH", type=pathlib.Path, help="Parse RTF from MS Outlook's .msg file").completer=EC
54
+
parser.add_argument("-d", "--de-encapsulate-html", action="store", metavar="PATH", type=pathlib.Path, help="De-encapsulate HTML from RTF").completer=EC
0 commit comments