{"id":31543736,"url":"https://github.com/oguzhancetinkaya/github-repo-structure","last_synced_at":"2026-05-17T17:02:46.624Z","repository":{"id":270186210,"uuid":"909543457","full_name":"OguzhanCetinkaya/github-repo-structure","owner":"OguzhanCetinkaya","description":"A Python utility for cloning GitHub repositories and generating a JSON-friendly representation of their directory structure, with support for .gitignore rules, customizable exclude patterns, and private repositories. Ideal for developers looking to analyze and visualize repository layouts efficiently.","archived":false,"fork":false,"pushed_at":"2025-02-18T17:34:25.000Z","size":21,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-04-03T15:29:47.862Z","etag":null,"topics":["code-repo-analysis","github","llm"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/OguzhanCetinkaya.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2024-12-29T02:56:51.000Z","updated_at":"2025-02-18T17:34:27.000Z","dependencies_parsed_at":"2024-12-29T07:20:58.554Z","dependency_job_id":"a757a326-6246-4f64-ba8b-545b34d21220","html_url":"https://github.com/OguzhanCetinkaya/github-repo-structure","commit_stats":null,"previous_names":["oguzhancetinkaya/github-repo-structure"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/OguzhanCetinkaya/github-repo-structure","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OguzhanCetinkaya%2Fgithub-repo-structure","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OguzhanCetinkaya%2Fgithub-repo-structure/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OguzhanCetinkaya%2Fgithub-repo-structure/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OguzhanCetinkaya%2Fgithub-repo-structure/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/OguzhanCetinkaya","download_url":"https://codeload.github.com/OguzhanCetinkaya/github-repo-structure/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OguzhanCetinkaya%2Fgithub-repo-structure/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33147339,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-17T09:28:26.183Z","status":"ssl_error","status_checked_at":"2026-05-17T09:27:52.702Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["code-repo-analysis","github","llm"],"created_at":"2025-10-04T12:42:18.939Z","updated_at":"2026-05-17T17:02:46.591Z","avatar_url":"https://github.com/OguzhanCetinkaya.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# GitHub Repository Structure Analyzer\n\nA Python utility for cloning GitHub repositories and generating a JSON-friendly representation of their directory structure. This tool provides a clean way to analyze repository layouts while respecting `.gitignore` rules and offering customizable exclude patterns for different project types.\n\n## Features\n\n- Clone GitHub repositories with progress visualization\n- Generate nested JSON representation of repository structure\n- Support for private repositories via GitHub tokens\n- Respect `.gitignore` patterns\n- Configurable depth limit for directory traversal\n- Pre-defined exclude patterns for common project types (Python, Node.js, Java)\n- Progress bar visualization during cloning using `alive-progress`\n- Handles symlinks and special files appropriately\n\n## Installation\n\n### Prerequisites\n\nMake sure you have Python 3.6+ installed. Then install the required dependencies:\n\n```bash\npip install -r requirements.txt\n```\n\n## Usage\n\n### Basic Usage\n\n```python\nfrom repo_structure import get_repo_structure\n\n# Simple example with default settings\nstructure = get_repo_structure(\n    github_url=\"https://github.com/username/repo.git\",\n    clone_path=\"local_repo_folder\"\n)\n```\n\n### Advanced Usage\n\n```python\nfrom repo_structure import get_repo_structure, PROJECT_EXCLUDES\nimport json\n\n# Using project-specific excludes and depth limit\nstructure = get_repo_structure(\n    github_url=\"https://github.com/username/repo.git\",\n    clone_path=\"local_repo_folder\",\n    token=\"your_github_token\",  # For private repos\n    max_depth=2,  # Limit directory traversal depth\n    exclude_patterns=PROJECT_EXCLUDES[\"python\"]  # Use Python-specific excludes\n)\n\n# Print the structure as formatted JSON\nprint(json.dumps(structure, indent=2))\n```\n\n### Private Repositories\n\nFor private repositories, you'll need to provide a GitHub personal access token:\n\n```python\nstructure = get_repo_structure(\n    github_url=\"https://github.com/oguzhancetinkaya/private-repo.git\",\n    clone_path=\"private_repo_folder\",\n    token=\"your_github_personal_access_token\"\n)\n```\n\n## Exclude Patterns\n\nThe tool comes with predefined exclude patterns for different project types:\n\n- `DEFAULT_EXCLUDES`: Basic patterns like `.git`, `node_modules`, `venv`\n- `PYTHON_EXCLUDES`: Python-specific patterns\n- `NODE_EXCLUDES`: Node.js-specific patterns\n- `JAVA_EXCLUDES`: Java-specific patterns\n\nYou can also provide your own custom exclude patterns:\n\n```python\ncustom_excludes = [\n    \"*.log\",\n    \"temp\",\n    \"custom_folder\"\n]\n\nstructure = get_repo_structure(\n    github_url=\"https://github.com/username/repo.git\",\n    clone_path=\"local_repo_folder\",\n    exclude_patterns=custom_excludes\n)\n```\n\n## Output Format\n\nThe tool generates a nested dictionary structure that represents the repository layout:\n\n```json\n{\n  \"name\": \"repo_name\",\n  \"type\": \"directory\",\n  \"children\": [\n    {\n      \"name\": \"src\",\n      \"type\": \"directory\",\n      \"children\": [\n        {\n          \"name\": \"main.py\",\n          \"type\": \"file\"\n        }\n      ]\n    }\n  ]\n}\n```\n\n## Components\n\n### repo_structure.py\n\nThe main module containing:\n\n- Directory traversal logic\n- Repository cloning functionality\n- Exclude pattern definitions\n- `.gitignore` integration\n\n### clone_progress.py\n\nA helper module that provides:\n\n- Custom progress handler for Git operations\n- Integration with the `alive-progress` library\n- Visual feedback during repository cloning\n\n## Contributing\n\nContributions are welcome! Some areas for potential improvement:\n\n- Additional project-type exclude patterns\n- Support for other Git hosting services\n- Enhanced progress reporting\n- Additional output formats\n- Performance optimizations for large repositories\n\n## License\n\nThis project is open-source. See the [LICENSE](vscode-file://vscode-app/private/var/folders/d_/1hbc6cs172n3vqy5vm8_jjcm0000gn/T/AppTranslocation/565C53E6-A178-4D77-8626-F09590BD7FD3/d/Visual%20Studio%20Code.app/Contents/Resources/app/out/vs/code/electron-sandbox/workbench/workbench.html) file for details.\n\n---\n\nThank you for using **github-repo-structure** ! If you have any questions or suggestions, don’t hesitate to create an issue or open a discussion. Happy coding! ```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foguzhancetinkaya%2Fgithub-repo-structure","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Foguzhancetinkaya%2Fgithub-repo-structure","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foguzhancetinkaya%2Fgithub-repo-structure/lists"}