Tools to support use of Google Colab + GitHub Classroom for physics lab instruction
Project description
Tools for Colab in the Physics Lab
Tools to support the use of Google Colab + GitHub for teaching undergraduate physics labs. Support for private repositories enables the use of GitHub Classroom.
Installation
This package is primarily intended for use within Google Colab. To install in a Colab notebook:
!pip install whit-phys-util
Importing
To import the package after installation:
import whit_phys_util
Creating a GitHub credentials file
If you will be regularly connecting GitHub private repositories to Colab sessions, the recommendation is to create a file containing your GitHub info and store it in your Google Drive.
- Create a file with the name
.env
ordotenv
using the plain text editor of your choice. - This file should have the following format:
In my case# for git user_email = "yourname@host" user_name = "your_GitHub_user_name" gh_token = "GitHub_personal_access_token"
"yourname@host"
was"jlarkin@whitworth.edu"
and"your_GitHub_user_name"
was"JohnMLarkin"
. - Next, login to GitHub and select Settings from the menu hiding under your profile picture.
- Select Developer settings from the sidebar and then Personal access tokens.
- Click on the Generate new token button.
- Note is your name for this token so you can remember what it does and where it is used. Picking something like
Colab repo link
makes that clear. - Check the repo box and then the Generate token button.
- Copy this token and paste it into your
.env
/dotenv
file in place ofGitHub_personal_access_token
. - Move this file to the top-level folder of your Google Drive.
Working with a GitHub repository
Clone a repository to Colab session storage
Replace REPO_URL
with the URL to your private GitHub repository:
repo = whit_phys_util.local_repository("REPO_URL")
If your Google Drive is not already mounted to this Colab session, you will be prompted to do so. If you created the GitHub credentials file as described above, this will then create a clone of the repository located in /content/REPO_NAME
. Your current working directory will also be changed to this folder.
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
File details
Details for the file whit_phys_util-1.0.2.tar.gz
.
File metadata
- Download URL: whit_phys_util-1.0.2.tar.gz
- Upload date:
- Size: 12.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.12.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b4eee5b7b7b75086357a245d7932cb0f97b53131f46618181dfaae90f95ff53a |
|
MD5 | c7f2de8ecea0ed6d5c640ed1cf6c1216 |
|
BLAKE2b-256 | 8bfd2d8786854b4949d476516090bacf214532baa46098c6b0e1debe9e47f968 |
File details
Details for the file whit_phys_util-1.0.2-py3-none-any.whl
.
File metadata
- Download URL: whit_phys_util-1.0.2-py3-none-any.whl
- Upload date:
- Size: 13.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.12.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ad22e7bdb45fbdb6668157d7f0a8810999b643b90672125e2de6df96815bea92 |
|
MD5 | b61b558d4fb0cbb88c0fa754ff404083 |
|
BLAKE2b-256 | 8f51f079fc9c0ea8e7cb533b62fe12ba175eae6ca7af735e7613933de899cf89 |