Skip to content

cunhabarbosa/condominium-declaration-generator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Condominium Declaration Generator

Python License Repo size Last commit

Generate condominium declaration documents in DOCX and PDF format from a Word template.

This tool replaces placeholders in a .docx file, preserves the original formatting as much as possible, and can optionally export the result to PDF with metadata.

Features

  • Generate .docx files from a Word template
  • Generate .pdf files from the generated .docx
  • Add PDF metadata
  • Fill placeholders automatically
  • Convert dates to Portuguese text
  • Convert money values to Portuguese text
  • Generate output filenames in the format:
    • YYYY-MM-DD - 1AP2.docx
    • YYYY-MM-DD - 1AP2.pdf

Motivation

Managing condominium administration often requires generating formal declaration documents for property transactions.

This tool automates the generation of these documents from a Word template, reducing manual work and ensuring consistent formatting.

Project structure

condominium-declaration-generator/
├─ main.py
├─ README.md
├─ requirements.txt
├─ config.example.json
├─ config.json          <-- local file, not committed
├─ template.docx        <-- not included in the repository
├─ src/
│  ├─ config_loader.py
│  ├─ date_utils.py
│  ├─ docx_generator.py
│  ├─ file_utils.py
│  ├─ fraction_utils.py
│  ├─ money_utils.py
│  └─ pdf_utils.py
└─ output/

Quick Start

git clone https://github.com/cunhabarbosa/condominium-declaration-generator
cd condominium-declaration-generator

pip install -r requirements.txt

cp config.example.json config.json

python main.py

Note:

  • Adjust the configuration in config.json if needed.
  • Make sure template.docx contains the required placeholders

Template placeholders

The template file must contain the following placeholders:

{{DATA_EXTENSO}}
{{DATA_CURTA}}
{{FRACAO}}
{{ANDAR}}
{{APART}}
{{DATA_LIQUIDACAO}}
{{VALOR_ANUAL}}
{{VALOR_ANUAL_EXTENSO}}
{{VALOR_MENSAL}}
{{VALOR_MENSAL_EXTENSO}}

License

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

Author

Created by Antonio Barbosa

About

Generate condominium declaration DOCX and PDF documents automatically from a Word template.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages