Giter Club home page Giter Club logo

randomrepos's Introduction

Random Repos

Introduction

Random Repos is a Python script tht uses the GitHub API to fetch random active repositories based on recent activity and summarize their READMEs if they have them. Many repositories will not have a README O.o, so they are ommitted from repo_summaries.md, but still tracked in randomActiveGits.md. This tool is especially useful for developers looking to discover new projects, trends, or technologies within the GitHub community.

Table of Contents

Installation

To install Random Repos, you'll need Python 3.x and pip. Clone this repository or download the script directly. Then, install the required dependencies:

pip install -r requirements.txt

Usage

To use Random Repos, execute the script with Python and specify the desired number of repositories to fetch using the -n or --number argument:

python randomRepos.py --number 100

Limitations

Be aware that the script uses GPT-4 by default, so it is up to you to monitor token usage

As an example, -n 100 fetches resulted in ~40 summaries written, which took ~7 minutes and used $0.30 at tier 4 as of the latest update.

Output

The script outputs 2 files:

randomActiveGits.md Keeps track of all of the repositories fetched repo_summaries.md Contains summaries of only repositories that contain README files

Features

  • Fetches active GitHub repositories based on recent activity.
  • Summarizes READMEs of fetched repositories using OpenAI's API.
  • Filters out already listed repositories to avoid duplicates.
  • Generates markdown files for easy viewing and sharing.

Dependencies

  • requests: For making HTTP requests to GitHub's API.
  • beautifulsoup4: For parsing HTML content.
  • openai: To access OpenAI's API for summarizing READMEs.

Configuration

Ensure you have set the following environment variables before running the script:

  • GITHUB_TOKEN: Your GitHub API token.
  • OPENAI_API_TOKEN: Your OpenAI API key.

Documentation

For more detailed information about each function and its usage, refer to the inline comments within the script.

Examples

Example of running the script to fetch and summarize 100 repositories:

python3 randomReposnew.py -n 100
Script started.
New Repositories Found: 100
Total Repositories in File Now: 100
Summaries Generated: 30
Script ended.
Execution Time: 0:02:04.238312

Troubleshooting

If you encounter any issues regarding missing environment variables, ensure you have correctly set GITHUB_TOKEN and OPENAI_API_TOKEN in your environment.

Contributors

Feel free to contribute to the project by submitting pull requests or opening issues.

License

This project is licensed under the MIT License - see the LICENSE file for details.

randomrepos's People

Contributors

dlmcglade avatar

Stargazers

 avatar

Watchers

 avatar

randomrepos's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.