Skip to main content

A powerful tool for extracting and enhancing markdown content from web pages

Project description

Hunter

Hunter Logo

Build Status License Python Version Code Style Last Commit

Hunter (package name: codename_hunter) makes it easy to convert any web page content into clean, well-formatted Markdown. Built primarily for passing web page content to AI Code Editing tools, but useful for any web content to Markdown conversion needs.

Table of Contents

Features

  • ๐Ÿ” Smart Content Extraction: Seamlessly extract structured content (headings, paragraphs, lists, code blocks, links, images) from any web page.
  • ๐Ÿค– AI-Powered Enhancement: Optional integration with Together.ai to automatically refine and enhance Markdown formatting
  • ๐Ÿ“‹ Clipboard Integration: Instantly copy the processed Markdown content to your clipboard
  • ๐Ÿ’พ File Saving: Save extracted content to disk with automatic URL-based filenames and timestamps - helpful when working with AI Code Editors that support file tagging for context.

Installation

Prerequisites

  • Python 3.8+
  • pip (Python package installer)

Install from PyPI

pip install codename_hunter  # Installs as 'hunter' command-line tool

Install from Source

git clone https://github.com/joenandez/codename_hunter.git
cd codename_hunter
pip install -e .

Package Name Note

While the package is named codename_hunter on PyPI, you'll use it simply as hunter in your terminal:

# Install the package
pip install codename_hunter

# Use the tool
hunter https://example.com/article

Usage

Hunter provides a simple command-line interface to extract and enhance Markdown content from web pages.

Basic Usage

# Extract and enhance content from a URL (copies to clipboard)
hunter https://example.com/article

# Save output to disk (defaults to "hunter_docs" folder)
hunter https://example.com/article -d

# Save to a custom folder
hunter https://example.com/article -d custom_folder

# Save to disk and force directory creation
hunter https://example.com/article -d custom_folder --force-dir

# Extract without AI enhancement
hunter https://example.com/article --no-enhance

# Extract without copying to clipboard
hunter https://example.com/article --no-copy

Command Options

  • -d/--save-to-disk [folder]: Save output to disk (defaults to "hunter_docs")
  • --force-dir: Create output directory without prompting
  • --no-enhance: Disable AI-powered content enhancement
  • --no-copy: Disable automatic copying to clipboard

Configuration

Hunter uses environment variables and an optional .env file for configuration.

Together AI Configuration

To enable AI-powered enhancements, you need a Together.ai API key.

Method 1: Environment Variable (Recommended)

export TOGETHER_API_KEY='your_api_key_here'  # On Windows: set TOGETHER_API_KEY=your_api_key_here

To unset the API key:

unset TOGETHER_API_KEY  # On Unix/macOS
set TOGETHER_API_KEY=   # On Windows

Method 2: .env File

Create a .env file in your working directory:

TOGETHER_API_KEY=your_api_key_here

Additional Settings

# Model Selection
TOGETHER_MODEL=mistralai/Mistral-7B-Instruct-v0.2

# Token Limits
TOGETHER_MAX_TOKENS=4000

# Temperature Setting
TOGETHER_TEMPERATURE=0.1

# Output Format
OUTPUT_FORMAT=markdown

# Console Style (dark/light)
CONSOLE_STYLE=dark

Development

Setup Development Environment

  1. Clone the repository
git clone https://github.com/joenandez/codename_hunter.git
cd codename_hunter
  1. Create a virtual environment
python -m venv venv
source venv/bin/activate  # On Windows: venv\Scripts\activate
  1. Install development dependencies
pip install -e ".[dev]"

Project Structure

codename_hunter/
โ”œโ”€โ”€ hunter/
โ”‚   โ”œโ”€โ”€ __init__.py
โ”‚   โ”œโ”€โ”€ __main__.py
โ”‚   โ”œโ”€โ”€ main.py
โ”‚   โ”œโ”€โ”€ constants.py
โ”‚   โ”œโ”€โ”€ formatters.py
โ”‚   โ”œโ”€โ”€ parsers.py
โ”‚   โ””โ”€โ”€ utils/
โ”‚       โ”œโ”€โ”€ ai.py
โ”‚       โ”œโ”€โ”€ errors.py
โ”‚       โ”œโ”€โ”€ fetcher.py
โ”‚       โ””โ”€โ”€ progress.py
โ”œโ”€โ”€ tests/
โ”‚   โ”œโ”€โ”€ test_parsers.py
โ”‚   โ”œโ”€โ”€ test_formatters.py
โ”‚   โ””โ”€โ”€ test_utils.py
โ”œโ”€โ”€ project_docs/      # Project documentation
โ”œโ”€โ”€ hunter_docs/       # Generated documentation
โ”œโ”€โ”€ assets/           # Project assets
โ”œโ”€โ”€ .github/          # GitHub configuration
โ”œโ”€โ”€ README.md
โ”œโ”€โ”€ CHANGELOG.md
โ”œโ”€โ”€ CONTRIBUTING.md
โ”œโ”€โ”€ LICENSE
โ””โ”€โ”€ pyproject.toml

Testing

Run the test suite:

pytest

Contributing

This project is currently in a read-only state and is not accepting pull requests. However, we welcome:

  • Bug reports and feature requests through GitHub Issues
  • Questions and discussions in the Issues section
  • Using and forking the project for your own needs

See CONTRIBUTING.md for more details about this policy and how to effectively report issues.

License

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

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

codename_hunter-0.1.3.tar.gz (29.8 kB view details)

Uploaded Source

Built Distribution

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

codename_hunter-0.1.3-py3-none-any.whl (27.2 kB view details)

Uploaded Python 3

File details

Details for the file codename_hunter-0.1.3.tar.gz.

File metadata

  • Download URL: codename_hunter-0.1.3.tar.gz
  • Upload date:
  • Size: 29.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.11.11

File hashes

Hashes for codename_hunter-0.1.3.tar.gz
Algorithm Hash digest
SHA256 ed463b199c4e7f0cd3eca5bf6b2b97bcd39de12a7563c2470f5da9a165bca728
MD5 27daa9ad63711cfac898d5e9b8f80912
BLAKE2b-256 3cf282e4bd6b3df9ac79831edc9f4ab8375f856e5f25d3c925adac574aebced3

See more details on using hashes here.

File details

Details for the file codename_hunter-0.1.3-py3-none-any.whl.

File metadata

File hashes

Hashes for codename_hunter-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 49233e81ef8f0a07535ff3389e8084f4ff97391a0572e1b0a4a9e2dfed10964d
MD5 d352e47826f8fb07d7fb34fe6e553b92
BLAKE2b-256 4dc0526efd574d81bfbc3d9e1267f140b63967c23f4d3cf06b194597af6fa6f6

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