Skip to main content

A package for generating DOCX and XLSX files and zipping them.

Project description

File Generation

A Python package for generating DOCX and XLSX files from templates and zipping them.

Installation

pip install file-generation

Usage

from file_generation.generators import BaseDocxGenerator
from file_generation.core import MultiFileGenerationService

base_output_dir = "/path/to/output"
instance_id = 42
docx_context = {"company_name": "Example Corp", "date": "2025-01-31"}

docx_generator = BaseDocxGenerator(
    base_output_dir=base_output_dir,
    instance_id=instance_id,
    templates=["/path/to/template1.docx"],
    context=docx_context
)

service = MultiFileGenerationService(generators=[docx_generator])
zip_path = service.create_zip("output_files.zip")
print(f"ZIP created at: {zip_path}")

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

file_generation-0.2.0.tar.gz (3.5 kB view details)

Uploaded Source

Built Distribution

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

file_generation-0.2.0-py3-none-any.whl (4.5 kB view details)

Uploaded Python 3

File details

Details for the file file_generation-0.2.0.tar.gz.

File metadata

  • Download URL: file_generation-0.2.0.tar.gz
  • Upload date:
  • Size: 3.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.11

File hashes

Hashes for file_generation-0.2.0.tar.gz
Algorithm Hash digest
SHA256 be1786c6416aa160b0ab8a066b327cc3351bc8ebce0610be57fa0767d2c28b00
MD5 23da9bdaf85cf10658ff38c59f74063d
BLAKE2b-256 5df83994353e0610d23425f68e5043434d2cbf6eab05d28baa47d908b781b788

See more details on using hashes here.

File details

Details for the file file_generation-0.2.0-py3-none-any.whl.

File metadata

File hashes

Hashes for file_generation-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 5b9cd00fbaecb2f32e81bc50a9d7dc0ce11adececa23c2fab6e662d8ed31c401
MD5 6b95652a55ea00985f7f3b34fe387ad8
BLAKE2b-256 6fbef87a28e5e9e4bc7ff9d363e6e22d3d68dea0b11b88046b7dc9a1b032ca31

See more details on using hashes here.

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