8000 GitHub - nnguyenquangg/scrape_github_projects
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

nnguyenquangg/scrape_github_projects

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

FastAPI Scraping Project

This project is a FastAPI application that scrapes GitHub repositories for a given username and returns the repository details including the project link.

Features

  • Scrapes GitHub repositories for a given username
  • Returns repository details including name, description, language, and link
  • Exports repository data to a CSV file

Requirements

  • Python 3.7+
  • pip (Python package installer)

Installation

  1. Clone the repository:

    git clone https://github.com/yourusername/your-repo-name.git
    cd your-repo-name
  2. Create a virtual environment:

    mkdir env
    python3 -m venv env
  3. Activate the virtual environment:

    • On macOS and Linux:
      source env/bin/activate
    • On Windows:
      .\env\Scripts\activate
  4. Install the dependencies:

    pip install -r requirements.txt

Usage

  1. Run the FastAPI application:

    uvicorn main:app --reload
  2. Access the API: Open your browser and go to http://127.0.0.1:8000.

  3. Scrape GitHub repositories:

    • Send a POST request to /scrape with a JSON payload containing the GitHub username.
    • Example using curl:
      curl -X POST "http://127.0.0.1:8000/scrape" -H "Content-Type: application/json" -d '{"username": "octocat"}'
  4. View the scraped data: The API will return a JSON response with the repository details.

Example

Here is an example of how to use the API:

  1. Start the server:

    uvicorn main:app --reload
  2. Send a POST request:

    curl -X POST "http://127.0.0.1:8000/scrape" -H "Content-Type: application/json" -d '{"username": "octocat"}'
  3. Response:

    {
        "repositories": [
            {
                "name": "Hello-World",
                "description": "My first repository on GitHub!",
                "language": "Python",
                "link": "https://github.com/octocat/Hello-World"
            },
            ...
        ]
    }

Contributing

Contributions are welcome! Please open an issue or submit a pull request for any improvements or bug fixes.

License

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

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published
0