Convert GitHub repositories to markdown with detailed analysis
Project description
GitHub Repository Analyzer
A Python package for analyzing GitHub repositories and generating detailed markdown reports. This tool helps you understand repository structure, calculate token counts, and generate comprehensive documentation.
Features
- Generate comprehensive source tree visualization
- Calculate total token count using OpenAI's tiktoken library
- Provide file type statistics and repository summaries
- Support parallel processing for faster analysis
- Handle multiple programming languages
- Exclude common non-code directories
- Generate beautiful markdown reports
Installation
pip install github-repo-analyzer
Quick Start
As a Python Package
from github_repo_analyzer import analyze_github_repo
# Analyze a single repository
report = analyze_github_repo("https://github.com/username/repo")
print(report)
# Batch analyze multiple repositories
from github_repo_analyzer import batch_analyze_repos
repos = ["https://github.com/user1/repo1", "https://github.com/user2/repo2"]
results = batch_analyze_repos(repos)
Command Line Interface
# Analyze a single repository
repo-analyzer --url https://github.com/username/repo
# Analyze multiple repositories from a file
repo-analyzer --batch repos.txt
# Use custom configuration
repo-analyzer --url https://github.com/username/repo --config config.json
# Save output to file
repo-analyzer --url https://github.com/username/repo --output report.md
Configuration
Create a config.json file to customize the analysis:
{
"extensions": [".py", ".js", ".ts"],
"exclude_dirs": [".git", "node_modules"],
"max_file_size": 1048576,
"token_encoding": "cl100k_base",
"max_workers": 4,
"output_format": "markdown"
}
Contributing
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
License
This project is licensed under the MIT License - see the LICENSE file for details.
Acknowledgments
- OpenAI's tiktoken library for token counting
- GitPython for repository handling
Project details
Release history Release notifications | RSS feed
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 github_repo_analyzer-0.1.0.tar.gz.
File metadata
- Download URL: github_repo_analyzer-0.1.0.tar.gz
- Upload date:
- Size: 3.5 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.11.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
18dea252c5df0eb2cc18fbced52e5c50e2eddc63ffe0382d9499fc0efc6ffa15
|
|
| MD5 |
ceba3cf32685f9bcfbed50179528ad55
|
|
| BLAKE2b-256 |
e1f8ef4d5551b1f6cba75c8364407723e7731ad2e00ea1e1c743aaf50a1b2694
|
File details
Details for the file github_repo_analyzer-0.1.0-py3-none-any.whl.
File metadata
- Download URL: github_repo_analyzer-0.1.0-py3-none-any.whl
- Upload date:
- Size: 7.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.11.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cbe15bf6b772d45504812f269b08346da0a1f07bfb6ecfb5f9d20ef138a58560
|
|
| MD5 |
8cc1eb3a09e4f8416e6e3e96d2343367
|
|
| BLAKE2b-256 |
125edde3904aed49a7eab6918f1fbf49cb254578c4015aad7ae0a0cb58406c7c
|