A tool for converting git repositories into documents
Project description
Git2Doc
Git2Doc is a Python package for handling Git data. It provides functionality to load and process Git repositories, and supports concurrent file loading for improved performance. The package can be found on PyPI.
Table of Contents
Installation
To install Git2Doc, run the following command:
pip install git2doc
Setup
Before using Git2Doc, make sure to have the following dependencies installed:
- langchain
- tiktoken
- gitpython
- python-dotenv
- pandas
You can install them using the following command:
pip install -r requirements.txt
Usage
Loading Git Repositories
The main functionality of Git2Doc is provided by the loader.py
module. Here's an example of how to use the pull_code_from_repo
function to load a Git repository:
from git2doc.loader import pull_code_from_repo
repo_url = "https://github.com/username/repo.git"
branch = "main"
repo_data = pull_code_from_repo(repo_url, branch)
Getting Top Repositories
You can use the get_top_repos
function to fetch the top repositories based on certain criteria:
from git2doc.loader import get_top_repos
n_repos = 10
last_n_days = 30
language = "Python"
sort = "stars"
order = "desc"
top_repos = get_top_repos(n_repos, last_n_days, language, sort, order)
Pipeline Fetch and Load
The pipeline_fetch_and_load
function can be used to fetch and load repositories in a single step:
from git2doc.loader import pipeline_fetch_and_load
n_repos = 10
last_n_days = 30
language = "Python"
sort = "stars"
order = "desc"
github_data = pipeline_fetch_and_load(n_repos, last_n_days, language, sort, order)
Contributing
If you'd like to contribute to Git2Doc, feel free to fork the repository and submit a pull request. If you have any questions or issues, please open an issue on the GitHub repository.
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
Built Distribution
File details
Details for the file git2doc-0.2.0.tar.gz
.
File metadata
- Download URL: git2doc-0.2.0.tar.gz
- Upload date:
- Size: 5.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 | 88cbb8151dca1b856698561e4b7fa25bb76349c2cfa468d1ef3e2b63d40dcfbb |
|
MD5 | efa149246decc145fe39e0e066c3b797 |
|
BLAKE2b-256 | 87ed8422eb2b298f0a9597f9cfaa5c26405c1de5b8369f9c2c1953f1e90df980 |
File details
Details for the file git2doc-0.2.0-py3-none-any.whl
.
File metadata
- Download URL: git2doc-0.2.0-py3-none-any.whl
- Upload date:
- Size: 9.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 | cac4171930df520b3819f6c1013b966922f3d821a263f95f34fe8b92881c401b |
|
MD5 | b88db78455abca6f54362fd495227f05 |
|
BLAKE2b-256 | 41da9ddaaacfcd35503877e925b7e3bdc54b7f6430629d7d0ec413b9ed4f421a |