A tool for converting git repositories into documents
Project description
Git2Doc 📚
Git2Doc is a Python package that allows you to convert git repositories into documents. It is designed to help developers analyze and understand codebases by providing an easy way to extract and process text content from git repositories.
Table of Contents
Installation
To install Git2Doc, simply run:
pip install git2doc
Usage
Example: Fetch and Load Repositories
from git2doc.loader import pipeline_fetch_and_load
# Fetch and load the top 5 repositories created in the last 7 days
github_data = pipeline_fetch_and_load(n_repos=5, last_n_days=7)
# Print the metadata and documents for each repository
for repo_key, repo_data in github_data.items():
print(f"Repository: {repo_key}")
print("Metadata:")
for key, value in repo_data["metadata"].items():
print(f" {key}: {value}")
print("Documents:")
for doc in repo_data["docs"]:
print(f" {doc.metadata['file_path']}: {doc.page_content[:50]}...")
Example: Get Top Repositories
from git2doc.loader import get_top_repos
# Get the top 5 Python repositories created in the last 7 days
top_repos = get_top_repos(n_repos=5, last_n_days=7, language="Python")
# Print the repository URLs
for repo in top_repos:
print(repo["html_url"])
Contributing
Contributions are welcome! Please feel free to submit a pull request or open an issue on GitHub.
License
Git2Doc is released under the MIT License.
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
git2doc-0.2.2.tar.gz
(6.0 kB
view details)
Built Distribution
git2doc-0.2.2-py3-none-any.whl
(10.7 kB
view details)
File details
Details for the file git2doc-0.2.2.tar.gz
.
File metadata
- Download URL: git2doc-0.2.2.tar.gz
- Upload date:
- Size: 6.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2fe461421834fb7d468154e0d6747db824f482dc37aeb792bb4057b57595db82 |
|
MD5 | 554b4f657d228409f0125ee1f2895155 |
|
BLAKE2b-256 | 918e1d53acb3c8cdbf5ab45b0c52901f2a18cd937398a0fffcfb357b769c4226 |
File details
Details for the file git2doc-0.2.2-py3-none-any.whl
.
File metadata
- Download URL: git2doc-0.2.2-py3-none-any.whl
- Upload date:
- Size: 10.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6d02ed14bf4de7f8da5e52b8661b9b2c94965681671fb676b7605c2ba2e3327a |
|
MD5 | a245b5b0087c44957abcd08311fa2294 |
|
BLAKE2b-256 | 59a511422a15545c586996339a85f9602e406c69a7fd1c0d9ca2782420051c36 |