Skip to content

Salvodif/Footnotify

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

9 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ“ Footnotify - DOCX and ODT Footnote Extractor

TomeTrove Logo

License: MIT Python Version GitHub stars GitHub issues GitHub forks

This Python script extracts all footnotes from a Microsoft Word (.docx) or OpenDocument Text (.odt) file and lists them sequentially in a new .odt file. It attempts to preserve basic text formatting (bold, italic, underline) and uses the Rich library for an enhanced, interactive command-line experience.


πŸš€ Features

  • Extracts footnotes from both .docx and .odt files.
  • Preserves basic formatting: bold, italic, and underline.
  • Generates a new .odt file containing a sequential list of all extracted footnote contents.
  • πŸ’¬ Interactive CLI: Prompts the user for the file to process.
  • πŸ’… Readable terminal output with progress bars, using the Rich library.
  • πŸ”„ Process multiple files in a single session.
  • πŸ’Ύ Generated output files are named based on the input file (e.g., footnotes_da_original_name.odt) and placed in the output_footnotes/ directory.

πŸ“¦ Installation

  1. Clone this repository or download the script.
  2. (Optional, but Recommended) Create and activate a Python virtual environment:
    python -m venv venv
    
    # On Linux / macOS
    source venv/bin/activate
     
    # On Windows (Command Prompt / PowerShell)
    .\venv\Scripts\activate 
  3. Install the required Python libraries:
    pip install python-docx odfpy rich

πŸ’» Command Line Usage

  1. Navigate to the script's directory in your terminal.

  2. Run the script:

    python your_script_name.py 

    (Replace your_script_name.py with the actual name of your Python file, e.g., extract_notes.py)

  3. The script will then guide you through an interactive session:

    • It will prompt you to enter the path to the .docx or .odt file you wish to analyse.
      β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
      β”‚ Inserisci il percorso del file .odt o .docx da analizzare (o 'esci' β”‚
      β”‚ per terminare)                                                     β”‚
      β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
      > your_document.odt
      
    • Enter the full or relative path and press Enter.
    • The script will process the file and save the results to a new .odt file inside the output_footnotes/ sub-directory.
    • To stop the script and exit, type esci (or exit/quit if you modify the script) at the prompt and press Enter.

⚠️ Limitations

  • Formatting: This script ONLY preserves basic bold, italic, and underline formatting. It does NOT currently preserve other formatting such as:
    • Fonts, colours, or text sizes.
    • Lists (bulleted or numbered).
    • Tables.
    • Images.
    • Hyperlinks.
    • Paragraph alignment, indentation, or spacing.
  • Structure: The script generates a simple, sequential LIST of the footnote text in a new document. It does NOT replicate the footnote reference markers (ΒΉ, Β², Β³) within a copy of the main text, nor does it place the extracted notes into the page-footer layout of the output ODT.
  • Style Complexity: Complex or inherited styles, especially within ODT documents, may not be fully or correctly interpreted beyond the basic formatting checks implemented.

πŸ™Œ Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.


πŸ“œ License

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

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages