Simple command-line wrapper of Ruby-based Github Linguist
Since we are merely parsing the original Linguist command-line output, we need to install Linguist as usual. Assuming Linux:
- setup RubyGems:
apt install ruby-dev libssl-dev gem update --system
- be sure Gems are installed to home directory, NOT system (no sudo) by adding to
~/.bashrc
:# Install Ruby Gems to ~/gems export GEM_HOME=$HOME/gems export PATH=$HOME/gems/bin:$PATH
- install Github Linguist:
gem install github-linguist
pip install -e .
From Terminal:
pylinguist
You can also import as a Python module:
import pylinguist as pl
langs = pl.linguist('~/mypath')
PyLinguist parses text output from GitHub Linguist, which is a Ruby program.