A powerful tool for fetching and saving complete GitHub pull request conversations, including PR details, issue comments, review comments, and reviews.
- Fetch a single PR, multiple specific PRs, or the latest N PRs
- Save conversations in either Markdown or JSON format
- Uses GitHub token from
.envfile or command-line argument - Handles pagination for large PRs with many comments
- Customizable output directory and file naming
- Python 3.6+
- Required packages:
- requests
- python-dotenv
pip install pullpal-
Clone the repository
git clone https://github.com/TheRealFREDP3D/PullPal.git cd PullPal -
Install the package
pip install -e . -
Set up your GitHub token in a
.envfile or provide it via command line
After installation, you can use PullPal from the command line:
# Make sure you have a .env file with your GitHub token
# GITHUB_TOKEN=your_github_token_here
# Fetch a single PR
pullpal --pr 123
# Fetch multiple PRs
pullpal --prs 123,124,125
# Fetch the 10 most recently updated PRs
pullpal --latest 10
# Specify a custom output directory
pullpal --pr 123 --output-dir my_pr_data
# Save in JSON format instead of Markdown
pullpal --pr 123 --format json
# Override the token from .env file
pullpal --pr 123 --token YOUR_GITHUB_TOKEN
# Specify a different repository
pullpal --owner username --repo repository --pr 123You can also use PullPal as a library in your Python code:
from pullpal.PullPal import fetch_conversation, save_conversation
# Fetch a PR conversation
conversation = fetch_conversation("octocat", "hello-world", 123, "your_github_token")
# Save the conversation as Markdown
save_conversation(conversation, "pr-123.md", "md")
# Or save as JSON
save_conversation(conversation, "pr-123.json", "json")By default, the script saves conversations in Markdown format with the following structure:
# PR #123: Title of the PR
**Author:** username
**Created:** 2023-01-01T00:00:00Z
**Updated:** 2023-01-02T00:00:00Z
**State:** open
## Description
PR description text...
## Comments
### username - 2023-01-01T12:00:00Z
Comment text...
## Reviews
### username - 2023-01-01T13:00:00Z
**State:** APPROVED
Review text...
## Review Comments
### username - 2023-01-01T14:00:00Z
**Path:** path/to/file.py
**Line:** 42
Review comment text...You can also save in JSON format for programmatic processing.
- Output directory:
pr-conversation - Output file format:
{repo}-{pr-number}.md - Default repository owner:
octocat - Default repository name:
hello-world
You can override these defaults using command-line arguments.
- Archive PR discussions for future reference
- Create documentation from PR conversations
- Analyze PR patterns and communication
- Export GitHub data for offline use or migration
- Generate reports on PR activity
PullPal was originally developed as part of the Gemini-Code-Assist-PR-Poetry project, which collects poems generated by Gemini Code Assist in GitHub pull requests.