{ "info": { "author": "Chris Spencer", "author_email": "chrisspen@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 5 - Production/Stable", "Environment :: Console", "Intended Audience :: Developers", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.6", "Programming Language :: Python :: 2.7", "Topic :: Documentation" ], "description": "Howdou\n======\n\nThis is a fork of Benjamin Gleitzman's excellent\n`Howdoi `__ tool.\n\nIt's been extended to support a local indexed cache of answers using\n`Elasticsearch `__ as the\nbackend search server. This allows faster searches and the ability to\nadd custom answer annotations and documentation via a local\n`YAML `__ file.\n\nI made this modification when I realized that howdoi is ideal for\nfinding common one-liners when what I really needed was help finding\nless common guides and solutions for subtle, but more complex problems.\nIn these cases, I found that the solutions provided by howdoi still\nrequired I do more research and write notes, notes that I needed to\nstore somewhere for later reference.\n\nMy solution was to organized my notes in a YAML file, index this file\nwith Elasticsearch, and modify howdoi to refer to my Elasticsearch index\nfirst.\n\nInstant coding answers via the command line\n-------------------------------------------\n\nAre you a hack programmer? Do you find yourself constantly Googling for\nhow to do basic programing tasks?\n\nSuppose you want to know how to format a date in bash. Why open your\nbrowser and read through blogs (risking major distraction) when you can\nsimply stay in the console and ask howdou:\n\n::\n\n $ howdou format date bash\n > DATE=`date +%Y-%m-%d`\n\nhowdou will answer all sorts of queries:\n\n::\n\n $ howdou print stack trace python\n > import traceback\n >\n > try:\n > 1/0\n > except:\n > print '>>> traceback <<<'\n > traceback.print_exc()\n > print '>>> end of traceback <<<'\n > traceback.print_exc()\n\n $ howdou convert mp4 to animated gif\n > video=/path/to/video.avi\n > outdir=/path/to/output.gif\n > mplayer \"$video\" \\\n > -ao null \\\n > -ss \"00:01:00\" \\ # starting point\n > -endpos 10 \\ # duration in second\n > -vo gif89a:fps=13:output=$outdir \\\n > -vf scale=240:180\n\n $ howdou create tar archive\n > tar -cf backup.tar --exclude \"www/subf3\" www\n\nInstallation\n------------\n\nFirst, install Elasticsearch. On Ubuntu, this is simply:\n\n::\n\n sudo apt-get install default-jre elasticsearch\n\nor:\n\n::\n\n cd /tmp\n wget https://download.elasticsearch.org/elasticsearch/release/org/elasticsearch/distribution/deb/elasticsearch/2.0.0/elasticsearch-2.0.0.deb\n sudo dpkg -i elasticsearch-2.0.0.deb\n sudo service elasticsearch start\n\nEnable inline script searches:\n\n::\n\n sudo sh -c \"echo 'script.engine.groovy.inline.search: on' >> /etc/elasticsearch/elasticsearch.yml\"\n sudo service elasticsearch restart \n\nYou may also need to enable the service to start at boot with:\n\n::\n\n sudo update-rc.d elasticsearch defaults\n sudo update-rc.d elasticsearch enable\n\nMake sure that the version of ElasticSearch matches the version of the\nelasticsearch Python package installed in your virtualenv.\n\nThen install howdou via pip with:\n\n::\n\n pip install howdou\n\nor\n\n::\n\n pip install git+https://github.com/chrisspen/howdou.git#egg=howdou\n\nor\n\n::\n\n python setup.py install\n\nhttps://elasticsearch-py.readthedocs.org/en/master/\n\nUsage\n-----\n\nThe command line is pretty straight-forward:\n\n::\n\n usage: howdou.py [-h] [-p POS] [-a] [-l] [-c] [-n NUM_ANSWERS] QUERY [QUERY ...]\n\n instant coding answers via the command line\n\n positional arguments:\n QUERY the question to answer\n\n optional arguments:\n -h, --help show this help message and exit\n -p POS, --pos POS select answer in specified position (default: 1)\n -a, --all display the full text of the answer\n -l, --link display only the answer link\n -c, --color enable colorized output\n -n NUM_ANSWERS, --num-answers NUM_ANSWERS\n number of answers to return\n -C, --clear-cache clear the cache\n\nTo take full advantage of howdou, you'll need to maintain a local\nhowdou.yml file, which is a simple serialized list of QA-sets that look\nlike:\n\n::\n\n - questions:\n - format date bash\n answers:\n - weight: 1\n date: 2014-5-14\n source: http://stackoverflow.com/questions/1401482/yyyy-mm-dd-format-date-in-shell-script\n formatter: bash\n text: |-\n DATE=`date +%Y-%m-%d`\n\nNote each item is an association of many-questions to many-answers. This\nis because there are many ways to ask the same thing, and we want the\nindex to be as likely as possible to correctly match your question to an\nanswer.\n\nThere's also an explicit weight value, which will be incorporated into\nElasticsearch's own search weight to control the order that results are\nshown.\n\nTo automatically reindex your changes, checking every 5 minutes, run:\n\n::\n\n crontab -e\n\nand add these lines:\n\n::\n\n # Do a quick frequent update.\n */5 * * * * . /home/yourusername/.bash_aliases; howdou --action=reindex\n\n # Do a slower but more thorough update less frequently.\n 0 6 * * * . /home/yourusername/.bash_aliases; howdou --action=reindex --force\n\nElasticsearch\n-------------\n\nA caveat with the Elasticsearch backend is that the default\nconfiguration can be a huge memory hog.\n\nYou'll probably want to edit ``/etc/elasticsearch/jvm.options`` and\ndrastically reduce the values for ``Xms`` and ``Xmx``.\n\nDevelopment\n-----------\n\nTests require the Python development headers to be installed, which you\ncan install on Ubuntu with:\n\n::\n\n sudo add-apt-repository ppa:fkrull/deadsnakes\n sudo apt-get update\n sudo apt-get install python-dev python3-dev python3.4-minimal python3.4-dev python3.5-minimal python3.5-dev pandoc\n\nTo run all `tests `__:\n\n::\n\n export TESTNAME=; tox\n\nTo run tests for a specific environment (e.g. Python 2.7):\n\n::\n\n export TESTNAME=; tox -e py27\n\nTo run a specific test:\n\n::\n\n export TESTNAME=:HowdouTestCase.test_unicode_answer; tox -e py27", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/chrisspen/howdou", "keywords": "howdou help console command line answer", "license": "MIT", "maintainer": null, "maintainer_email": null, "name": "howdou", "package_url": "https://pypi.org/project/howdou/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/howdou/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/chrisspen/howdou" }, "release_url": "https://pypi.org/project/howdou/3.0.6/", "requires_dist": null, "requires_python": null, "summary": "Instant coding answers via the command line", "version": "3.0.6" }, "last_serial": 2695477, "releases": { "2.0.0": [ { "comment_text": "", "digests": { "md5": "30e4706f977838961fa0fee2a271e539", "sha256": "10dc364f89a58a23df50392af8e7e70898e68a2e3d5bad351f5c6314c070707b" }, "downloads": -1, "filename": "howdou-2.0.0.tar.gz", "has_sig": false, "md5_digest": "30e4706f977838961fa0fee2a271e539", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5932, "upload_time": "2014-05-14T19:34:44", "url": "https://files.pythonhosted.org/packages/e4/f9/22b6bb9919b2a7edbbef63622f8100e870b9b01026dcaba0051ebcdbeef1/howdou-2.0.0.tar.gz" } ], "2.0.1": [ { "comment_text": "", "digests": { "md5": "94da67bdf7e00b39a9e9610010a74818", "sha256": "8af771d5598a9aa83970a80343beeb2158993086939ed8912bf685179bc804c0" }, "downloads": -1, "filename": "howdou-2.0.1.tar.gz", "has_sig": false, "md5_digest": "94da67bdf7e00b39a9e9610010a74818", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8921, "upload_time": "2014-07-07T01:37:11", "url": "https://files.pythonhosted.org/packages/6c/57/a2350cae182b019aa219deaf736ca9cc7906c7f863966c45263321f9b3a8/howdou-2.0.1.tar.gz" } ], "2.0.2": [ { "comment_text": "", "digests": { "md5": "d0d8ade3092a14cab73c57a4f7462ec3", "sha256": "2ee4a06dba912e20367bf023c4ca0614729636a68224c023a56e4875c54f2ce5" }, "downloads": -1, "filename": "howdou-2.0.2.tar.gz", "has_sig": false, "md5_digest": "d0d8ade3092a14cab73c57a4f7462ec3", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8919, "upload_time": "2014-07-07T01:39:40", "url": "https://files.pythonhosted.org/packages/ca/90/b2aacc28098af0060a5057da4377a22a7d99127019990d460b10662c419f/howdou-2.0.2.tar.gz" } ], "2.0.3": [ { "comment_text": "", "digests": { "md5": "85f0169e94431c80f8ca8d8e27f7be9f", "sha256": "2648bacbc55762791d478e23c600f7e3ca835454cf716f6a93bf9f122e958c8c" }, "downloads": -1, "filename": "howdou-2.0.3.tar.gz", "has_sig": false, "md5_digest": "85f0169e94431c80f8ca8d8e27f7be9f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8921, "upload_time": "2014-07-07T01:44:43", "url": "https://files.pythonhosted.org/packages/0a/89/abb13c0d9e945d50c46f07596c22fdebc897b66d6f5d76f810376b47c8d8/howdou-2.0.3.tar.gz" } ], "2.0.4": [ { "comment_text": "", "digests": { "md5": "e723d1016bd1b5fedeb3bf6279b757de", "sha256": "4afc7e7917fcc56cb98f40e42df19f59a8208d49efd9385572cb3656c5d4301c" }, "downloads": -1, "filename": "howdou-2.0.4.tar.gz", "has_sig": false, "md5_digest": "e723d1016bd1b5fedeb3bf6279b757de", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9008, "upload_time": "2014-07-24T21:38:54", "url": "https://files.pythonhosted.org/packages/48/17/0b29fb4609abefa5f73f29228629c9b15bd5fcacee8b3e1339d637339585/howdou-2.0.4.tar.gz" } ], "2.0.5": [ { "comment_text": "", "digests": { "md5": "4456c922853d0cdd154fd44a4c55ba9c", "sha256": "2ca72abfb696d3a42e40b4966c11b61fb593c4346a9bcfd802127e47d59e58ad" }, "downloads": -1, "filename": "howdou-2.0.5.tar.gz", "has_sig": false, "md5_digest": "4456c922853d0cdd154fd44a4c55ba9c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9028, "upload_time": "2014-07-24T23:27:28", "url": "https://files.pythonhosted.org/packages/00/0c/7d882612c1bb4e512994a4f88ede69687d11dde47b79f0ac1e9a535574db/howdou-2.0.5.tar.gz" } ], "3.0.2": [ { "comment_text": "", "digests": { "md5": "c647ba4025ebc91bda4c6c673a4abf87", "sha256": "18efe20bd17de1c88014b58cf7a0776c0302d0b771daaed96bf4f201e5dbf27b" }, "downloads": -1, "filename": "howdou-3.0.2.tar.gz", "has_sig": false, "md5_digest": "c647ba4025ebc91bda4c6c673a4abf87", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 13901, "upload_time": "2017-02-18T08:53:21", "url": "https://files.pythonhosted.org/packages/b7/bf/413cd248ee6a65ba8296d00ad37552d1f68bd06f5d679e6257fef6a6489c/howdou-3.0.2.tar.gz" } ], "3.0.3": [ { "comment_text": "", "digests": { "md5": "8f75b0fe5fffad3c9c3e2960d53f19f9", "sha256": "8004ef88f6e2a53e055289c864d25c5613b637761236a73ba820bbf22ae1e1b0" }, "downloads": -1, "filename": "howdou-3.0.3.tar.gz", "has_sig": false, "md5_digest": "8f75b0fe5fffad3c9c3e2960d53f19f9", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 14660, "upload_time": "2017-02-20T00:35:37", "url": "https://files.pythonhosted.org/packages/da/1c/6aa4356fbf26870e3d97ce8d2112a8a02f7d1c4883f5454379b0feca72a0/howdou-3.0.3.tar.gz" } ], "3.0.4": [ { "comment_text": "", "digests": { "md5": "ed837c25cb1fb98889cf58ecd77ca3c3", "sha256": "9b4bd0cf0b0af3965d4e5e3bd1374865835e9581478842b8f4959897d6046291" }, "downloads": -1, "filename": "howdou-3.0.4.tar.gz", "has_sig": false, "md5_digest": "ed837c25cb1fb98889cf58ecd77ca3c3", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 14788, "upload_time": "2017-02-20T00:37:40", "url": "https://files.pythonhosted.org/packages/96/52/109c1147e53bf30393d5e28acf7825fb79cb46d6f3e44abf2b5e4eb7da16/howdou-3.0.4.tar.gz" } ], "3.0.6": [ { "comment_text": "", "digests": { "md5": "0e4a684d4a9d6233e9b866ad5e032234", "sha256": "a1a374bd751669a3cefb977567510cf2be0b522112881d1af40031859633f0b0" }, "downloads": -1, "filename": "howdou-3.0.6.tar.gz", "has_sig": false, "md5_digest": "0e4a684d4a9d6233e9b866ad5e032234", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 14974, "upload_time": "2017-03-09T22:45:27", "url": "https://files.pythonhosted.org/packages/d2/47/6324d1aeda867b7003b18b5fe4a8d0a6a3d64ccadc8e425456f2857fbbb0/howdou-3.0.6.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "0e4a684d4a9d6233e9b866ad5e032234", "sha256": "a1a374bd751669a3cefb977567510cf2be0b522112881d1af40031859633f0b0" }, "downloads": -1, "filename": "howdou-3.0.6.tar.gz", "has_sig": false, "md5_digest": "0e4a684d4a9d6233e9b866ad5e032234", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 14974, "upload_time": "2017-03-09T22:45:27", "url": "https://files.pythonhosted.org/packages/d2/47/6324d1aeda867b7003b18b5fe4a8d0a6a3d64ccadc8e425456f2857fbbb0/howdou-3.0.6.tar.gz" } ] }