Skip to main content

Search repositories on GitHub

Project description

The package searches repositories on GitHub using GraphQL API. One may specify parameters such as programming language, start date, and number of stars to get a list of GitHub repositories modified on or after the specified start date and satisfying other filters.

The package takes care of constraints such as API limit and the size of responses by reducing the search scope (in terms of time) by following a mechanism similar to binary search. The search results are stored in a file separated in the following format per line.

<repo_owner>/<project name><space><programming language><space><modification date and time>

Ex: apache/tomcat Java 2022-08-06T13:31:25Z

Parameters

  • --api-token: GitHub API token or Personal Access Token
  • --out-file: Output file path
  • --start-date: Start date for search in dd-mm-yyyy
  • --lang: Primary programming language of the repositories
  • --min-stars: Minimum star count
  • --verbose: Verbose mode

Example

Install searchgithubrepo package using pip and use it in your program.

from searchrepo import search_repo

one_day_old_date = (datetime.datetime.now().date() - datetime.timedelta(days=1))
search_repo(start_date=one_day_old_date,
            out_file='repos.csv',
            api_token='51ec41929c6f48c23482a734534327d308', # fake; just for the example
            stars=100,
            lang='Java', 
            verbose=True)

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

searchgithubrepo-1.0.9.tar.gz (8.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

searchgithubrepo-1.0.9-py3-none-any.whl (8.7 kB view details)

Uploaded Python 3

File details

Details for the file searchgithubrepo-1.0.9.tar.gz.

File metadata

  • Download URL: searchgithubrepo-1.0.9.tar.gz
  • Upload date:
  • Size: 8.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.7.2

File hashes

Hashes for searchgithubrepo-1.0.9.tar.gz
Algorithm Hash digest
SHA256 0cf197d0d4b9f6b224e41dbbf455cb3f6d8c35eebf2b8b1019399686634f6320
MD5 71977f1095327ad432f3a25b6833e605
BLAKE2b-256 3a0e53369c8281d90d3ce94f56b7a6d91a036f776eeb27ebcccd54fe5dffa5b9

See more details on using hashes here.

File details

Details for the file searchgithubrepo-1.0.9-py3-none-any.whl.

File metadata

File hashes

Hashes for searchgithubrepo-1.0.9-py3-none-any.whl
Algorithm Hash digest
SHA256 18e65b0339ac3595859ee1a9d1014e9a1a42e856f55f5bbc29312854132dcdf9
MD5 e1cd1459e73482f9a0293183934d9642
BLAKE2b-256 8e4f6fc9f8f20a9d63e7be247256e29bb01676e2704b19f87f4a08015b867fbe

See more details on using hashes here.

Supported by

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