Skip to main content

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

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. 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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

github_repo_analyzer-0.1.1.tar.gz (15.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

github_repo_analyzer-0.1.1-py3-none-any.whl (9.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: github_repo_analyzer-0.1.1.tar.gz
  • Upload date:
  • Size: 15.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.11.9

File hashes

Hashes for github_repo_analyzer-0.1.1.tar.gz
Algorithm Hash digest
SHA256 5397c0fc9c8bfef38ad2a32cb21cc11bb13ce578f3f16da7f563cc1c01bd5517
MD5 98abbb94f27c3eab9b6f6f665b4c5e7b
BLAKE2b-256 42d63e9de068199aca0b2e4872c536257e9e59533ac4c57e8e6e482ce3838370

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for github_repo_analyzer-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 6cc63edb845ac115d4fda4a70a7eb31a369a7c2e21510e47c33d1d3dc817c165
MD5 53e252e142ec3a348570c87b9a8a3dde
BLAKE2b-256 ed6346b48e59a9988fa4ad52610f284abb68352e7e3d92a92ada133e9212513d

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