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.1.tar.gz (27.4 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.1-py3-none-any.whl (25.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: codename_hunter-0.1.1.tar.gz
  • Upload date:
  • Size: 27.4 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.1.tar.gz
Algorithm Hash digest
SHA256 15556fc9734dd6e94252f2d37fe2aeae421bae6d3a466512fd2605a1be09dc26
MD5 f51dec0beca0a54db38e9b70eb0ee581
BLAKE2b-256 0e649589a8dfa0d16c0a989555facc6f4db0294781f3a9ea9f8d6692f2c928ee

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for codename_hunter-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 2fef862603d490c86d63d149ab89a4df8748222d698223edfd919227352add83
MD5 683fdad97258077f804e600244ea08e4
BLAKE2b-256 5db9801eda28eca947579d7c582dda8a1ba8fa06b3590604ef9ec6430ab3fb2b

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