Skip to content

scivision/linguist-python

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Build Status Coverage Status Build status

python-linguist

Simple command-line wrapper of Ruby-based Github Linguist

Prereqs

Since we are merely parsing the original Linguist command-line output, we need to install Linguist as usual. Assuming Linux:

  1. setup RubyGems:
    apt install ruby-dev libssl-dev
    
    gem update --system
  2. 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
  3. install Github Linguist:
    gem install github-linguist

Install

pip install -e .

Usage

From Terminal:

pylinguist

You can also import as a Python module:

import pylinguist as pl

langs = pl.linguist('~/mypath')

Notes

PyLinguist parses text output from GitHub Linguist, which is a Ruby program.