Metadata-Version: 2.1
Name: mod-docx
Version: 0.1.0
Summary: The purpose of this library is to serve as a reliable and simple library to reassemble docx documents after they have been treated using AI/machine learning text treatment.
Author-email: Jamilah Foucher <j622amilah@gmail.com>
Project-URL: Homepage, https://github.com/DevopsPractice7/mod_docx
Project-URL: Bug Tracker, https://github.com/DevopsPractice7/mod_docx/issues
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: GNU Affero General Public License v3
Classifier: Operating System :: OS Independent
Requires-Python: >=3.7
Description-Content-Type: text/markdown
License-File: LICENSE

# mod_docx
The purpose of this library is to serve as a reliable and simple library to reassemble docx documents after they have been treated using AI/machine learning text treatment.

## Example of library usage
import os

import sys

sys.path.insert(1, '/usr/lib/python3.11/site-packages')

import mod_docx


### [Step 0] Open the docx file as an XML object
#### Obtain the orignal docx file
fpath = ".../mod_docx/tests"

fichier = "test_document.docx"

docx_filename = os.path.join(fpath, fichier)
        
#### Create a class object for the name_of_file.class_name. Use the class object, to call the functions in the class.
md = mod_docx.mod_docx(docx_filename)

#### Convert the orignal docx file to XML
document_org = md.opendocx(docx_filename)


### [Step 1] Modify the document
#### [To be completed for next version] Modify the document as desired (ie: replace text, change style, change font)
doc_finale = document_org

### [Step 2] Save the changed XML document as a docx file
root_dir = f'{fpath}/'

desired_output_docx_name = 'test_document_out.docx'

md.savedocx_ver_fichier(docx_filename, root_dir, desired_output_docx_name, doc_finale)
