noenthu / getgist

Python script to download files from any (public) gist

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

GetGist

Easily download any file from a public GitHub Gist account, with a one single command.

Latest release Downloads License Supported Python versions

Why?

Because of reasons I do not have a dotfile repository. I prefer to store my .vimrc, .gitconfig, .bash_whatever etc. as Gists.

Thus, to be honest, I wrote this script so I can update my .vimrc with one single command.

Install

$ pip install getgist

GetGist runs with Python 2 or 3 and is built only with core modules (no dependencies but Python).

Usage

Just run getgist <user> <file>. For example:

user@localhost ~ $ getgist cuducos .vimrc
  Fetching https://api.github.com/users/cuducos/gists …
  Fetching https://gist.githubusercontent.com/cuducos/409fac6ac23bf515f495/raw/f8acc26f0422b02fc282c5b4e97b70710044dbb3/.vimrc …
  Replace existing .vimrc ? (y/n) y
  Deleting existing .vimrc …
  Saving new .vimrc …
  Done!
user@localhost ~ $

If you decide not to delete your copy of the local file, it will be renamed with extensions such as .bkp, .bkp.1, .bkp.2 etc.

Contributing

Feel free to report an issue, open a pull request, or drop a line.

To do list

  • Authenticate users to:
    • Have a default user ($ getgist .vimrc to mine, $ getgist johndoe .vimrc to get John's one)
    • Allow the possibility of getting private Gists
  • Write tests for Gist.__backup()

License

So far I consider this script just public domain.

About

Python script to download files from any (public) gist


Languages

Language:Python 100.0%