Skip to main content

A useful module for handling Git data.

Project description

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.

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

git2vec-0.1.6.tar.gz (6.2 kB view details)

Uploaded Source

Built Distribution

git2vec-0.1.6-py3-none-any.whl (6.6 kB view details)

Uploaded Python 3

File details

Details for the file git2vec-0.1.6.tar.gz.

File metadata

  • Download URL: git2vec-0.1.6.tar.gz
  • Upload date:
  • Size: 6.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.1

File hashes

Hashes for git2vec-0.1.6.tar.gz
Algorithm Hash digest
SHA256 d6dff6bc7f7365eeca98f526720d4945154d7f75dccdea55c4adb3e22748e559
MD5 0db7bf42e85e1eee9b52aa42b008043e
BLAKE2b-256 60abd863b1fea37d1ec864947e549fa6ea4f7d5c44f7cd7ca71bf50b543716d7

See more details on using hashes here.

File details

Details for the file git2vec-0.1.6-py3-none-any.whl.

File metadata

  • Download URL: git2vec-0.1.6-py3-none-any.whl
  • Upload date:
  • Size: 6.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.1

File hashes

Hashes for git2vec-0.1.6-py3-none-any.whl
Algorithm Hash digest
SHA256 0fd6abe3aee01d57247b95af0994d365834ee4d40fe184c697162c8d97c73c8c
MD5 156a5f01d594e44cc9cf81fbad97ae12
BLAKE2b-256 febc231fd3d171da071157a06b1a3c0ee3fe586b5dd825b1d61fa142b1525cce

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page