Skip to main content

A Python module for installing GitHub subdirectories.

Project description

gh_subdir

Python module to install a subfolder of a github repo instead of the entire repo.

How to use

First, install the module with pip.

pip install gh_subdir

Then use the module in your python file as follows:

from gh_subdir import gh_subdir
ghs_config = {
    "owner": "example_owner",
    "repo": "example_repo",
    "encoding": "utf-8", # optional (default: utf-8)
    "create_subfolder": True, # optional (default: True)
}
ghs = gh_subdir(ghs_config)
ghs.install("example_subdir")

Options

encoding: Default encoding for the files, I've found utf-8 handles the most cases, but if you're having issues with encoding, try changing this.

create_subfolder:

  • If True, the files will be installed in a subfolder with the same name as the subfolder path.
  • If False, the files will be installed in the same directory as the python file.

Contributors

Reece Vela - Github
Others welcome!

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

gh_subdir-1.0.2.tar.gz (15.2 kB view details)

Uploaded Source

File details

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

File metadata

  • Download URL: gh_subdir-1.0.2.tar.gz
  • Upload date:
  • Size: 15.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.2

File hashes

Hashes for gh_subdir-1.0.2.tar.gz
Algorithm Hash digest
SHA256 4e2e43a7dd4c401dddb8561f86a477333238ae890513a97c3fb0e67de38d6171
MD5 7ad1f6fb868b58723c864bb399507966
BLAKE2b-256 0bb7c897a57f871b9697dfa9c1c4a59f4debc70a846bcb817f8ece44b25a6327

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