Skip to content

Commit

Permalink
fix: Update README.md (#20)
Browse files Browse the repository at this point in the history
  • Loading branch information
henrihapponen authored Sep 4, 2024
1 parent 44ddd69 commit b84a6fc
Showing 1 changed file with 15 additions and 5 deletions.
20 changes: 15 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,32 @@

Edit Word documents effortlessly and without changing the original formatting of the document.

As great as the original `docx` library is, this "keep the same format" feature is not natively supported. However, this functionality is pretty useful if you want to automate document writing or editing and need to adhere to strict formatting rules. Hence, I wrote this add-on module.
The original `docx` library is great but it's missing one important feature: *keeping the original formatting*.
However, this functionality is pretty useful if you want to automate document writing or editing and need to adhere to strict formatting rules. This is a common requirement in corporate environment for example.

This module adds that feature with some functions that allow editing documents without changing the original formatting.

[![PyPI version](https://badge.fury.io/py/docxedit.svg)](https://badge.fury.io/py/docxedit)

## Installing
## Installation

With pip: `pip install docxedit`

## Dependencies

Included as a dependency: `python-docx`

## Functions

## Functionalities
Most of the functions in this module work primarily with **runs**, which are sequences of strings with the same formatting style. Breaking the document into runs allows us to edit the text without changing the original formatting.

Some of the functionalities that this module include:
- Replacing all occurrences of a string with a new string (optionally limit this up to a paragraph number, and include or exclude tables)
- Removing a line that includes a specific string
- Add text to a table

The beauty of this module is that you can use all of its functions to **mass edit** Word documents with consistency and precision. This is useful especially in corporate environments where a lot of document writing or editing can be automated.


## How to Use

Usage of this module is really simple. Here are some examples:
Expand All @@ -44,4 +54,4 @@ docxedit.add_text_in_table(document.tables[0], row_num=1, column_num=1, new_stri

# Save the document
document.save('path/to/your/edited/document.docx')
```
```

0 comments on commit b84a6fc

Please sign in to comment.