Skip to main content

Download single files or folders from a github repository without cloning its entire contents.

Project description

ghget logo

PyPI version PyPI - Downloads Build Status Code Style pre-commit Contributor Covenant GitHub

Description

Download single files or directories from a GitHub repository without cloning its entire contents.

Features

  • No need to manually create a raw GitHub url for individual files, just provide the web url.
  • Recursively download entire directories.
  • Download from private repos by setting a GITHUB_TOKEN environment variable.
  • Lightweight, easy to install, and easy to use.

Installation

The ghget package can be installed directly using pip.

pip install ghget

Usage

  • Easily download single files given the GitHub url:
$ ghget https://github.com/naiquevin/pipdeptree/blob/master/pipdeptree.py
Downloading pipdeptree.py file...
Done!
  • Recursively download a specific directory from a GitHub repo:
$ ghget https://github.com/pandas-dev/pandas/tree/master/scripts
Downloading scripts directory...
Done!

$ tree
.
└── scripts
    ├── __init__.py
    ├── generate_pip_deps_from_conda.py
    ├── list_future_warnings.sh
    ├── no_bool_in_generic.py
    ├── pandas_errors_documented.py
    ├── sync_flake8_versions.py
    ├── tests
    │   ├── __init__.py
    │   ├── conftest.py
    │   ├── test_no_bool_in_generic.py
    │   ├── test_sync_flake8_versions.py
    │   ├── test_use_pd_array_in_core.py
    │   └── test_validate_docstrings.py
    ├── use_pd_array_in_core.py
    ├── validate_docstrings.py
    └── validate_rst_title_capitalization.py

Options

usage: ghget [-h] url

positional arguments:
  url         The url for the file or directory you want to download.

optional arguments:
  -h, --help  show this help message and exit

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

ghget-0.3.1.tar.gz (5.1 kB view hashes)

Uploaded source

Built Distribution

ghget-0.3.1-py3-none-any.whl (5.7 kB view hashes)

Uploaded py3

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page