Contributors Forks Stargazers Issues MIT License LinkedIn


Logo

Download Repository Utility

A utility to quickly download a GitHub repository, unzip it, and open the top-level folder in file explorer.
Explore the docs »

Report Bug · Request Feature

Table of Contents
  1. About The Project
  2. Getting Started
  3. Usage
  4. Limitations and Exceptions
  5. Roadmap
  6. Contributing
  7. License
  8. Contact
  9. Acknowledgments

About The Project

DRU Screenshot

As instructors at a software development boot camp, we download between 70 and 100 GitHub student repositories a day. The process to download a repository and open the assignment folder is monotonous and takes up to 20 mouse/key clicks. In a fast paced environment with frequent interruptions, it's easy to lose your place and have to repeat steps or start over 😑. As a fan of efficient work flow, I was inspired to create Download Repository Utility (DRU). Once it's up and runnning, DRU only takes 2 or 3 clicks to download a repo, open the student folder, and begin code review. Just paste the URL and press Enter 😎. Almost everything is automated including opening the repository folder and deleting the zip file.

Features

  • Fast download (using Powershell 5.1 and Web Client) and fast reliable unzip (using 7-zip).
  • Repository folder is auto-opened in Windows File Explorer so you can get to work quickly.
  • Zip file is deleted after unzip.
  • Delayed tooltips when mouse is hovered over GUI features.
  • Remembers specified download destination for next run.
  • Unzipped repository folder is prefixed with the username to make it unique. This prevents unzipping into another student's folder that has the same repo name.
  • Can specify branch to download if repo contains multiple branches.
  • Important information and errors are displayed on screen, more details are written to DRU.log.
  • Screen size is flexible. Just click and drag borders to adjust the footprint.

(back to top)

Built With

  • Python
  • Tkinter
  • Powershell

(back to top)

Getting Started

To get a local copy up and running follow these steps:

Prerequisites

DRU was developed and tested with the following:

  • Windows 10 or 11
  • Python 3.9.5
  • PowerShell 5.1 (comes installed with Windows 10 and 11)
  • Python libraries
    • Pyglet 1.5.27
    • Pillow 9.3.0
  • 7-Zip
    • DRU expects 7-zip to be installed in the ProgramFiles folder (when installing, accept the default locations)

To install Python:

To install the Python libraries: (Use a python virtual environment if your main python environment has different versions of below libraries)

  • After installing Python, open the Windows command line and execute the following:
    pip install pyglet==1.5.27  (pyglet 2.0 will not load our cool external computer font 🙁)
    pip install Pillow==9.3.0

(back to top)

Installation

  1. Clone the repo
    git clone https://github.com/aglorenz/Download-Repository-Utility.git
  2. Ensure the prerequisites above have been met.

(back to top)

Quick Start

  1. Navigate to the main folder of the repository, "Download-Repository-Utility".
  2. Open DRU.py with IDLE.
  3. Click Run ➡️ Run Module to open DRU.
  4. Copy and paste a GitHub repository URL into the "Enter Repo URL" field and press enter on your keyboard to begin the repo download and extraction.

(back to top)

Generate a Shortcut for the Taskbar

  1. Right click on DRU.py ➡️ Create Shortcut
  2. Right click on DRU.py - Shortcut ➡️ Properties...

  1. In the Target field:
    • Enter the path to your python.exe file. Note: The path on your machine may differ significantly.
      Ex: C:\Users\Andy\AppData\Local\Programs\Python\Python39\python.exe
      If your path has a space in one of the folder names, surround the whole path with double quotes like so:
      "C:\Users\Andy\AppData\Local\Programs\Python\Python39\python.exe"
    • Change python.exe to pythonw.exe -- This will supress the python command window when running DRU.
    • Add a space and paste the path to the DRU.py file.
    • The finished Target field should look like so:
      C:\Users\Andy\AppData\Local\Programs\Python\Python39\pythonw.exe C:\Users\Andy\Source\Repos\Download-Repository-Utility\DRU.py
  2. In the Start In field:
    • Enter the path to DRU.py Ex: C:\Users\Andy\Source\Repos\Download-Repository-Utility
  3. Click Apply
  4. Click Change Icon ➡️ Browse
    • Browse to the Images subfolder of the repository and select DRU-Favicon-Thick.ico ➡️ Open ➡️ OK ➡️ OK
  5. Drag the shortcut to the taskbar.

(back to top)

Usage

"Enter Repo URL" Input Field

Paste a repository URL into this field. The URL must contain the https:// prefix and at least a valid GitHub username and repository name.

Ex:  https://github.com/JoeSchmo/JavaScript-Projects/...
  • For the fastest workflow, press the enter key after pasting the URL to begin the download process.
  • After the repository is downloaded and unzipped, the folder name is prefixed with the GitHub user's name to differentiate it from other repositories with the same name.
  • Once the repository is unzipped, the folder is auto-opened in Windows File Explorer

"Main/Master" Radio Button

  • If the repo contains either a Main or Master branch (but not both) select Main/Master.
  • If the repo contains both branches and content from Master is needed, select Main/Master.
  • If the repo contains both branches and content from Main is needed, select Other and enter main in the input field.

"Other" Radio Button

  • Select this if content from an alternative branch (which could be main) is needed. Enter this branch name in the input field.

"Browse Dest" Input Field and Button

  • If a custom destination is desired for the downloaded repositories, enter the path in the input field or press the button to open a browse dialog to select a folder. If this field is left blank, DRU will use "C:/temp". If this folder doesn't exit, it will be auto-created.
  • The path entered will be saved in DRU.ini and repopulated the next time DRU is opened.

"Download Repo" Button

  • To start the download, click this button as an alternative to pressing enter after entering the repo URL.

"Output" Text Box

  • Informative output from DRU is displayed here including:
    • Most recently used repo URL
    • User, Repository Name, Branch Name
    • Error messages
  • Output text box can be resized by dragging the borders of the DRU application GUI.
  • Output content can be scrolled by hovering the mouse and scrolling the wheel.

DRU.log

  • This file contains behind-the-scenes details from the last download to help with debugging.

Housecleaning

  • User will need to:
    • Manually close the File Explorer Window after they are done with it.
    • Manually delete the unzipped folder when they are done with it (zip files are auto-deleted).

(back to top)

Limitations and Exceptions

  • DRU cannot:
    • Download a repository that ends with a period. These must be downloaded manually from GitHub. It's a limitation of Web Connect.
    • Display a download progress bar. It only displays 100% once the download is complete to give the feeling of progress. There are code examples online that can download a repository and show a progress bar, but they take 4X longer. Web Connect used here is much faster. In this case, download speed was more important than download status.

(back to top)

Roadmap

  • Modified Tkinter ToolTips library to accept a custom function. This allowed button color change on mouse hover followed by a delayed tooltip.
  • Package DRU as an executable.
  • Better looking delayed tooltips with customizable color, font, and border.

See the open issues for a full list of proposed features (and known issues).

(back to top)

Contributing

Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.

If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement". Don't forget to give the project a star! Thanks again!

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

(back to top)

License

Distributed under the MIT License. See LICENSE.txt for more information.

(back to top)

Contact

Andrew Lorenz : LinkedIn

Project Link : https://github.com/aglorenz/Download-Repository-Utility

(back to top)

Acknowledgments

Use this space to list resources you find helpful and would like to give credit to. I've included a few of my favorites to kick things off!

(back to top)