Metadata-Version: 2.4
Name: wiclipedia
Version: 0.1.3
Summary: Minimalist Wikipedia CLI client for terminal dwellers.
Author: seto
License: AGPL-3.0-or-later
Project-URL: Source, https://github.com/seto/wiCLIpedia
Classifier: Development Status :: 5 - Production/Stable
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: License :: OSI Approved :: GNU Affero General Public License v3 or later (AGPLv3+)
Classifier: Environment :: Console
Classifier: Operating System :: OS Independent
Classifier: Intended Audience :: End Users/Desktop
Classifier: Topic :: Internet :: WWW/HTTP :: Dynamic Content :: Wiki
Classifier: Topic :: Terminals
Classifier: Topic :: Utilities
Requires-Python: >=3.11
Description-Content-Type: text/markdown
License-File: LICENSE
Provides-Extra: dev
Requires-Dist: black~=26.3; extra == "dev"
Requires-Dist: build~=1.5; extra == "dev"
Requires-Dist: invoke~=3.0; extra == "dev"
Requires-Dist: isort~=8.0; extra == "dev"
Requires-Dist: pytest~=9.0; extra == "dev"
Requires-Dist: pytest-cov~=7.1; extra == "dev"
Requires-Dist: twine~=6.2; extra == "dev"
Dynamic: license-file

<h1 align="center">WiCLIpedia</h1>

<p align="center">
  <a href="LICENSE"><img src="https://img.shields.io/badge/license-AGPL--3.0+-blue.svg" alt="License: AGPL-3.0-or-later"></a>
  <a href="https://pypi.org/project/wiclipedia/"><img src="https://img.shields.io/pypi/v/wiclipedia.svg?maxAge=86400&color=blue" alt="Version"></a>
  <a href="https://pypi.org/project/wiclipedia"><img src="https://img.shields.io/pypi/pyversions/wiclipedia.svg" alt="Supported Versions"></a>
  <a href="https://github.com/seto/wiCLIpedia/actions"><img src="https://github.com/seto/wiCLIpedia/workflows/CI/badge.svg" alt="CI"></a>
  <a href="https://github.com/psf/black"><img src="https://img.shields.io/badge/code_style-black-000000.svg" alt="Code Style: Black"></a>
</p>

This is a minimalist command line interface (CLI) program to fetch and display data from
Wikipedia.

_In an era where Artificial Intelligence answers everything and large language models
shape our knowledge, this program is a small tribute to Wikipedia, the silent,
human-curated backbone that feeds those very models. Never forget the source._

---

<p align="center">
  <img src="https://github.com/user-attachments/assets/e586fd5b-7d1e-444d-92fa-deebc72c7429" width="600" alt="Demo">
</p>

---

## Features

- Fetches and displays article summaries and table of contents
- Navigates article sections interactively
- Handles redirects and disambiguation pages automatically
- Supports multiple Wikipedia languages
- Caches responses locally to minimize API calls
- ANSI colors and styles for enhanced readability (can be disabled)

## Installation

```bash
pip install wiclipedia
```

## Usage

```bash
wicli "Blade Runner"
```

If no page title is provided, the program will prompt you to enter one interactively.

You will be interactively prompted to navigate through the article summary sections.  
To navigate, use the section numbers shown in the table of contents.

If the query matches a disambiguation page, you will be prompted to select the intended
article from a list of options.

By default, it fetches the English Wikipedia.  
To specify a different language, use the `-l` or `--lang` option:

```bash
wicli "La classe operaia va in paradiso" --lang it
```

Available commands during navigation:

- `:b` — Go back to the start prompt
- `:q` — Exit the program
- `:m` — Show the table of contents menu (only available when navigating sections)

## Options

| Option         | Description                                          |
| -------------- | ---------------------------------------------------- |
| `page`         | Wikipedia page title (optional, prompted if omitted) |
| `-l`, `--lang` | Language code (default: `en`)                        |
| `--no-cache`   | Disable local cache for the session                  |
| `--purge`      | Purge local cache and exit                           |

## Cache

Responses are cached locally for 72 hours to reduce API calls.  
The cache is stored in `~/.cache/wiclipedia/`.  
Use `--no-cache` to bypass it for a session, or `--purge` to clear it entirely.

## Display

ANSI colors and styles are enabled by default.  
Set the `NO_COLOR` environment variable to disable them (see
[no-color.org](https://no-color.org)).

## API Respect and Fair Use Disclaimer

WiCLIpedia interfaces directly with the official Wikipedia PHP/MediaWiki APIs without
using any third-party scraping libraries.  
Please use this program responsibly. If you need to perform massive automated data
extraction, use official database dumps instead of hammering the live API.

WiCLIpedia caches responses locally for 72 hours by default to minimize API load. Check
the [Cache](#cache) section for details.

More information about the MediaWiki API and usage guidelines:

- [API Documentation](https://www.mediawiki.org/wiki/API:Main_page)
- [API Etiquette](https://www.mediawiki.org/wiki/API:Etiquette)

## License

This program is licensed under the
[GNU Affero General Public License v3.0 or later](https://www.gnu.org/licenses/agpl-3.0.html)
(AGPL-3.0+).  
See the [LICENSE](LICENSE) file for details.
