BookBot
A command-line tool for analyzing text files. Give it any document and it returns a word count plus a sorted character frequency table. My first Boot.dev project.
Features
- Total word count
- Character frequency analysis (case-insensitive)
- Results sorted by frequency, highest to lowest
- Works with any plain text file
- No external dependencies — pure Python stdlib
Usage
python3 main.py books/frankenstein.txtOutput:
============ BOOKBOT ============
Analyzing book at: books/frankenstein.txt
=================================
Found 73115 total words
--------- Character Count -------
e: 46043
t: 30365
a: 26743
...
============= END ===============How It Works
- Read the file into a string
- Split on whitespace to count words
- Iterate over every character, incrementing a frequency counter (lowercased)
- Sort the counter by value descending
- Print the formatted report
Tech Stack
- Language: Python
- Libraries: Python stdlib only (
sys,os)