BookBot is a small Python command-line project that analyzes a text file and reports basic writing statistics. It was built as a learning project to practice reading files, counting words, and summarizing character frequency in a book or other text corpus.
Beginner-friendly project built around file reading, text processing, dictionaries, and sorting.
The repository contains:
- a Python entry script (main.py) that reads the file path passed in via the command line
- a helper module (stats.py) that holds the counting and sorting logic
- a books/ folder with sample texts for testing, including Frankenstein, Moby-Dick, and Pride and Prejudice
Given a path to a text file, BookBot:
- Reads the file contents
- Counts total words
- Counts how often each character appears
- Ignores non-letter characters in the final character report
- Prints a simple formatted summary to the terminal
This makes it useful for quick text analysis, especially with long works like novels, essays, or other plain-text documents.
python3 main.py books/frankenstein.txtThis will output a report similar to:
- total word count
- character frequency breakdown for alphabetic characters
- a header and summary section for the analyzed text
main.py— CLI entry point that reads the input file and prints the reportstats.py— helper functions for word and character countingbooks/— sample text files used for testing and demonstrationREADME.md— project overview and usage notes
The repository includes public-domain book texts such as:
- Frankenstein
- Moby-Dick
- Pride and Prejudice
These sample files let you run BookBot immediately without needing to add your own text files.
BookBot is a simple educational project designed to practice:
- Python file I/O
- string processing
- dictionaries and sorting
- command-line arguments
- writing readable command-line output
It is a good example of a lightweight data-processing script that turns raw text into useful insights.