Skip to main content

A project for adding an information block to an MS .docx file

Project description

About

This project was created to add additional information, specified in a certain format, to existing .docx files.

Documentation

Example

Example Image

# Import the AddDocx class from the sbi_special_docx_master module
from sbi_special_docx_master import AddDocx

# Import the Document class from the python-docx library
from docx import Document

# Specify the path to the DOCX file you want to open
add_file = "Your_file.docx"

# Load the DOCX file into a Document object
doc = Document(add_file)

# Create a dictionary with the information that will be added to the document.
# This dictionary contains a list under the key 'separate_information_relations'.
# Each item in the list is a dictionary with 'content', 'images', and 'title'.
info_dict = {
    'separate_information_relations': [
        {
            'content': 'str',  # Some text content
            'images': [        # A list of images (each is a dictionary)
                {
                    'file': '<Base64>'  # Base64-encoded image string
                }
            ],
            'title': 'str'     # Title for this section
        },
        {
            'content': 'str',  # Another text content
            'images': [
                {
                    'file': int,  # This seems unusual; normally you'd expect a Base64 string here
                }
            ],
            'title': 'str'
        }
    ]
}

# Initialize the AddDocx object with the document and the provided info dictionary
spec = AddDocx(doc, info_dict)

# Save the modified document to a new file
spec.save('my_file.docx')

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

sbi_special_docx_master-25.3.3.tar.gz (12.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

sbi_special_docx_master-25.3.3-py3-none-any.whl (13.8 kB view details)

Uploaded Python 3

File details

Details for the file sbi_special_docx_master-25.3.3.tar.gz.

File metadata

  • Download URL: sbi_special_docx_master-25.3.3.tar.gz
  • Upload date:
  • Size: 12.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for sbi_special_docx_master-25.3.3.tar.gz
Algorithm Hash digest
SHA256 53d5954c262ad930869ee14d71357764b6faca14a97716c24bd8174cbb978509
MD5 b99326b24cf2ccb2ea8849cffc66223e
BLAKE2b-256 64827674751b9799762eecc214e40847ec5bea13cfafdc1fef4e81678f71377f

See more details on using hashes here.

Provenance

The following attestation bundles were made for sbi_special_docx_master-25.3.3.tar.gz:

Publisher: python-publish.yml on TheDanielll/sbi_special_docx_master

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file sbi_special_docx_master-25.3.3-py3-none-any.whl.

File metadata

File hashes

Hashes for sbi_special_docx_master-25.3.3-py3-none-any.whl
Algorithm Hash digest
SHA256 ccf7217981e35650871f8293cce123df6cf1910bbd5dad1eeb3af0f89e281598
MD5 0cefec55e4b315da69734aab5d3379d4
BLAKE2b-256 d4956411abc81fab1fe12b49b673549b4f3ead2b9afb1786c66334e1f73d653c

See more details on using hashes here.

Provenance

The following attestation bundles were made for sbi_special_docx_master-25.3.3-py3-none-any.whl:

Publisher: python-publish.yml on TheDanielll/sbi_special_docx_master

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page