Saravanan666/pypi-org huggingface dataset:
Package: docx-mailmerge
Performs a Mail Merge on Office Open XML (docx) files. Can be used on any
system without having to install Microsoft Office Word. Supports Python 2.7,
3.3 and up.InstallationInstallation withpip:$ pip install docx-mailmergeUsageOpen the file.from mailmerge import MailMerge
with MailMerge('input.docx') as document:
    ...List all merge fields.print document.get_merge_fields()Merge fields, supplied as kwargs.document.merge(field1='docx Mail Merge',
               field2='Can be used for merging docx documents')Merge table rows. In your template, add a MergeField to the row you would like
to designate as template. Supply the name of this MergeField asanchorparameter. The second parameter contains the rows with key-value pairs for
the MergeField replacements.document.merge_rows('col1',
                    [{'col1': 'Row 1, Column 1', 'col2': 'Row 1 Column 1'},
                     {'col1': 'Row 2, Column 1', 'col2': 'Row 2 Column 1'},
                     {'col1': 'Row 3, Column 1', 'col2': 'Row 3 Column 1'}])Starting in version 0.2.0 you can also combine these two separate calls into a
single call tomerge.document.merge(field1='docx Mail Merge',
               col1=[
                   {'col1': 'A'},
                   {'col1': 'B'},
               ])Starting in version 0.2.0 there’s also the feature for template merging.
This creates a copy of the template for each item in the list, does a merge,
and separates them by page or section breaks (see function documentation).When using this feature, make sure you don’t use comments, footnotes,
bookmarks, etc. This is because these elements have an id attribute, which
must be unique. This library does not handle this, resulting in invalid
documents.document.merge_templates([
    {'field1': "Foo", 'field2: "Copy #1"},
    {'field1': "Bar", 'field2: "Copy #2"},
], separator='page_break')Write document to file. This should be a new file, asZipFilecannot modify
existing zip files.document.write('output.docx')See also the unit tests and this nice write-upPopulating MS Word Templates
with Pythonon Practical Business Python for more information and examples.Todo / Wish ListImage merging.ContributingFork the repository on GitHub and start hackingCreate / fix the unit testsSend a pull request with your changesUnit testsIn order to make sure that the library performs the way it was designed, unit
tests are used. When providing new features, or fixing bugs, there should be a
unit test that demonstrates it. Run the test suite:python -m unittest discoverCreditsThis library was written byBouke Haarsmaand contributors.
Package: docx-mailmerge-hxd
基于Bouke的 Docx-mailmerge：
1、merge与merge_rows可以将所有符合的全部替换
2、基于TNGPS提供的方式，实现图片的替换（title为field名称,descr如果为deletable，没有匹配数据则删除）
Base on Bouke’s Docx-mailmerge(3q):
1. enable merge_rows all required table, not only the first.
2. fixed the nested table rows merge bug.Performs a Mail Merge on Office Open XML (docx) files. Can be used on any
system without having to install Microsoft Office Word. Supports Python 2.7,
3.3 and up.InstallationInstallation withpip:$ pip install docx-mailmerge-hxdUsageOpen the file.from mailmerge import MailMerge
with MailMerge('input.docx') as document:
    ...List all merge fields.print document.get_merge_fields()Merge fields, supplied as kwargs.document.merge(field1='docx Mail Merge',
               field2='Can be used for merging docx documents')Merge table rows. In your template, add a MergeField to the row you would like
to designate as template. Supply the name of this MergeField asanchorparameter. The second parameter contains the rows with key-value pairs for
the MergeField replacements.document.merge_rows('col1',
                    [{'col1': 'Row 1, Column 1', 'col2': 'Row 1 Column 1'},
                     {'col1': 'Row 2, Column 1', 'col2': 'Row 2 Column 1'},
                     {'col1': 'Row 3, Column 1', 'col2': 'Row 3 Column 1'}])Starting in version 0.2.0 you can also combine these two separate calls into a
single call tomerge.document.merge(field1='docx Mail Merge',
               col1=[
                   {'col1': 'A'},
                   {'col1': 'B'},
               ])Starting in version 0.2.0 there’s also the feature for template merging.
This creates a copy of the template for each item in the list, does a merge,
and separates them by page or section breaks (see function documentation).When using this feature, make sure you don’t use comments, footnotes,
bookmarks, etc. This is because these elements have an id attribute, which
must be unique. This library does not handle this, resulting in invalid
documents.document.merge_templates([
    {'field1': "Foo", 'field2: "Copy #1"},
    {'field1': "Bar", 'field2: "Copy #2"},
], separator='page_break')Write document to file. This should be a new file, asZipFilecannot modify
existing zip files.document.write('output.docx')See also the unit tests and this nice write-upPopulating MS Word Templates
with Pythonon Practical Business Python for more information and examples.Todo / Wish ListImage merging.ContributingFork the repository on GitHub and start hackingCreate / fix the unit testsSend a pull request with your changesUnit testsIn order to make sure that the library performs the way it was designed, unit
tests are used. When providing new features, or fixing bugs, there should be a
unit test that demonstrates it. Run the test suite:python -m unittest discoverCreditsThis library was written byBouke Haarsmaand contributors.
Package: docx-parser
Parse all contents of a docx file withpython-docxInstallationpython3-mpipinstalldocx-parserFeatures:paragraph: text paragraph, with style_idmultipart: paragraph with image or hyperlinktable: table data with merged_cellsExamplesCMDdocx_parser--help# parse image as filedocx_parsertests/demo.docx-Dtests/media-otests/out.file.jl# parse image as base64 stringdocx_parsertests/demo.docx-Abase64-otests/out.base64.jlPythonfromdocx_parserimportDocumentParserinfile='tests/demo.docx'doc=DocumentParser(infile)for_type,itemindoc.parse():print(_type,item)ToDoparse text style: color, bgcolor, font, bold, italic ...parse paragraph format
Package: docx-parsing-gmdzy2010
# 文本模板转DOCX文件[![PyPI](https://img.shields.io/pypi/v/docx-parsing-gmdzy2010.svg)](https://pypi.org/project/docx-parsing-gmdzy2010/)### 功能概述_________本包基于一套自定义的`轻量级文本模板解析系统`，用于将文本文件转成Word的docx文件#### 输入文件###### 1. 文本模板文件模板文件是一个纯文本文件，每3行为一个解析单位，解析规则只有以下3条：>1.1 第一行包括元素类型和样式名称，用":"隔开；>1.2 第二行为要写入docx文件的文本，每行内部分为多个run单位，用"||"隔开，每个run可以有下划线和加粗两种样式，在每个run的尾部，用"::"隔开>1.3 第三行为分割线，79个下划线，为了让模板更易读而已，没太大意义###### 2. DOCX模板文件文件为一个空的或者自定义的docx文件，最好是包含python-docx自带docx模板的所有样式，方便直接调用注意：样式有可能不生效，解决方法请移步python-docx的官方文档###### 3. 文本模板的上下文数据上下文数据为一个字典型的变量，用来对模板的变量进行格式化。3.1 段落上下文对象`PARAGRAPH_CONTEXT`例如，文本模板中有一个段落上下文变量`test_context````...cover:cover_title模板内容||{test_context}::underline||后续文本-------------------------------------------------------------------------------...```则需要新建段落上下文对象，是一个python字典对象，可以以字典键值对的形式添加多个```pythonPARAGRAPH_CONTEXT = {"demo_field_1": "测试文本","demo_field_2": 300.00,"demo_field_3": 18003.00,}```3.2 表格上下文对象`TABLE_CONTEXT`例如，文本模板中有一个表格```...table:demo_table_1表格下面的文本不重要，仅仅用于占位-------------------------------------------------------------------------------...```这时需要新建表格上下文对象，包含表格的维度`rows`, `cols`，样式`style`等，类似于下方，可以以字典键值对的形式添加多个```pythonTABLE_CONTEXT = {"demo_table_1": {"attr": {"style": "Table Grid","rows": 5,"cols": 4,},"data": (("第1列标题", "第2列标题", "第3列标题", "第4列标题"),("第1行第1列内容", "第1行第2列内容", "第1行第3列内容", "第1行第4列内容"),("第2行第1列内容", "第2行第2列内容", "第2行第3列内容", "第2行第4列内容"),("第3行第1列内容", "第3行第2列内容", "第3行第3列内容", "第3行第4列内容"),("第4行第1列内容", "第4行第2列内容", "第4行第3列内容", "第4行第4列内容"),)},},```3.3 图片上下文对象`PICTURE_CONTEXT`仍在测试中，后续单元测试通过后会将文档更新### 使用_________>STEP 1. 在项目中导入渲染器`DocxProduce`，>STEP 2. 写好文本模板，选择一个自带样式比较齐全的DOCX文件，可以从python-docx默认的模板拷贝而来>STEP 3. 加载准备好的上下文和格式及样式数据，执行程序即完成
Package: docxpy
This project is forked fromankushshah89/python-docx2txt.
A new feature is added: extract the hyperlinks and its corresponding
texts.It is a pure python-based utility to extract text from docx files. The
code is taken and adapted frompython-docx. It can
however also extracttextfrom header, footer andhyperlinks. It
can now also extractimages.How to install?pipinstalldocxpyHow to run?From command line:# extract textdocx2txtfile.docx# extract text and imagesdocx2txt-i/tmp/img_dirfile.docxFrom python:importdocxpyfile='file.docx'# extract texttext=docxpy.process(file)# extract text and write images in /tmp/img_dirtext=docxpy.process(file,"/tmp/img_dir")# if you want the hyperlinksdoc=docxpy.DOCReader(file)doc.process()# process filehyperlinks=doc.data['links']
Package: docx-report
docx-reportThis is a simple wrapper for thepython-docxpackage that makes creating Word documents in Python easier. It contains convenience methods for creating tables and inserting data visualizations directly from Pandas dataframes, as well as simpler syntax for generally writing text to a document.Installationpipinstalldocx-reportUsagefromdocx_reportimportDocxReport# Create a new documentdoc=DocxReport(title="My Report")# Add a headingdoc.add_heading("My Heading")# Add a paragraphdoc.add_paragraph("This is a paragraph.")# Add a tabledoc.add_table(df)# assuming you have a pandas dataframe called df# Add a plotdoc.add_plot(df)# assuming you have a pandas dataframe called df# Save the documentdoc.save("my_report.docx")ContributingPull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
Package: docxreviews2txt
docxreviews2txtCommand line tool to extract review changes from a docx file as plain text. It is useful when reviewing a PDF file as docx, and you need to share the changes as plain text.How to install?pipinstalldocxreviews2txtHow to use it?usage: docxreviews2txt [-h] [--version] docx

Command line tool to extract review changes from a docx file as plain text.

positional arguments:
  docx        input docx

options:
  -h, --help  show this help message and exit
  --version   show versionExample:$ docxreviews2txt tests/lorem_ipsum.docx
txt reviews at file:///home/alan/src/docxreviews2txt/tests/lorem_ipsum_review.txt$ cat /home/alan/src/docxreviews2txt/tests/lorem_ipsum_review.txt
# Typos suggestions (using HTML tags <ins> and <del>)
- dolor sit amet, consectetur <ins>Lorem ipsum</ins><del>adipiscing</del>
- sit amet, consectetur adipiscing<ins>s</ins> elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim <ins>do</ins>
- Ut enim ad minim <ins>Lorem</ins>veniam<ins>ipsum</ins>
- dolor sit amet, consectetur <del>adipiscing</del>Known issuesThe tool fails to capture changes in Docx files with text organized in tables (e.g., pdf2docx converts columns to tables).ReferencesThis project takes inspiration from:https://github.com/ankushshah89/python-docx2txthttps://stackoverflow.com/questions/47390928/extract-docx-commentshttps://stackoverflow.com/questions/38247251/how-to-extract-text-inserted-with-track-changes-in-python-docx
Package: docx-search
docx_searchA python library built to search for keywords in .docx files.InstallationEasy:pip install docx_searchAdvanced:Requires git.Git clone https://github.com/WaldemarBjornstrom/docx_searchThen place the downloaded files in your project.Usageimportdocx_searchdocx_search.run('Keyword','Path\\to\\file')# Returns a list with files that contain the keyword.NOTE! The Keyword is case sensitive. And remember tu use double backslashes in the file path as python sees a single backslash as an escape marker.LicenseThis project is licensed under the GNU GPLv3 License. SeeLICENSE
Package: docxsphinx
# DocxSphinx[![CircleCI](https://circleci.com/gh/mherkazandjian/docxsphinx/tree/master.svg?style=svg)](https://circleci.com/gh/mherkazandjian/docxsphinx/tree/master)IntroductionThis repository has been forked fromhttps://bitbucket.org/shimizukawa/sphinxcontrib-docxbuilderand some heavy modification have been done. The major changes are listed in
the release notes (todoadd the release notes).InstallationThe latest bleeding edge version can be installed through` pip install docxsphinx `To install the development version` pip installgit+https://github.com/mherkazandjian/docxsphinx.git@master`Alternatively the repository can be cloned and installed locally` git clonehttps://github.com/mherkazandjian/docxsphinx.gitcd docxsphinx python-mpip install-rrequirements.txt python setup.py install `After installation,`make docx`in a sphinx project  should work
(see next section)Generating adocxdocumentIt is assumed that a sphinx project already is in place. At least one change
must be done toconf.pyin-order to be able to generate a docx file.The following line must be added toconf.py:` extensions = ['docxsphinx'] `The sample projects are in the directoryexamplesREPO_ROOT/examples/sample_1 : default example (from the original repo)REPO_ROOT/examples/sample_2 : example tested withmake docxREPO_ROOT/examples/sample_3 : example tested withmake docxwith a custom styleWord stylesa custom word style file can be specified by adding` # 'docx_template' need *.docx or *.dotx template file name. default is None. docx_template = 'template.docx' `to the end ofconf.py(or anywhere in the file)DevelopmentSetup the development environment (make sure that pipenv is installed):` pipenv install--dev# creates the .venv dir pipenv shell                # set the environment to use the venv python setup.py install make tests-B`whenever changes are made the package needs to be re-installed through:` python setup.py install `since the tests are run using the commandssphinx-buildthat needs to be
in the environment paths.The tests can also be run using (but this is not recommended and will be
removed in the future):` python setup.py test `To debug the build process` python-mpdb $(whichsphinx-build)-bdocx /path/to/src/dir /path/to/build/dir OTHER_SPHINX_OPTIONS_IF_ANY `To produce the.docxof any of the example files using the current
development docxsphinx source, e.g. the sphixn projectsample_2:` cd examples/sample_2PYTHONPATH=../../src:$PYTHONPATHmake docx-B`Profiling is useful to see which sections of the code are
visited in the modulesrc/docxsphinx/writer.py. For example
to profilesample_2, the following pattern can be used:`PYTHONPATH=../../src:$PYTHONPATHpython3-mcProfile-scalls $(whichsphinx-build)-Mdocx source build/docx/ | grep writer.py | awk '{print $6}' | sort > calls `APIsee alsoREPO_ROOT/src/README.md  (outdated - but useful)
REPO_ROOT/src/docxsphinx/docx/README.md
Package: docxstache
# docxstache 2.0A purer implementation ofpystachefor word documents.Start with a template…
![](docs/before.png)Add a little json…![](docs/json.png)Get beautiful results…
![](docs/after.png)# Usagepython app /path/to/file.docx /path/to/file.json /path/to/newfile.docx# LicenseMIT
Package: docx-text
Copyright (c) 2019 Dr. Shubham DiptPermission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the “Software”), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.Description: # docx-textConverts docx file from Sharepoint, One drive as well as individual files to text format.## Installation$pip install docx-text## DependenciesPython3## Usage>>>import doctext
>>>doc_text = doctext.DocFile(url=download_url_of_file)
>>>text = doc_text.get_text()
# or you may directly enter the path to docs file.
>>>doc_text = doctext.DocFile(doc=path_to_docx_file)Adapted fromhttps://github.com/ankushshah89/python-docx2txtPlatform: any
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Description-Content-Type: text/markdown
Package: doc-x-to-html
Simple utility to convert multiple .doc or docx files to html files.Unfortunately you need Libreoffice installed and callable through the
command-line via soffice to deal with .doc files.You can install libreoffice on your system if not already installedon Debian/Ubuntu withsudo apt-get install libreofficeOr Fedora withsudo yum install libreofficeOnce properly installed you can convert all .doc and .docx files in the
source directory to html files in the target directory using the
command:doc_x_to_html [source_dir] [target_dir]
Package: docx-utils
OverviewCreation and manipulation of Open XML documents (mainly docx).Free software: MIT licenseFeaturesThis library allow you to:Convert Open XML documents into flat OPC format.Installationpipinstalldocx-utilsUsing the libraryUsing the library to convert an Open XML document into flat OPC format:>>>fromdocx_utils.flattenimportopc_to_flat_opc>>>opc_to_flat_opc("sample.docx","sample.xml")Command Line Interface (CLI)Printing the online help:$docx_utils--helpUsage:docx_utils[OPTIONS]COMMAND[ARGS]...DocxutilitiesOptions:--versionShowtheversionandexit.--helpShowthismessageandexit.Commands:flattenConvertanOpenXMLdocumentintoflatOPCformat.Converting an Open XML document into flat OPC format:$docx_utilsflattensample.docxsample.xmlConverting'sample.docx'toflatXML...Conversiondone:'sample.xml'.Documentationhttps://docx-utils.readthedocs.io/en/latest/DevelopmentTo run the all tests run:toxChangelogv0.1.3 (2020-07-15)FixedCorrect the project’s dependencies: Enum34 is only required for Python versions < 3.4.Add thedocx_utils.exceptionsmodule: Exception hierarchy for the docx-utils package.Fix#1:Add theon_erroroption in thedocx_utils.flatten.opc_to_flat_opcfunction
in order to ignore (or raise an exception) when a part URI cannot be resolved
during the Microsoft Office document parsing.Change the command line interface: add the--on-erroroption to handle parsing error.OtherContinuous Integration: add configurations for Python 3.7 and Python 3.8.v0.1.2 (2018-07-26)FixedDrop support for PyPy: it seams that lxml is not available for this Python implementation.Drop support for Python 3.7: this Python version is not yet available on all platform.
However, it is known to work on Ubuntu with the python-3.7-dev release.OtherUse the pseudo-tagsstart-exclude/end-excludeinCHANGELOG.rstandREADME.rstto exclude text from the generatedPKG-INFOduring setup.v0.1.1 (2018-07-25)FixedFix wheel version on PyPi.v0.1.1 (2018-07-24)AddedFirst release.
Package: docxviewer
docxviewerCopyright (c) 2018-2019 Eunhou Esther SongThis is a simple document previewer which allows users to preview
multiple .docx documents at once. The options and flags include number
of paragraphs to preview and number of documents to preview in a
directory. The output prints the file name and paragraphs in each .docx
file.Python Package Indexhttps://pypi.org/project/docxviewer/Installationpip3 install docxviewerDependenciesPython 3Clickipythonpython-docxCommand Line Options–help: see help page–see: raise flag to view the name of all .docx files in a directory–p_num: set number of paragraphs to preview, the default is 3–select: set number of documents to preview, the default is 3–all: raise flag to display preview of all documents in a directoryExamplesDisplays names of all .docx files in a directorydocxviewer --seeDisplays the first three paragraphs of three documents in a directory,
selected by alaphabetical order.docxviewerDisplays the first three paragraphs of all documents in a directory.docxviewer --allDisplays the first six paragraphs of five documents in a directory.docxviewer --p_num 6 --select 5Output>>docxviewer

 125syllabus18fal.docx
现代中国小说选读
Chinese through Modern Fiction
MWF 12:30pm -1:20pm



 FieldTrip01Overview(2018-10-13)-v02.docx
Urban Studies 20
LOGISTICAL SUMMARY
for



 ch4.docx
Memo on Data and Prelim Analysis 
Data Collection
Background
Package: docx-xslt
docx-xslt is a Python library for adding XSL transformation for
Microsoft Word .docx files without XML or XSLT coding.The module uses Word meta text which has been formated with a specific
character template called XSL, add XSL code and applies XSL
transformation with the XML context.The meta text has the following syntax:<meta text>        ::= <command list>
<command list>     ::= <command expr> | <command list>
<command expr>     ::= ‘xsl’ ‘:’ <context expr> <xsl command expr> <xsl option expr>
<context expr>     ::= ‘:’ <context type> |
<context type>     ::= ‘body’ | ‘p0’ | ‘p’ | ‘r’ | ‘t’ | ‘tbl’ | ‘tr’ | ‘tc’
<xsl command expr> ::= <meta command> | <xsl command>
<meta command>     ::= ‘meta’ <meta sub command>
<meta sub command> ::= ‘up’ | ‘prev’ | ‘next’ | ‘cloneprev’ | ‘clonenext’ | ‘delete’
<xsl command>      ::= ‘for-each’ | ‘choose’ | ‘when’ | ‘otherwise’ | ‘if’ | ‘sort’ | ‘value-of’ | ‘text’
<xsl option expr>  ::= <text> | <xsl option name> ‘=’ <xsl option value>
<text>             ::= …
<xsl option name>  ::= ‘select’ | ‘test’
<xsl option value> ::=  xpath exprTo insert a list of a product names, just add
xsl:for-each select=.//products/* xsl:t:value-of select=name and format
the text with the XSL template.~~~~ {.python}
from lxml import etree
from docxxslt import DocxXsltTemplatecontext = etree.parse(“products.xml”)
template = DocxXsltTemplate(filename)
template.save(context=context)
~~~~Installing~~~~ {.bash}
pip install docx-xslt
~~~~
Package: dodata
DoData python library 0.4.3DoData offers a state-of-the-art data storage solution tailored specifically for chip design. Designed to seamlessly integrate into your workflow, the platform provides a scalable solution for storing, managing, and analyzing your chip data files.InstallationWe only support Python 3.11, and recommendVSCodeIDE.You will needAnaconda python.After installing python, open Anaconda Prompt as Administrator and install gdstk, psycopg2 and the rest of the dependencies using pip.conda install -c conda-forge psycopg2 -y
pip install "dodata[demos]" --upgradeSetupMake sure you create an.envfile in your working directory.dodata_url = 'https://your.dodata.url.here'
dodata_user = 'dodata_user'
dodata_password = 'dodata_web_password'
dodata_db = 'your.dodata.database.url.here'
dodata_db_user = "db_username_here"
dodata_db_password = "db_password_here"
dodata_db_name = "dodata"
data_db_port = 5432
debug = FalseThe.envfile can be in the same directory run the notebooks from or in a parent directory.Run notebooksFor running the notebooks you can useVSCodeor JupyterLab.For VSCode make sure you use the same conda python interpreter where you installed the packagesseeFor JupyterLab you can launchjupyter-labfrom the same terminal where you run the installation.Then, make sure you run the notebooks in order:1_generate_layout: generate GDS layout and CSV device manifest with device coordinates, settings and analysis.2_generate_measurement_data: generate CSV measurement data.3_upload_measurements: Upload wafer definitions and measurement data.4_download_data: Download analysis using conditional.5_delete: Delete data.