Welcome
Fetch repositories and developers from GitHub Trending.
Here’s a simple example, get the trending python projects and display their full names:
from gtrending import fetch_repos
repos = fetch_repos(language="python") # Returns a dictionary
for repo in repos:
print(repo["fullname"]) # "user/repo" for each repo
Installation
Install gtrending on PyPI using your favorite package manage. For example:
pip3 install gtrending
Contribute
Issue Tracker: https://github.com/hedyhli/gtrending/issues
Source Code: https://github.com/hedyhli/gtrending
Support
If you are having issues, please open an issue on the github issue tracker as linked above.
License
The project is licensed under the MIT license.
Indices and tables
API Reference
Fetch trending repositories and developers using github-trending-api
- gtrending.fetch.check_language(language: str = '') bool
Check if the language exists.
- Parameters:
language (str): The language, eg: python.
- Returns:
A boolean value. True for valid language, False otherwise.
- gtrending.fetch.check_since(since: str = '') bool
Check if the time range value is correct.
- Parameters:
since (str): The time range.
- Returns:
A boolean value. True for valid parameter, False otherwise.
- gtrending.fetch.check_spoken_language(spoken_language_code: str = '') bool
Check if the spoken language exists.
- Parameters:
spoken_language_code (str): The spoken language, eg: en for english.
- Returns:
A boolean value. True for valid spoken language, False otherwise.
- gtrending.fetch.fetch_developers(language: str = '', since: str = 'daily') dict
Fetch trending developers on GitHub.
- Parameters:
language (str, optional): The programming language, eg: python since (str, optional): The time range, choose from [daily, weekly, monthly]. Defaults to “daily”
- Returns:
A list of dictionary containing information for the trending developers found.
- gtrending.fetch.fetch_repos(language: str = '', spoken_language_code: str = '', since: str = 'daily') List[dict]
Fetch trending repositories on GitHub.
- Parameters:
language (str, optional): Filtering by language, eg: python spoken_language_code (str, optional): The spoken language, eg: en for english since (str, optional): The time range, choose from: [daily, weekly, monthly]. Defaults to “daily”
- Returns:
A list of dictionary containing information for the trending repositories found.
- gtrending.fetch.languages_list() list
Fetch programming languages.
- Returns:
A list of dictionaries containing languages.
- gtrending.fetch.spoken_languages_list() list
Fetch spoken languages.
- Returns:
A list of spoken languages.