Skip to main content

Manage large 1..1000 user teams for classroom and insitutions with GitHub API calls.

Project description

PyGitHub Utilities

Actions Status

GitHub API utilities for managing large numbers (10..1000) of users and repositories for education and institutions. GitHub v3 API is used via actively developed and growing PyGitHub. For very large number of repos say 1000+, it may be more useful and fast to use the GraphQL GitHub v4 API. Input / output is often via spreadsheet, as a gateway to APIs of other services such as Blackboard.

This repository helps us avoid having to use GitHub Education.

For example:

  • create repo for each team project (CreateGithubTeamRepos.py)
  • mass-add per-project collaborators (AddGithubCollab.py)
  • duplicate (mirror) lots of repos (DuplicateGithubRepos.p)

We also maintain Python-based Git utilities.

An important feature in

python CountGithubForks.py username

is showing which forks of your repos have had changes "ahead of" the parent repo.


Count how many total GitHub stars a GitHub account has:

python CountGithubStars.py username

That will take a couple seconds even for large numbers of repos.

Mass duplicate GitHub repos

DuplicateGithubRepos based on spreadsheet input, mass duplicate GitHub repos.

API Key

Users will need a GitHub API token, as the unauthenticated API access is severely limited.

  1. Generate GitHub API token with permission appropriate to the PyGitHub Utilities script being used.
  2. Copy that text string to a secure location on your computer.

permissions

For public repos, "public_repo" is needed. For private repos, "repo" is needed.

"admin:org" Oauth does not work.

It's suggested you create an Oauth key for this, and then disable/delete this key permissions when done to avoid a security issue. To do this, including for Organizations, go to your Username, Settings, Developer Settings, Personal Access Tokens and set repo:public_repo. For organization private repos, you need "repo" permissions on the Oauth token.

if you get error

github.GithubException.UnknownObjectException: 404 {'message': 'Not Found',
'documentation_url': 'https://developer.github.com/v3/repos/#edit'}

that typically means your Oauth key doesn't have adequate permissions.

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

pygithubutils-1.0.2.tar.gz (9.9 kB view details)

Uploaded Source

File details

Details for the file pygithubutils-1.0.2.tar.gz.

File metadata

  • Download URL: pygithubutils-1.0.2.tar.gz
  • Upload date:
  • Size: 9.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.1.3.post20200330 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.7.7

File hashes

Hashes for pygithubutils-1.0.2.tar.gz
Algorithm Hash digest
SHA256 da53068ddca2d089ab45bd11f287cbbb268df01984ced6fe703d1a16abb5399f
MD5 94044f7590b3a28ba23abc9552f0eb68
BLAKE2b-256 24be79fcd36e7391bba563875a41ad43888202472a4343ed015596bc237a18a2

See more details on using hashes here.

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