Skip to content

shorn-gnosis/github2file

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

45 Commits
 
 
 
 
 
 
 
 

Repository files navigation

GitHub Repository to File Converter

This Python script allows you to download and process files from a GitHub repository, making it easier to share code with chatbots or other applications that don't automatically download code from GitHub.

Features

  • Download and process files from a GitHub repository
  • Support for both public and private repositories
  • Filter out directories and files with insufficient content
  • Combine all remaining files into a single output file

Usage

To download and process files from a GitHub repository, run the following command: python github2file.py <repository_url>

Replace <repository_url> with the URL of the GitHub repository you want to download. For a private repository, use the following format: python github2file.py https://:<GITHUB_ACCESS_TOKEN>@github.com/username/repository

Replace <USERNAME> with your GitHub username and <GITHUB_ACCESS_TOKEN> with your GitHub personal access token.

Optional Arguments

  • --branch_or_tag: Specify the branch or tag of the repository to download (default: "main").

Example

To download and process files from the Hugging Face Transformers repository, run: python github2file.py https://github.com/huggingface/transformers

This will create a file named transformers.txt containing the combined source code from the repository.

To download and process files from a private repository, run:

python github2file.py https://:<GITHUB_ACCESS_TOKEN>@github.com/username/private-repo

Output

The script will create a file named repository_name.txt (e.g., transformers.txt) containing the combined source code from the specified repository. You can then share this file with chatbots or other applications for further analysis or processing.

Requirements

  • Python 3.x
  • requests library

License

This project is open-source and available under the MIT License.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • Python 100.0%