Skip to main content

A CLI tool to search and read Wikipedia with AI-powered summaries

Project description

Wikish Banner

WikiSH ๐ŸŒ

Terminal Wikipedia Reader

License Python Build Contributions

WikiSH is a powerful command-line interface (CLI) tool that lets you search and read Wikipedia articles directly from your terminal.
It features a clean, rich interface and integrates with AI to provide concise summaries of long articles.


โœจ Features

  • ๐Ÿ” Fast Search: Instantly search Wikipedia for any topic.
  • ๐Ÿ“– Terminal Reader: Read full Wikipedia articles with beautiful Markdown formatting and a pager for easy navigation.
  • ๐Ÿค– AI Summarization: Generate 300-word summaries of any article using Llama 3 via Replicate.
  • ๐ŸŽจ Rich UI: Utilizes rich for a vibrant terminal experience with tables, panels, and colored output.

๐Ÿš€ Getting Started

Prerequisites

Installation

  1. Clone the repository:

    git clone https://github.com/yourusername/wikish.git
    cd wikish
    
  2. Install dependencies:

    pip install -r requirements.txt
    
  3. Configure Environment: Create a .env file in the root directory and add your Replicate API token:

    REPLICATE_API_TOKEN=your_token_here
    

๐Ÿ›  Usage

You can now run the tool using the simplified command:

.\wiki "Your Search Term"

Or using standard Python:

python main.py "Your Search Term"

Navigation

  • Article Selection: Enter the index number from the search results to read an article.
  • Reading: Use arrow keys or Space/PageDown to scroll through the article. Press q to exit the pager.
  • Actions:
    • s: Generate an AI summary.
    • n: Return to search results to pick another article.
    • q: Quit the application.

๐Ÿ“‚ Project Structure

wikish/
โ”œโ”€โ”€ src/                # Source code
โ”‚   โ””โ”€โ”€ wikish/         # Core package
โ”‚       โ”œโ”€โ”€ ai.py
โ”‚       โ”œโ”€โ”€ cli.py
โ”‚       โ”œโ”€โ”€ models.py
โ”‚       โ”œโ”€โ”€ search.py
โ”‚       โ””โ”€โ”€ utils.py
โ”œโ”€โ”€ examples/           # Sample outputs and usage examples
โ”œโ”€โ”€ main.py             # Entry point
โ”œโ”€โ”€ wiki.bat            # Windows shortcut
โ””โ”€โ”€ requirements.txt    # Project dependencies

๐Ÿ“ฆ Dependencies

  • typer: For CLI argument parsing.
  • rich: For beautiful terminal formatting.
  • nlpia2-wikipedia: For accessing Wikipedia content.
  • replicate: For AI-powered summaries.
  • python-dotenv: For managing environment variables.
  • mdv: For terminal markdown viewing.

๐Ÿ“ License

This project is open-source and available under the MIT License.

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

wikish-0.1.0.tar.gz (8.4 kB view details)

Uploaded Source

Built Distribution

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

wikish-0.1.0-py3-none-any.whl (8.0 kB view details)

Uploaded Python 3

File details

Details for the file wikish-0.1.0.tar.gz.

File metadata

  • Download URL: wikish-0.1.0.tar.gz
  • Upload date:
  • Size: 8.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.4

File hashes

Hashes for wikish-0.1.0.tar.gz
Algorithm Hash digest
SHA256 e2b795094f45335446b02530cbd6307d31de9fa578d9e5f12481e70e0943fa72
MD5 36100faf2bb53e35c2a88f3044b8b299
BLAKE2b-256 58b1c15ea87465c4ade112a16cd7009c90d4ceb9071847db7f3f14209ef74cab

See more details on using hashes here.

File details

Details for the file wikish-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: wikish-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 8.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.4

File hashes

Hashes for wikish-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ac41ddf92d08fb2f40f3721776d13053575970098e611668640f81c7da8ceb57
MD5 65447d77890d228610d294bef72fe5a6
BLAKE2b-256 af633c717efd2e2ee9b0aaa65b1a0a74edb71ee8342a3dee1b7d64efbb543020

See more details on using hashes here.

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