https://github.com/tutupharirabu/bookbot
Bookbot is a Python program that analyzes novels and prints a statistical report of the word and character usage found within
https://github.com/tutupharirabu/bookbot
learning-python python
Last synced: 7 months ago
JSON representation
Bookbot is a Python program that analyzes novels and prints a statistical report of the word and character usage found within
- Host: GitHub
- URL: https://github.com/tutupharirabu/bookbot
- Owner: tutupharirabu
- Created: 2025-03-20T22:51:47.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2025-03-26T03:20:57.000Z (about 1 year ago)
- Last Synced: 2025-05-01T14:48:26.704Z (11 months ago)
- Topics: learning-python, python
- Language: Python
- Homepage:
- Size: 7.81 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# BookBot
BookBot is a simple command-line tool that analyzes text files and provides word count and character frequency statistics.
## Description
BookBot is my first project from the [Boot.dev](https://www.boot.dev) curriculum. It's a Python program that reads text files (like books) and generates a report with:
- Total word count
- Character frequency count (alphabetic characters only, sorted by frequency)
## Features
- Count the total number of words in a text file
- Count and sort character frequencies
- Display a formatted report in the terminal
- Simple command-line interface
## Installation
Clone this repository to your local machine:
```bash
https://github.com/tutupharirabu/bookbot.git
cd bookbot
```
## Usage
Run the program by providing the path to the text file you want to analyze:
```bash
python main.py path/to/your/book.txt
```
### Example
```bash
python main.py books/frankenstein.txt
```
Output:
```
============ BOOKBOT ============
Analyzing book found at books/frankenstein.txt...
----------- Word Count ----------
Found 77986 total words
--------- Character Count -------
e: 46043
t: 30365
a: 26743
o: 25225
i: 24613
n: 24367
s: 21155
r: 20818
h: 19725
l: 12739
d: 12624
... (more characters)
============= END ===============
```
## Project Structure
- `main.py`: Entry point of the application
- `stats.py`: Contains functions for counting words and characters
## Dependencies
This project uses only Python standard libraries:
- sys