A powerful tool for extracting and enhancing markdown content from web pages
Project description
Hunter
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
- Clone the repository
git clone https://github.com/joenandez/codename_hunter.git
cd codename_hunter
- Create a virtual environment
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
- 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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ed463b199c4e7f0cd3eca5bf6b2b97bcd39de12a7563c2470f5da9a165bca728
|
|
| MD5 |
27daa9ad63711cfac898d5e9b8f80912
|
|
| BLAKE2b-256 |
3cf282e4bd6b3df9ac79831edc9f4ab8375f856e5f25d3c925adac574aebced3
|
File details
Details for the file codename_hunter-0.1.3-py3-none-any.whl.
File metadata
- Download URL: codename_hunter-0.1.3-py3-none-any.whl
- Upload date:
- Size: 27.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.11.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
49233e81ef8f0a07535ff3389e8084f4ff97391a0572e1b0a4a9e2dfed10964d
|
|
| MD5 |
d352e47826f8fb07d7fb34fe6e553b92
|
|
| BLAKE2b-256 |
4dc0526efd574d81bfbc3d9e1267f140b63967c23f4d3cf06b194597af6fa6f6
|