Skip to main content

Git2Vec

Git2Vec 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.

Installation

To install Git2Vec, run the following command:

pip install git2vec

Setup

Before using Git2Vec, make sure to have the following dependencies installed:

  • langchain
  • pinecone-client
  • 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 Git2Vec 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 git2vec.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 git2vec.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 git2vec.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 Git2Vec, 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

Git2Vec is released under the MIT License.

Release files for git2vec 0.1.8

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for git2vec 0.1.8
File Size Uploaded
git2vec-0.1.8.tar.gz 6.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for git2vec 0.1.8
File Interpreter ABI Platform
git2vec-0.1.8-py3-none-any.whl Python 3 none any Details

Total release size: 12.8 kB

Release files / git2vec-0.1.8.tar.gz

Download URL git2vec-0.1.8.tar.gz
Size 6.2 kB
Tags Source
SHA-256 checksum
How to use checksums
54ffe581d163d2ac7ee2bc41962bf0e198aee94323771bb87b9620273881d94b
BLAKE2b-256 checksum
How to use checksums
4f88e7d26ba18928ec5f081df0c51b344fa3b0c4e1e94919b25f309696f6890f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.10.1

Release files / git2vec-0.1.8-py3-none-any.whl

Download URL git2vec-0.1.8-py3-none-any.whl
Size 6.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e82c70a1a002de0fd493ea5b1c1f12cfbd8e413e4e8e919542c61455c0f0ad0f
BLAKE2b-256 checksum
How to use checksums
c27b33e26f9ee24b0c16d025ce3b0df64dea2fe2010907106f58b4a782de9ee3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.10.1

Release history Release notifications | RSS feed

This release

0.1.8 This release

2 release files

0.1.7

2 release files

0.1.6

2 release files

0.1.5

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page