Skip to main content

The 10-Headed Web Browser - A powerful text-based browser for the terminal

Project description

๐Ÿ”ฑ Ravanan - The 10-Headed Web Browser ๐Ÿ”ฑ

 (                                 )             )  
 )\ )    (               (      ( /(   (      ( /(  
(()/(    )\     (   (    )\     )\())  )\     )\()) 
 /(_))((((_)(   )\  )\((((_)(  ((_)\((((_)(  ((_)\  
(_))   )\ _ )\ ((_)((_))\ _ )\  _((_))\ _ )\  _((_)      
| _ \  (_)_\(_)\ \ / / (_)_\(_)| \| |(_)_\(_)| \| |      
|   /   / _ \   \ V /   / _ \  | .` | / _ \  | .` |      
|_|_\  /_/ \_\   \_/   /_/ \_\ |_|\_|/_/ \_\ |_|\_|      

The 10-Minded Scholar King โ€ข Terminal Web Browser        
                v1.0.4 โ€ข By Krishna D

A powerful text-based web browser that runs entirely in your terminal. Named after the legendary Ravana from Hindu mythology, whose 10 heads represented vast knowledge and wisdom from multiple perspectives.

Created by: Krishna D

Python License Version PyPI


๐ŸŒŸ Why Ravanan?

Ravana, the legendary scholar-king, possessed 10 heads symbolizing mastery over different dimensions of knowledge. Similarly, Ravanan browser offers 10 powerful capabilities for navigating the web in a unique, terminal-based way!


๐Ÿ”ฑ The 10 Heads of Wisdom

Like Ravana's 10 heads representing different dimensions of knowledge, this browser offers 10 powerful capabilities:

  1. ๐ŸŒ Smart HTML Parsing - Extracts text, links, headers, lists, tables, and more
  2. โšก Fast HTTP Fetching - Quick and efficient web page loading with full HTTPS support
  3. ๐ŸŽจ Beautiful Rendering - Styled terminal output with colors and formatting
  4. ๐Ÿ”— Link Navigation - Jump to links by number, Lynx-style
  5. ๐Ÿ“œ History Management - Full back/forward browsing history
  6. ๐Ÿ” Advanced Search - Case-sensitive and case-insensitive search within pages
  7. โŒ Error Handling - Graceful handling of all web errors (404, timeouts, etc.)
  8. ๐Ÿ“Š Content Extraction - Clean extraction of meaningful content
  9. ๐Ÿ’Ž Clean Interface - Intuitive commands and beautiful UI with responsive banner
  10. ๐Ÿ’ช Terminal Power - Full-featured browsing without leaving your terminal

โœจ Additional Features

  • ๐Ÿ’พ Save Pages - Save current page as text file
  • ๐Ÿ“Š Statistics - View browsing statistics
  • โ„น๏ธ Page Info - Detailed information about current page
  • ๐Ÿ“‹ List All Links - Display all links on current page
  • ๐Ÿ†˜ Comprehensive Help - Detailed help system
  • ๐ŸŽฏ Multiple Commands - Many ways to accomplish the same task

๐Ÿš€ Installation

Option 1: Install from PyPI (Recommended)

pip install ravanan

After installation, you can run Ravanan from anywhere:

ravanan

Option 2: Install from Source

# Clone the repository
git clone https://github.com/krishna182005/ravanan.git
cd ravanan

# Install dependencies
pip install -r requirements.txt

# Run the browser
python3 -m ravanan

Option 3: Development Installation

# Clone the repository
git clone https://github.com/krishna182005/ravanan.git
cd ravanan

# Install in editable mode
pip install -e .

# Now you can run from anywhere
ravanan

๐ŸŽฎ Quick Start

Basic Usage

# Start with default page (duckduckgo.com)
ravanan

# Open a specific URL
ravanan wikipedia.org

# Open with full URL
ravanan https://news.ycombinator.com

# Set custom home page
ravanan --home https://stackoverflow.com

First Steps

  1. Navigate to a link: Type the link number (e.g., 1, 2, 3)
  2. Go to a URL: Type the URL directly (e.g., wikipedia.org)
  3. Search in page: Type /python to search for "python"
  4. Go back: Type b or back
  5. Get help: Type ? or help
  6. Quit: Type q or quit

๐Ÿ“– Commands Reference

Navigation Commands

Command Action
[number] Navigate to link by number (e.g., 1, 2, 3)
b, back Go back to previous page
f, forward Go forward to next page
h, home Go to home page
r, reload Reload current page
u, url Show current URL

URL Entry

Command Action
https://example.com Enter full URL with scheme
example.com Enter domain (https:// added automatically)
go [url] Navigate to URL (alternative)

Search & Discovery

Command Action
/[query] Case-insensitive search (e.g., /python)
//[query] Case-sensitive search
links List all links on current page

Information Commands

Command Action
info Show current page information
history Show browsing history
stats Show browser statistics
about About Ravanan browser

Utility Commands

Command Action
save Save current page as text file
clear Clear screen and redisplay page
version Show version information
?, help Show comprehensive help
q, quit, exit Quit browser


๐ŸŽฏ Example Session

# Start the browser
$ ravanan

# Ravanan banner appears...
# Browser starts at example.com

> wikipedia.org          # Visit Wikipedia
Loading Wikipedia...

> 3                      # Click link #3 (opens Featured Articles)
Loading...

> /python                # Search for "python" in page
Found 15 results for 'python'

> b                      # Go back to Wikipedia main page
Going back...

> f                      # Go forward to Featured Articles
Going forward...

> h                      # Return to home page
Going to home page...

> info                   # Show page information
Current Page: Featured Articles
URL: https://en.wikipedia.org/wiki/Featured_articles
Links: 127

> save                   # Save current page
Page saved to: featured_articles.txt

> q                      # Quit
Goodbye!

๐Ÿ“ Project Structure

ravanan/
โ”œโ”€โ”€ main.py                 # Main application entry point
โ”œโ”€โ”€ browser/
โ”‚   โ”œโ”€โ”€ __init__.py
โ”‚   โ”œโ”€โ”€ fetcher.py         # HTTP request handler
โ”‚   โ”œโ”€โ”€ parser.py          # HTML parser (BeautifulSoup)
โ”‚   โ”œโ”€โ”€ renderer.py        # Terminal UI renderer (rich)
โ”‚   โ””โ”€โ”€ navigator.py       # Navigation logic
โ”œโ”€โ”€ utils/
โ”‚   โ”œโ”€โ”€ __init__.py
โ”‚   โ”œโ”€โ”€ history.py         # Browsing history manager
โ”‚   โ””โ”€โ”€ banner.py          # Responsive ASCII banner
โ”œโ”€โ”€ requirements.txt       # Python dependencies
โ”œโ”€โ”€ setup.py              # Package configuration
โ”œโ”€โ”€ LICENSE               # MIT License
โ”œโ”€โ”€ CONTRIBUTING.md       # Contribution guidelines
โ””โ”€โ”€ README.md            # This file

Total Code: ~1,300 lines of Python


๐Ÿ› ๏ธ How It Works

1. Web Fetcher (browser/fetcher.py)

  • Uses requests library for HTTP/HTTPS requests
  • Handles redirects, timeouts, and errors (404, 403, 500, etc.)
  • Normalizes URLs and manages sessions
  • Configurable timeout and headers

2. HTML Parser (browser/parser.py)

  • Parses HTML using BeautifulSoup4 with lxml backend
  • Extracts text content, links, headings, lists, tables
  • Removes scripts, styles, and comments for clean text
  • Resolves relative URLs to absolute
  • Smart content extraction

3. Text Renderer (browser/renderer.py)

  • Uses rich library for beautiful terminal styling
  • Responsive ASCII banner that adapts to terminal width
  • Renders headings, paragraphs, links, blockquotes
  • Creates formatted tables for links
  • Displays headers, footers, and error messages
  • Color-coded content types

4. Navigator (browser/navigator.py)

  • Manages current page and links
  • Provides link lookup by index
  • Integrates with history for back/forward navigation

5. History Manager (utils/history.py)

  • Maintains browsing history stack
  • Supports back/forward navigation
  • Limits history size (default 100 pages)

6. Banner System (utils/banner.py)

  • Responsive ASCII art banner
  • Adapts to terminal width automatically
  • 4 different sizes: Full, Compact, Minimal, Tiny

๐ŸŒŸ Recommended Sites to Try

Works Great โญ

  • example.com - Perfect test site
  • info.cern.ch - First website ever (1991)
  • text.npr.org - NPR text-only version
  • lite.cnn.com - CNN lite version
  • old.reddit.com - Reddit old interface

Good Experience ๐Ÿ‘

  • wikipedia.org - Excellent in text mode
  • news.ycombinator.com - Hacker News
  • lobste.rs - Tech community
  • stackoverflow.com - Stack Overflow

Interesting ๐Ÿ”

  • wiby.me - Search engine for simple sites
  • 68k.news - Retro news aggregator
  • txti.es - Fast web pages

๐Ÿ’ก Use Cases

1. Accessibility

  • Screen reader friendly
  • Low bandwidth browsing
  • Terminal-only environments
  • SSH sessions

2. Development

  • Test website text content
  • Debug HTML structure
  • Quick web scraping prototype
  • Content extraction testing

3. Education

  • Learn web protocols
  • Understand HTML parsing
  • Practice Python development
  • Study HTTP requests

4. Privacy

  • No JavaScript tracking
  • No cookies (unless configured)
  • No image loading
  • Minimal footprint

๐Ÿ“ฆ Dependencies

All dependencies are automatically installed with pip install ravanan:

  • requests (โ‰ฅ2.31.0) - HTTP library for fetching web pages
  • beautifulsoup4 (โ‰ฅ4.12.0) - HTML parsing and extraction
  • rich (โ‰ฅ13.0.0) - Terminal formatting and styling
  • lxml (โ‰ฅ4.9.0) - Fast HTML/XML parser (BeautifulSoup backend)

๐Ÿค Contributing

Ravanan is an open-source project and contributions are welcome!

We love your input! We want to make contributing to Ravanan as easy and transparent as possible, whether it's:

  • Reporting a bug
  • Discussing the current state of the code
  • Submitting a fix
  • Proposing new features
  • Becoming a maintainer

How to Contribute

  1. Fork the repository on GitHub
  2. Clone your fork locally:
    git clone https://github.com/krishna182005/ravanan.git
    cd ravanan
    
  3. Create a feature branch:
    git checkout -b feature/amazing-feature
    
  4. Make your changes and test thoroughly
  5. Commit your changes:
    git commit -m 'Add amazing feature'
    
  6. Push to your fork:
    git push origin feature/amazing-feature
    
  7. Open a Pull Request on GitHub

Development Setup

# Clone the repository
git clone https://github.com/krishna182005/ravanan.git
cd ravanan

# Create a virtual environment (optional but recommended)
python -m venv venv
source venv/bin/activate  # On Windows: venv\Scripts\activate

# Install in development mode
pip install -e .

# Run tests
python test.py

Code Style

  • Follow PEP 8 guidelines
  • Add docstrings to functions and classes
  • Write meaningful commit messages
  • Add tests for new features

See CONTRIBUTING.md for detailed guidelines.


๐Ÿงช Testing

Ravanan includes a comprehensive test suite:

# Run all tests
python test.py

# Run specific test
python test_ravanan.py

Test Coverage:

  • โœ… WebFetcher - HTTP/HTTPS fetching
  • โœ… HTMLParser - HTML parsing and extraction
  • โœ… BrowsingHistory - Navigation history
  • โœ… Navigator - Link management
  • โœ… Integration - End-to-end workflows

๐Ÿ“ License

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

MIT License

Copyright (c) 2025 Krishna D

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.

๐Ÿš€ Roadmap (Future Enhancements)

Version 2.0 Plans

  • ๐Ÿ“š Bookmark System - Save and manage favorite pages
  • ๐Ÿ’พ Offline Caching - Cache visited pages for offline reading
  • ๐ŸŽจ Themes - Dark mode, light mode, custom color schemes
  • ๐Ÿ” Proxy Support - Browse through HTTP/SOCKS proxies
  • ๐Ÿ“ฅ Download Manager - Enhanced file saving
  • ๐Ÿช Cookie Support - Basic cookie handling
  • ๐Ÿ” Regex Search - Advanced search patterns
  • ๐Ÿ“‘ Tab Support - Multiple browsing sessions
  • โŒจ๏ธ Vim Keybindings - Vim-style shortcuts
  • ๐Ÿ“Š Progress Bars - Download progress indicators

Community Requested

Vote for features or suggest new ones in GitHub Issues!


๐Ÿ™ Acknowledgments

  • Inspired by Lynx - The original text-based web browser (1992)
  • Named after Ravana - The legendary 10-headed scholar-king
  • Built with โค๏ธ for terminal enthusiasts
  • Thanks to the Python community for amazing libraries
  • Special thanks to all contributors

๐Ÿ“ง Contact & Support


๐ŸŒŸ Star History

If you find Ravanan useful, please consider giving it a star on GitHub! โญ


Happy Browsing! ๐ŸŒโœจ

Made with โค๏ธ for the terminal by Krishna D


๐Ÿ“Š Project Stats

  • Development Time: ~3 hours
  • Total Lines of Code: ~1,300
  • Test Coverage: 100% of core modules
  • Dependencies: 4 (all stable, well-maintained)
  • Python Version: 3.8+
  • Platforms: Windows, Linux, macOS
  • License: MIT (Open Source)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ravanan-1.0.5.tar.gz (40.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ravanan-1.0.5-py3-none-any.whl (25.6 kB view details)

Uploaded Python 3

File details

Details for the file ravanan-1.0.5.tar.gz.

File metadata

  • Download URL: ravanan-1.0.5.tar.gz
  • Upload date:
  • Size: 40.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for ravanan-1.0.5.tar.gz
Algorithm Hash digest
SHA256 d74824dbd4e5b5ce049fe67882db94bdf80ae3902158758fcd82e1a055f739e7
MD5 7098ff268117704521abed42aa9ea12f
BLAKE2b-256 df2446e96af56d2df15793e1fbd1232ee3cb844d1c230f64b720a314db1b22d2

See more details on using hashes here.

Provenance

The following attestation bundles were made for ravanan-1.0.5.tar.gz:

Publisher: publish.yml on krishna182005/ravanan

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file ravanan-1.0.5-py3-none-any.whl.

File metadata

  • Download URL: ravanan-1.0.5-py3-none-any.whl
  • Upload date:
  • Size: 25.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for ravanan-1.0.5-py3-none-any.whl
Algorithm Hash digest
SHA256 e55b89697475cd7139ce1d7e86e0d2b7127ea108333b6a2d793669fa8619b3fc
MD5 092b3a2edb6974771db3c25100236cdb
BLAKE2b-256 f08af02512280af4e98a505d38c595a36bb34d1aa6614f7c055db76227d9ca08

See more details on using hashes here.

Provenance

The following attestation bundles were made for ravanan-1.0.5-py3-none-any.whl:

Publisher: publish.yml on krishna182005/ravanan

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page