auto-reporting / README.md
MATIAS Nicolas
readme patched
e76bbe3
|
Raw
History Blame Contribute Delete
6.98 kB
metadata
title: ITU Report Generator
emoji: πŸ“„
colorFrom: blue
colorTo: indigo
sdk: docker
pinned: false

ITU Report Generator

Automated generation of ITU-T meeting reports (Working Party reports and Question reports) from JSON configuration files. The system fetches data from the ITU website, generates LaTeX snippets, and produces ready-to-compile documents.

Features

  • Automatic data fetching from ITU website (documents, leadership, work programme)
  • LaTeX report generation for Working Party and Question reports
  • Web interface for easy report generation
  • Text wrapping in tables with automatic word breaking for long identifiers
  • Downloadable ZIP files with descriptive naming (report-SG17-WP1-DD-MM-YYYY.zip)

Prerequisites

  • Python 3.8+
  • Python packages: install with:
    pip install bs4 pycurl flask
    
  • LaTeX distribution (for PDF compilation): MiKTeX (Windows) or TeX Live (Linux/macOS)

Project Structure

auto-doc-latex/
β”œβ”€β”€ scripts-new/                    # Report generation scripts
β”‚   β”œβ”€β”€ generate_wp_report.py       # Working Party report generator
β”‚   β”œβ”€β”€ generate_question_report.py # Question report generator
β”‚   β”œβ”€β”€ WPReport.json               # Example WP config
β”‚   β”œβ”€β”€ questionReport.json         # Example Question config
β”‚   └── common/                     # Shared modules
β”‚       β”œβ”€β”€ config.py               # Configuration loading
β”‚       β”œβ”€β”€ itu_api.py              # ITU website data fetching
β”‚       β”œβ”€β”€ latex.py                # LaTeX formatting helpers
β”‚       β”œβ”€β”€ models.py               # Data models
β”‚       └── utils.py                # Utility functions
β”‚
β”œβ”€β”€ web-app/                        # Flask web application
β”‚   β”œβ”€β”€ app.py                      # Main Flask application
β”‚   β”œβ”€β”€ config.py                   # Web app configuration
β”‚   β”œβ”€β”€ requirements.txt            # Python dependencies
β”‚   β”œβ”€β”€ templates/                  # HTML templates
β”‚   β”œβ”€β”€ static/                     # CSS and JavaScript
β”‚   └── utils/                      # Web app utilities
β”‚
β”œβ”€β”€ wp_doc_template/                # WP report LaTeX template
β”‚   β”œβ”€β”€ main.tex                    # Main document entry point
β”‚   β”œβ”€β”€ chapters/                   # Chapter .tex files
β”‚   β”‚   └── variables/              # Auto-generated LaTeX snippets
β”‚   └── styles/                     # LaTeX style files
β”‚
└── question_doc_template/          # Question report LaTeX template
    β”œβ”€β”€ main.tex
    β”œβ”€β”€ chapters/
    β”‚   β”œβ”€β”€ 00-frontcover.tex
    β”‚   β”œβ”€β”€ 01-introduction.tex
    β”‚   β”œβ”€β”€ 02-executive-summary.tex
    β”‚   β”œβ”€β”€ 03-report-of-interim.tex
    β”‚   β”œβ”€β”€ 04-intellectual-property.tex
    β”‚   β”œβ”€β”€ 05-discussions.tex
    β”‚   β”œβ”€β”€ 06-draft-recommendations.tex
    β”‚   β”œβ”€β”€ 07-non-normative-text.tex
    β”‚   β”œβ”€β”€ 08-outgoing-liaison-statements.tex
    β”‚   β”œβ”€β”€ 09-work-programme.tex
    β”‚   β”œβ”€β”€ 10-candidate-work-items.tex
    β”‚   β”œβ”€β”€ 11-planned-interim-meetings.tex
    β”‚   β”œβ”€β”€ 12-scheduled-meetings.tex
    β”‚   β”œβ”€β”€ annex-a.tex, annex-b.tex, annex-c.tex
    β”‚   └── variables/              # Auto-generated LaTeX snippets
    └── styles/

Usage

Option 1: Web Interface (Recommended)

  1. Start the web application:

    cd web-app
    pip install -r requirements.txt
    python app.py
    
  2. Open your browser to http://localhost:5000

  3. Fill in the form:

    • Select report type (Working Party or Question)
    • Enter Study Group number, Working Party/Question number
    • Set meeting dates and location
  4. Click "Generate Report" to download a ZIP file containing the LaTeX template with generated content

Option 2: Command Line

Step 1: Create a JSON configuration file

For a Working Party report:

{
  "group": 17,
  "workingParty": 1,
  "place": "Geneva",
  "start": "2025/12/03",
  "end": "2025/12/11",
  "next_meeting": "2026/07/01"
}

For a Question report:

{
  "group": 17,
  "question": 10,
  "place": "Geneva",
  "start": "2025/12/03",
  "end": "2025/12/09",
  "next_meeting": "2026/07/01"
}

Step 2: Run the generation script

cd scripts-new

# For a Working Party report
python generate_wp_report.py WPReport.json

# For a Question report
python generate_question_report.py questionReport.json

The script will:

  1. Read the JSON configuration
  2. Fetch meeting data from the ITU website
  3. Generate LaTeX snippet files in the template's chapters/variables/ directory

Step 3: Fill in manual sections

Some sections require manual input. Look for:

  • \textit{For manual entry.} - sections to write by hand
  • \textit{TODO: write the observation here} - placeholders for observations
  • (manual entry) - editor fields to complete

Step 4: Compile the PDF

Using Overleaf: (Recommended)

  1. Compress the template directory into a .zip file
  2. Upload to Overleaf β†’ New Project β†’ Upload Project
  3. Set main.tex as the main document
  4. Click Recompile β†’ Download PDF

Using local LaTeX:

cd wp_doc_template  # or question_doc_template
latexmk -pdf main.tex

Configuration Reference

Working Party Report

Field Required Description
group Yes Study Group number (e.g., 17)
workingParty Yes Working Party number (e.g., 1)
start Yes Meeting start date (YYYY/MM/DD)
place yes Meeting location
end yes Meeting end date (YYYY/MM/DD)
next_meeting No Next meeting date (for filtering candidate work items)

Question Report

Field Required Description
group Yes Study Group number
question Yes Question number (e.g., 10)
start Yes Meeting start date (YYYY/MM/DD)
place yes Meeting location
end yes Meeting end date (YYYY/MM/DD)
next_meeting no Next meeting date (for filtering candidate work items)

Template Variables

Each chapter .tex file includes variables from the chapters/variables/ directory. Comments in the template files indicate:

  • Variable source: % Variable: \variableName -> chapters/variables/filename.tex
  • Table row format: % Row template: Col1 & Col2 & Col3 \\ \hline

Troubleshooting

  • Network errors: Ensure internet access and ITU website (www.itu.int) is reachable
  • Missing pycurl: On Windows, install a precompiled wheel from https://www.lfd.uci.edu/~gohlke/pythonlibs/#pycurl
  • LaTeX errors: Run latexmk -pdf -interaction=nonstopmode main.tex for detailed error messages
  • Long text overflow: Work item names use \seqsplit{} to break anywhere in columns