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.2.tar.gz (28.3 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.2-py3-none-any.whl (26.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: codename_hunter-0.1.2.tar.gz
  • Upload date:
  • Size: 28.3 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.2.tar.gz
Algorithm Hash digest
SHA256 db0653687774a592093f457e2f6f821505722db09baff345f18e5476682fc75e
MD5 d94102110d8e3153b85315565412c75c
BLAKE2b-256 d44b5558e99b0692cbfbd7604b228ceeb1cd0ba15466e8f3d15f8e4f80f35719

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for codename_hunter-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 e02055c474d86dc880d73013b7975571c2d1db8b7d84eb8053f589cc61402d3e
MD5 c1b55871df77f65cd394203961e08e3d
BLAKE2b-256 1bb3ba3b29736f4a15a0e123ecd0f5be705d09eab1d98ddbaf44c21bf24f52c5

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