Skip to main content

A useful module for handling Git data.

Project description

Git2Vec Repo

Git2Vec is a Python module that allows you to load text files from a Git repository and create a searchable vector database using Langchain, Pinecone, and OpenAI.

Installation

Install from https://pypi.org/project/git2vec/ using pip

pip install git2vec

If cloned, you will need to install the following packages:

pip install -r requirements.txt

If you are a developer, you will need to install the development requirements:

pip install -r requirements.dev.txt

Usage

Loading a Git repository

To load a Git repository, use the git2vec.loader.load() function:

from git2vec import loader

repo_name = "https://github.com/voynow/turbo-docs"

# Returns a list of Document objects
repo_data = loader.load(repo_name)

# Or return a string of all the raw text
raw_repo = loader.load(repo_name, return_str=True)

Creating and managing a vector database

To create a vector database from the loaded Git repository, use the following functions:

from git2vec import vectordb

# Create a vector store from the Git repo
vectorstore = vectordb.create_vectorstore(repo_name)

# Retrieve the vector store from Pinecone index
vectorstore = vectordb.get_vectorstore()

Modules

loader.py

The loader.py module contains the TurboGitLoader class which can be used to load text files from a Git repository. The load() function takes a repository URL and returns a list of Document objects or a string containing all the raw text.

vectordb.py

The vectordb.py module provides functions to create and manage a vector database using Langchain, Pinecone, and OpenAI. It contains functions for initializing Pinecone, upserting data, processing data, embedding and upserting, creating a vectorstore, and retrieving a vectorstore.

Contributing

If you find any issues or have any suggestions, feel free to open an issue or submit a pull request. We welcome any contributions!

License

This project is licensed 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.2.tar.gz (5.1 kB view details)

Uploaded Source

Built Distribution

git2vec-0.1.2-py3-none-any.whl (5.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: git2vec-0.1.2.tar.gz
  • Upload date:
  • Size: 5.1 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.2.tar.gz
Algorithm Hash digest
SHA256 52a6082f871f57ef573d7f61fcc1dd312cc2c3e6b0090ac61fbabed71787a1ae
MD5 40b7cd248db0cd548ff805b503bf56c0
BLAKE2b-256 c053579db1de668d82dde5d4b017a3da1f2fe7d2384f7f3b1bb4b80044d7d3e8

See more details on using hashes here.

File details

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

File metadata

  • Download URL: git2vec-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 5.5 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.2-py3-none-any.whl
Algorithm Hash digest
SHA256 f436886bacc33c1853df2033b1a691066f9cd7a4334e1d93dbdd8433d4b534ae
MD5 4c5ad8adb423ebacaf56c6088e42bbc1
BLAKE2b-256 64ddef0ebd0f535233193addf5cbec07eb37b2133ebeca3512849ab781222191

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