textnomnom-py

Extract text from PDFs, PPTs, & URLs (with OCR support). Converts PPT to PDF & handles files or folders. 🦍

View on GitHub

TextNomNom v2.0

Version License: MIT

TextNomNom is a versatile, cross-platform tool for extracting text from various file formats. It features a powerful command-line interface and a user-friendly interactive menu, with a self-contained environment that handles all Python dependencies automatically.


Table of Contents

Features


Installation & Setup

Getting started is designed to be as simple as possible.

  1. Clone the Repository:
    git clone https://github.com/FurqanHun/textnomnom-py.git
    cd textnomnom-py
    
  2. (For Linux/macOS) Make the launcher executable:
    chmod +x textnomnom
    
  3. Run it!
    ./textnomnom
    

    The first time you run the script, it will automatically create its virtual environment and install all necessary Python libraries. Subsequent runs will be instant. You can run it with --config to modify the PATHS. --config or --version both run in stage 1, before the launcher checks/sets up the virtual environment.


External Dependencies (Manual Install)

For certain features, you still need to install system-level tools. The script may run without them, but the features might be limited.


Usage

You can run the application in two modes.

Interactive Mode

Simply run the command without any arguments to launch a guided menu.

./textnomnom

Command-Line (CLI) Mode

Provide a path or other arguments to run directly from the command line.

# Process a directory and save all text to one file with OCR
./textnomnom /path/to/my_docs -a --ocr-mix

# Scrape a website
./textnomnom https://example.com

# Get the version number instantly
./textnomnom --version

Configuration

To open the configuration file in your default editor, run:

./textnomnom --config

OR

./textnomnom --config=EDITOR

Where EDITOR is the name of your preferred editor.

Following is the Default Configuration File:

# app/config_manager.py

# --- Optional ---
# Define the path for the virtual environment.
# If set to None or not defined, it defaults to a 'venv' folder in the project root.
VENV_PATH = "venv"

# If you have installed drivers, update paths here. Use "" or None.
GECKO_DRIVER_PATH = None
CHROME_DRIVER_PATH = None

CHROMIUM_BASED_BROWSER_PATH = None
FIREFOX_BASED_BROWSER_PATH = None

# --- Optional ---
# Define the directory where logs will be stored.
# If this is not set, it will default to a 'logs/' folder.
LOG_DIRECTORY = "logs"

# --- Optional ---
# Set to True to enable logging to a file without console output.
# The --debug flag will override this and log to both file and console.
LOGS = False

# --- Optional ---
# Define where scraped web content will be saved.
# If this is set to None or is not defined, it will default to your system's Downloads folder.
SCRAPED_FILES_DIR = None


CLI Options

Argument Description
path Path to a file, directory, or a URL to process.
-a, --save-all Combine all extracted text from a directory into a single file.
--ocr Force OCR on image files.
--ocr-mix Extract both standard text and OCR text from PDFs and PPTX files.
--convert PDF Converts the PPT and PPTX into PDF (Supports directories)
--clear-log Clears the content of the log file.
--config[=editor] Opens the config file in the default editor (or a specified one).
-v, --version Shows the application’s version number.
--debug Enables detailed logging to the console and logs/textnomnom.log.
--verbose Shows detailed setup steps when the launcher runs.
-h, --help Shows the help message for command-line options.

License

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