{ "info": { "author": "Michael Hirsch, Ph.D.", "author_email": "", "bugtrack_url": null, "classifiers": [ "Development Status :: 5 - Production/Stable", "Environment :: Console", "Framework :: Pytest", "Intended Audience :: Developers", "Intended Audience :: Information Technology", "Operating System :: OS Independent", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7", "Topic :: Software Development :: Libraries :: Ruby Modules", "Topic :: Text Processing :: Filters", "Topic :: Utilities" ], "description": "[![Build Status](https://travis-ci.com/scivision/linguist-python.svg?branch=master)](https://travis-ci.com/scivision/linguist-python)\n[![Coverage Status](https://coveralls.io/repos/github/scivision/linguist-python/badge.svg?branch=master)](https://coveralls.io/github/scivision/linguist-python?branch=master)\n[![Build status](https://ci.appveyor.com/api/projects/status/95502ny5y0bsy8ll?svg=true)](https://ci.appveyor.com/project/scivision/linguist-python)\n[![pypi versions](https://img.shields.io/pypi/pyversions/ghlinguist.svg)](https://pypi.python.org/pypi/ghlinguist)\n[![PyPi Download stats](http://pepy.tech/badge/ghlinguist)](http://pepy.tech/project/ghlinguist)\n\n# linguist-python\nSimple Python command-line wrapper of Ruby-based Github Linguist.\n[Linguist](https://github.com/github/linguist)\n(and hence this Python wrapper) detect the language of a Git repo, based on the `commit`ed files\n[`.gitattributes`](https://github.com/github/linguist#using-gitattributes) \nis used to configure Linguist to not get distracted by `docs` or archive files, etc. using several straightforward rules.\n\nThis Python wrapper attempts to make Linguist a little more careful by warning users of uncommitted changes or additions that could make Linguist silently give very skewed (inaccurate) results, since Linguist only works on files/changes *after* `git commit`.\n\n## Install\n\n1. Install Linguist as usual:\n ```sh\n gem install github-linguist\n ```\n2. Install Python wrapper:\n ```sh\n pip install -e .\n ```\n\n## Usage\nFrom Terminal:\n```\nghlinguist\n```\n\nOr import as a Python module.\n```python\nimport ghlinguist as ghl\n\nlangs = ghl.linguist('~/mypath')\n```\nThe functions return a list of tuples like:\n```\n[('Python'), (97.)]\n[('Fortran'), (3.)]\n```\nwhere the second number is the percentage of code detected for that language.\n\nIf the directory is not a Git repo, `None` is returned\n\n### Examples\nThe primary reason behind creating this Python Linguist wrapper is automatically detecting the repo type, so that appropriate templates can be applied *en masse* to a large number of repos.\nThus to get the repo language from the command line, as GitHub would:\n```sh\nghlinguist -t\n```\n\nor as a Python module:\n```python\nimport ghlinguist as ghl\n\nlang = ghl.linguist('~/mypath', rpath=True)\n```\n\nBoth cases simply return the string `Python` or `Fortran` etc.\n\n## Notes\nghLinguist parses text output from \n[GitHub Linguist](https://github.com/github/linguist#using-emacs-or-vim-modelines), \nwhich is a Ruby program.\nWe call `github-linguist` executable since `linguist` overlaps with QT Lingiust.\n\n### Linux prereqs\nIf you don't already have RubyGems setup on Linux:\n\n1. setup RubyGems:\n ```sh\n apt install ruby-dev libssl-dev libicu-dev zlib1g-dev libcurl4-openssl-dev\n \n gem update --system\n ```\n2. be sure Gems are installed to home directory, NOT system (no sudo) by adding to `~/.bashrc`:\n ```sh\n # Install Ruby Gems to ~/gems\n export GEM_HOME=$HOME/gems\n export PATH=$HOME/gems/bin:$PATH\n ```", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/scivision/linguist-python", "keywords": "github,programming", "license": "", "maintainer": "", "maintainer_email": "", "name": "ghlinguist", "package_url": "https://pypi.org/project/ghlinguist/", "platform": "", "project_url": "https://pypi.org/project/ghlinguist/", "project_urls": { "Homepage": "https://github.com/scivision/linguist-python" }, "release_url": "https://pypi.org/project/ghlinguist/1.0.0/", "requires_dist": null, "requires_python": ">= 3.6", "summary": "simple command-line parser of GitHub Linguist Ruby program.", "version": "1.0.0" }, "last_serial": 4379883, "releases": { "0.9.0": [ { "comment_text": "", "digests": { "md5": "056af5dc926239effeb2d757c043fe09", "sha256": "49d850031e1442192e5a8e987d2b4b11309c5492756ee8d55dd2435850dbf2d2" }, "downloads": -1, "filename": "ghlinguist-0.9.0.tar.gz", "has_sig": false, "md5_digest": "056af5dc926239effeb2d757c043fe09", "packagetype": "sdist", "python_version": "source", "requires_python": ">= 3.6", "size": 3225, "upload_time": "2018-08-02T20:03:53", "url": "https://files.pythonhosted.org/packages/a0/9d/dfd0176f2442b3bad578de951d9949a96e7ef4ba3f0469f2672d6178b6ba/ghlinguist-0.9.0.tar.gz" } ], "0.9.1": [ { "comment_text": "", "digests": { "md5": "27453956ab4439938044b0b6762f01c7", "sha256": "aea11831da77158ccda07a30288d5fd995f1cd4dc102f27bff8ecbd98c60e90c" }, "downloads": -1, "filename": "ghlinguist-0.9.1.tar.gz", "has_sig": false, "md5_digest": "27453956ab4439938044b0b6762f01c7", "packagetype": "sdist", "python_version": "source", "requires_python": ">= 3.6", "size": 4088, "upload_time": "2018-08-03T01:37:59", "url": "https://files.pythonhosted.org/packages/f7/c5/f97d5abdca043de30955cc2e5ad837e2cac64c2f638268104353748f7797/ghlinguist-0.9.1.tar.gz" } ], "0.9.2": [ { "comment_text": "", "digests": { "md5": "8b4d48dfdea1f751a35a3de8e52b4b92", "sha256": "c927fe90f966e838284e5456400caf69540249bd1808ae0b361d869b3ff60b94" }, "downloads": -1, "filename": "ghlinguist-0.9.2.tar.gz", "has_sig": false, "md5_digest": "8b4d48dfdea1f751a35a3de8e52b4b92", "packagetype": "sdist", "python_version": "source", "requires_python": ">= 3.6", "size": 4262, "upload_time": "2018-08-03T21:05:06", "url": "https://files.pythonhosted.org/packages/a1/3d/54cc8da462f2e0962227bf560aa2c9c0b561c3e93f8e398ae7bc5a5552dc/ghlinguist-0.9.2.tar.gz" } ], "0.9.3": [ { "comment_text": "", "digests": { "md5": "65c0c943e82adc12b322301d3f9e64ff", "sha256": "42bf4f25ea7e0c638627f7418870e8fcd79c0fe81542bcc9031ec014b58a89d2" }, "downloads": -1, "filename": "ghlinguist-0.9.3.tar.gz", "has_sig": false, "md5_digest": "65c0c943e82adc12b322301d3f9e64ff", "packagetype": "sdist", "python_version": "source", "requires_python": ">= 3.6", "size": 4577, "upload_time": "2018-08-09T16:39:22", "url": "https://files.pythonhosted.org/packages/32/7f/a99b5fc7bda371942bea3aa4cb96a7831c4ed049f91257500a12fe2c3664/ghlinguist-0.9.3.tar.gz" } ], "1.0.0": [ { "comment_text": "", "digests": { "md5": "be87f6c73c77c359ae5bd74e76bda329", "sha256": "0da67c2991a655922629140c629e346361daa5b3b3dd1c94d3d308052eac03bf" }, "downloads": -1, "filename": "ghlinguist-1.0.0.tar.gz", "has_sig": false, "md5_digest": "be87f6c73c77c359ae5bd74e76bda329", "packagetype": "sdist", "python_version": "source", "requires_python": ">= 3.6", "size": 5080, "upload_time": "2018-10-16T03:33:17", "url": "https://files.pythonhosted.org/packages/a7/e3/39299a4df0ea867b82fc2f3e09a32734fe8b124b7f4fe55dae6919a37ad3/ghlinguist-1.0.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "be87f6c73c77c359ae5bd74e76bda329", "sha256": "0da67c2991a655922629140c629e346361daa5b3b3dd1c94d3d308052eac03bf" }, "downloads": -1, "filename": "ghlinguist-1.0.0.tar.gz", "has_sig": false, "md5_digest": "be87f6c73c77c359ae5bd74e76bda329", "packagetype": "sdist", "python_version": "source", "requires_python": ">= 3.6", "size": 5080, "upload_time": "2018-10-16T03:33:17", "url": "https://files.pythonhosted.org/packages/a7/e3/39299a4df0ea867b82fc2f3e09a32734fe8b124b7f4fe55dae6919a37ad3/ghlinguist-1.0.0.tar.gz" } ] }