{ "info": { "author": "Elijah Rutschman", "author_email": "elijahr@gmail.com", "bugtrack_url": null, "classifiers": [ "License :: OSI Approved :: MIT License", "Topic :: System :: Systems Administration", "Topic :: Utilities" ], "description": "`lk`_ - A programmer\u2019s search tool, parallel and fast\r\n=====================================================\r\n\r\nNotes\r\n-----\r\n\r\n- Written in Python\r\n- Inspired by `ack`_\r\n- Parallelism: searches directories in parallel using Python\u2019s\r\n multiprocessing library\r\n- Makes searching from Python programs easy via \u2018import lk\u2019\r\n\r\nExamples\r\n--------\r\n\r\nSearch for the word \u2018class\u2019 in the current working directory\r\n\r\n::\r\n\r\n $ lk class\r\n /home/elijah/Development/lk/lk.py:\r\n 10: class NullDevice():\r\n 54: class SearchManager(object):\r\n 85: class ColorWriter:\r\n 122: class DirectoryResult(object):\r\n 145: class LineResult(object):\r\n\r\nSearch for the regex \u201cline\\_.\\*\u201d in /home/elijah/Development/lk/\r\n\r\n::\r\n\r\n $ lk \"line_.*\" /home/elijah/Development/lk/\r\n /home/elijah/Development/lk/lk.py:\r\n 129: self._line_results = {}\r\n 134: line_number = file_contents.count('\\n', 0, match_start) + 1\r\n 139: line_result = LineResult(line_number, left_offset,\r\n 142: if not file_name in self._line_results:\r\n 143: self._line_results[file_name] = []\r\n 144: self._line_results[file_name].append(line_result)\r\n 146: def get_line_results(self):\r\n 147: return self._line_results.items()\r\n 150: def __init__(self, line_number, left_offset, left_of_group,\r\n 152: self.line_number = line_number\r\n 160: for file_name, line_results in directory_result.get_line_results():\r\n 164: for line_result in line_results:\r\n 165: writer.write('%s: ' % (line_result.line_number))\r\n 166: writer.write(line_result.left_of_group)\r\n 167: writer.write_blue(line_result.group)\r\n 168: writer.write(line_result.right_of_group+'\\n')\r\n\r\nInstallation\r\n------------\r\n\r\n::\r\n\r\n $ sudo easy_install lk\r\n\r\nor\r\n\r\n::\r\n\r\n $ sudo pip install lk\r\n\r\nBleeding Edge Installation\r\n--------------------------\r\n\r\nIf you want to use the latest and greatest version of lk:\r\n\r\n::\r\n\r\n $ git clone git://github.com/elijahr/lk.git\r\n $ cd lk\r\n $ sudo chmod +x lk.py\r\n $ sudo ln -s `pwd`/lk.py /usr/local/bin/lk\r\n\r\nThen whenever you feel like updating to the latest, just do this:\r\n\r\n::\r\n\r\n $ cd lk && git pull\r\n\r\nUsage\r\n-----\r\n\r\n::\r\n\r\n usage: lk [-h] [--ignore-case] [--no-unicode] [--no-multiline] [--dot-all]\r\n [--follow-links] [--hidden] [--binary] [--no-colors] [--stats]\r\n [--num-processes NUMBER_PROCESSES] [--exclude PATH_PATTERN]\r\n [--open-with COMMAND]\r\n PATTERN [DIRECTORY]\r\n\r\n A programmer's search tool, parallel and fast\r\n\r\n positional arguments:\r\n PATTERN a python re regular expression\r\n DIRECTORY a directory to search in (default cwd)\r\n\r\n optional arguments:\r\n -h, --help show this help message and exit\r\n --ignore-case, -i ignore case when searching\r\n --no-unicode, -u unicode-unfriendly searching\r\n --no-multiline, -l don't search over multiple lines\r\n --dot-all, -a dot in pattern matches newline\r\n --follow-links, -s follow symlinks\r\n --hidden, -n search hidden files and directories\r\n --binary, -b search binary files\r\n --no-colors, -c don't print ANSI colors\r\n --stats, -t print statistics\r\n --num-processes NUMBER_PROCESSES, -p NUMBER_PROCESSES\r\n number of child processes to concurrently search with\r\n --exclude PATH_PATTERN, -x PATH_PATTERN\r\n exclude paths matching PATH_PATTERN\r\n --open-with COMMAND, -o COMMAND\r\n run each COMMAND where COMMAND is a string with a\r\n placeholder, %s, for the absolute path of the matched\r\n file\r\n\r\nIssues?\r\n-------\r\n\r\nPlease report any encountered bugs at\r\nhttp://github.com/elijahr/lk/issues\r\n\r\n.. _lk: http://github.com/elijahr/lk/\r\n.. _ack: http://betterthangrep.com/", "description_content_type": null, "docs_url": null, "download_url": "https://github.com/downloads/elijahr/lk/lk-1.1.tar.gz", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "http://github.com/elijahr/lk", "keywords": "search tool utility grep", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "lk", "package_url": "https://pypi.org/project/lk/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/lk/", "project_urls": { "Download": "https://github.com/downloads/elijahr/lk/lk-1.1.tar.gz", "Homepage": "http://github.com/elijahr/lk" }, "release_url": "https://pypi.org/project/lk/1.1/", "requires_dist": null, "requires_python": null, "summary": "A programmer's search tool, parallel and fast", "version": "1.1" }, "last_serial": 803066, "releases": { "1.1": [] }, "urls": [] }