GitHub - python-openxml/python-docx: Create and modify Word documents with Python (original) (raw)
Navigation Menu
Appearance settings
- AI CODE CREATION
* GitHub CopilotWrite better code with AI
* GitHub SparkBuild and deploy intelligent apps
* GitHub ModelsManage and compare prompts
* MCP RegistryNewIntegrate external tools - DEVELOPER WORKFLOWS
* ActionsAutomate any workflow
* CodespacesInstant dev environments
* IssuesPlan and track work
* Code ReviewManage code changes - APPLICATION SECURITY
* GitHub Advanced SecurityFind and fix vulnerabilities
* Code securitySecure your code as you build
* Secret protectionStop leaks before they start - EXPLORE
* Why GitHub
* Documentation
* Blog
* Changelog
* Marketplace
- AI CODE CREATION
- BY COMPANY SIZE
* Enterprises
* Small and medium teams
* Startups
* Nonprofits - BY USE CASE
* App Modernization
* DevSecOps
* DevOps
* CI/CD
* View all use cases - BY INDUSTRY
* Healthcare
* Financial services
* Manufacturing
* Government
* View all industries
- BY COMPANY SIZE
- EXPLORE BY TOPIC
* AI
* Software Development
* DevOps
* Security
* View all topics - EXPLORE BY TYPE
* Customer stories
* Events & webinars
* Ebooks & reports
* Business insights
* GitHub Skills - SUPPORT & SERVICES
* Documentation
* Customer support
* Community forum
* Trust center
* Partners
- EXPLORE BY TOPIC
- COMMUNITY
* GitHub SponsorsFund open source developers - PROGRAMS
* Security Lab
* Maintainer Community
* Accelerator
* Archive Program - REPOSITORIES
* Topics
* Trending
* Collections
- COMMUNITY
- Pricing
Provide feedback
We read every piece of feedback, and take your input very seriously.
Include my email address so I can be contacted
Saved searches
Use saved searches to filter your results more quickly
Appearance settings
python-openxml / python-docx Public
- Notifications You must be signed in to change notification settings
- Fork1.3k
- Star 5.3k
Create and modify Word documents with Python
License
5.3k stars 1.3k forks Branches Tags Activity
Notifications You must be signed in to change notification settings
Additional navigation options
Folders and files
Repository files navigation
python-docx
python-docx is a Python library for reading, creating, and updating Microsoft Word 2007+ (.docx) files.
Installation
pip install python-docx
Example
from docx import Document
document = Document() document.add_paragraph("It was a dark and stormy night.") <docx.text.paragraph.Paragraph object at 0x10f19e760> document.save("dark-and-stormy.docx")
document = Document("dark-and-stormy.docx") document.paragraphs[0].text 'It was a dark and stormy night.'
More information is available in the python-docx documentation
About
Create and modify Word documents with Python
Resources
License
Stars
Watchers
Forks
Releases
Packages
No packages published