https://github.com/basedrhys/github-scraper
Python package to download GitHub source code for specific file types easily
https://github.com/basedrhys/github-scraper
Last synced: about 1 year ago
JSON representation
Python package to download GitHub source code for specific file types easily
- Host: GitHub
- URL: https://github.com/basedrhys/github-scraper
- Owner: basedrhys
- License: mit
- Created: 2019-09-05T00:26:04.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2019-09-05T10:25:26.000Z (almost 7 years ago)
- Last Synced: 2025-04-13T20:14:36.516Z (about 1 year ago)
- Language: Python
- Homepage:
- Size: 10.7 KB
- Stars: 5
- Watchers: 2
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# github-scraper
Simple python package designed for easy downloading of source code from Github Users.
Terms:
- **Owner** is used to describe a repository owner/user that created the repository. Owner is GitHubs term so it's used here for consistency
## Installation
python3 -m pip install github_scraper
## Usage
Import and set up the config with username and API token
>>> import github_scraper as gs
>>> config = gs.Config('MY_USERNAME', 'MY_API_KEY')
It defaults to downloading Java files, but can be configured for other languages
>>> config = gs.Config('MY_USERNAME', 'MY_API_KEY', repo_language='Python', query_language='python', suffix='.py')
Downloading all Java files from myself
>>> scraper = gs.FileScraper(config)
>>> scraper.download_owner('basedrhys')
Scraping owner: basedrhys
...
Downloading all Java files from a specific repo
>>> owner = gs.Owner('google', config)
>>> owner.download_repo('tink')