Skip to main content

Library to fetch trending repos/users on GitHub

Project description

gtrending

checks codecov docs status pypi version Python Requirements Code style: black

Lightweight and easy-to-use python library for fetching trending repositories and developers. Relies on github-trending-api, which is in JavaScript, so gtrending aims to fill the gap for python.

from gtrending import fetch_repos


repos = fetch_repos(language="python")  # get the result as a dict

for repo in repos:
    print(repo["fullname"])  # full name (user/repo) of 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

pip3 install gtrending

API

Documentation: read the docs

fetch_repos()

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 dicts containing information for the trending repositories found


fetch_developers()

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 dicts containing information for the trending repositories found


languages_list()

Fetch languages

Returns:

A list of dictionaries containing 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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

gtrending-0.3.3.tar.gz (3.2 kB view hashes)

Uploaded Source

Built Distribution

gtrending-0.3.3-py3-none-any.whl (4.4 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page