Skip to content

DocxWriter is a Python library for generating professional Word documents from JSON. Automate reports, add tables, lists, images, and apply custom styles — all from clean, structured data.

License

Notifications You must be signed in to change notification settings

Taha5125/DocxWriter-JSON

Repository files navigation

🌟 DocxWriter-JSON: Automate Your Document Creation with Ease 🌟

DocxWriter-JSON Python License

Welcome to DocxWriter-JSON, a powerful Python library designed to simplify the process of generating professional Word documents from structured JSON data. Whether you're creating reports, adding tables, or including images, DocxWriter-JSON makes document automation straightforward and efficient.

📦 Table of Contents

✨ Features

  • Automate Reports: Generate detailed reports with ease.
  • Structured Data: Use clean JSON data to create documents.
  • Custom Styles: Apply styles to your documents for a professional look.
  • Tables and Lists: Easily add tables and lists to your documents.
  • Images: Insert images seamlessly into your Word documents.
  • Cross-Platform: Works on any platform that supports Python.

🚀 Installation

To get started with DocxWriter-JSON, you need to have Python installed on your machine. You can install the library using pip. Open your terminal and run:

pip install docxwriter-json

🛠️ Usage

Using DocxWriter-JSON is simple. Here’s a basic example to get you started:

import json
from docxwriter import DocxWriter

# Load your JSON data
data = json.loads('{"title": "Monthly Report", "content": "This is the content of the report."}')

# Create a new document
doc = DocxWriter()

# Add a title
doc.add_heading(data['title'], level=1)

# Add content
doc.add_paragraph(data['content'])

# Save the document
doc.save('report.docx')

For more advanced usage, refer to the documentation.

📚 Examples

Here are a few more examples to showcase the capabilities of DocxWriter-JSON.

Example 1: Adding a Table

data = {
    "title": "Sales Report",
    "table": [
        ["Product", "Sales", "Revenue"],
        ["Product A", 30, "$300"],
        ["Product B", 20, "$200"]
    ]
}

doc = DocxWriter()
doc.add_heading(data['title'], level=1)
doc.add_table(data['table'])
doc.save('sales_report.docx')

Example 2: Inserting Images

data = {
    "title": "Company Overview",
    "image_path": "path/to/image.png"
}

doc = DocxWriter()
doc.add_heading(data['title'], level=1)
doc.add_image(data['image_path'])
doc.save('company_overview.docx')

🤝 Contributing

We welcome contributions to DocxWriter-JSON! If you would like to contribute, please follow these steps:

  1. Fork the repository.
  2. Create a new branch (git checkout -b feature/YourFeature).
  3. Make your changes.
  4. Commit your changes (git commit -m 'Add some feature').
  5. Push to the branch (git push origin feature/YourFeature).
  6. Open a pull request.

📜 License

This project is licensed under the MIT License. See the LICENSE file for details.

🆘 Support

For support, please check the Releases section for the latest updates and downloads.

You can also visit the GitHub Issues page to report bugs or request features.

🌐 Related Topics

  • Automation: Streamline your document creation process.
  • Document Automation: Create documents without manual effort.
  • Reporting: Generate reports from structured data.
  • Text Processing: Work with text in various formats.
  • Word Document Generation: Create professional documents easily.

🎉 Conclusion

DocxWriter-JSON is your go-to tool for automating document creation from JSON data. With its simple API and powerful features, you can generate reports, add tables, and insert images with minimal effort. Explore the possibilities and enhance your workflow today!

For more information, visit the Releases section to download the latest version and get started.

About

DocxWriter is a Python library for generating professional Word documents from JSON. Automate reports, add tables, lists, images, and apply custom styles — all from clean, structured data.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages