Fetch trending repositories and users on GitHub
Project description
gtrending
Fetch repositories and developers from GitHub trending.
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
The above example will fetch all the trending Python projects on GitHub trending today and print their full names.
Requirements
- Python 3.6 or higher
Installation
gtrending is published on PyPI, use your favorite package manager and add it as a dependency.
Pip:
pip3 install gtrending
Poetry:
poetry add gtrending
You get the idea.
API
Documentation: Read the docs
fetch_repos()
Fetch trending repositories on GitHub.
Parameters:
language (str, optional)
: Filtering by language, eg: pythonspoken_language_code (str, optional)
: The spoken language, eg: en for englishsince (str, optional)
: The time range, choose from: [daily, weekly, monthly]. Defaults to "daily"
Returns:
A list of dictionaries containing information for the trending repositories found.
fetch_developers()
Fetch trending developers on GitHub.
Parameters:
language (str, optional)
: The programming language, eg: pythonsince (str, optional)
: The time range, choose from [daily, weekly, monthly]. Defaults to "daily"
Returns:
A list of dictionaries containing information for the trending developers found.
languages_list()
Fetch languages
Returns:
A list of dictionaries containing programming languages.
spoken_languages_list()
Fetch spoken languages.
Returns:
A list of spoken languages.
check_language()
Check if the language exists.
Parameters:
language (str)
: The language, eg: python.
Returns:
A boolean value. True for valid language, False otherwise.
check_spoken_language()
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.
check_since()
Check if the time range is correct.
Parameters:
since (str)
: The time range.
Returns:
A boolean value. True for valid parameter, False otherwise.
Uses
- github-trending-api -- JavaScript library with API
- requests -- Making API requests
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for gtrending-0.3.6-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | db11a8c0232d9ffb97b9a2b13932e36af4cae817559067ca4cfa3a23947cdd85 |
|
MD5 | d690902b3fb36b62bbdc2a3299da564e |
|
BLAKE2b-256 | 1eaf8ac8ce9dc8ceaddf5dd85143a3f08a5a2faff404d5f899ef3e8517bc0448 |