aboutsummaryrefslogtreecommitdiff
path: root/README.md
diff options
context:
space:
mode:
authorMichael Williamson <mike@zwobble.org>2014-07-06 18:05:59 +0100
committerMichael Williamson <mike@zwobble.org>2014-07-06 18:05:59 +0100
commit50a1a16aae9fa8809fb6d9e531e8483c8bb05b25 (patch)
tree65e6f2b75d64028fc7b995bfb7b6128875eaa772 /README.md
parent5e0718f964241075ff33f80f4eeff89debc7c278 (diff)
Document extract_raw_text
Diffstat (limited to 'README.md')
-rw-r--r--README.md27
1 files changed, 27 insertions, 0 deletions
diff --git a/README.md b/README.md
index c09aea9..ff51784 100644
--- a/README.md
+++ b/README.md
@@ -86,6 +86,18 @@ with open("document.docx", "rb") as docx_file:
messages = result.messages # Any messages, such as warnings during conversion
```
+You can also extract the raw text of the document by using `mammoth.extract_raw_text`.
+This will ignore all formatting in the document.
+Each paragraph is followed by two newlines.
+
+```python
+with open("document.docx", "rb") as docx_file:
+ result = mammoth.extract_raw_text(docx_file)
+ text = result.value # The raw text
+ messages = result.messages # Any messages
+```
+
+
#### Custom style map
By default,
@@ -139,6 +151,21 @@ Converts the source document to HTML.
* `messages`: any messages, such as errors and warnings, generated during the conversion
+#### `mammoth.extract_raw_text(fileobj)`
+
+Extract the raw text of the document.
+This will ignore all formatting in the document.
+Each paragraph is followed by two newlines.
+
+* `fileobj`: a file-like object containing the source document.
+ Files should be opened in binary mode.
+
+* Returns a result with the following properties:
+
+ * `value`: the raw text
+
+ * `messages`: any messages, such as errors and warnings
+
#### Messages
Each message has the following properties: