{ "info": { "author": "Gabriele Giammatteo", "author_email": "gabriele.giammatteo@eng.it", "bugtrack_url": null, "classifiers": [], "description": "# Automatically build manpage from argparse\n\nThis repository contains a command for `setup.py` to build\na manpage for your project.\n\nThe initial code was developed for CrunchyFrog, a database query tool for Gnome.\nThe [frog] is now retired and [RunSQLRun] is it's successor. Then, the\n`build_manpage` command was developed in [andialbrecht] and edited slightly\nin [gabrielegiammatteo]. There's even an [old blog post] about this command.\n\nSince some useful work has been done in [python pull request], the code from the\nPR has been used here too (with a belief that upstream merges this, some day).\nThen, some more flexibility has been added.\n\nThe `build_manpages` command for `setup.py` is on it's own way (right here).\nThe old usage from `build_manpage` is still supported, documented in\n[old documentation](examples/old\\_format/README.md).\n\n# Usage\n\nDownload `./build_manpages` directory and place it somewhere where Python can\nfind it. E.g. by:\n\n```bash\ngit submodule add --name build_manpages https://github.com/praiskup/build_manpages\ngit submodule update --init\n```\n\nIn your `setup.py` add:\n\n```python\n[...]\nfrom build_manpages import build_manpages, get_build_py_cmd, get_install_cmd\nfrom setuptools.command.build_py import build_py\nfrom setuptools.command.install import install\n\nsetup(\n [...]\n cmdclass={\n 'build_manpages': build_manpages,\n # Re-define build_py and install commands so the manual pages\n # are automatically re-generated and installed (optional)\n 'build_py': get_build_py_cmd(build_py),\n 'install': get_install_cmd(install),\n }\n)\n```\n\nIn your `setup.cfg` add:\n\n```\n[build_manpages]\nmanpages =\n man/foo.1:object=parser:pyfile=bin/foo.py\n man/bar.1:function=get_parser:pyfile=bin/bar\n```\n\nwhere each line means one manual page to be generated. The format of the lines\nis colon separated set of arguments/options. The first argument determines the\nfilename of the generated manual page. Then follows a list of options of format\n`option=value`; and are about \"how to get the particular argparse object\".\n\nSupported values are:\n\n- pyfile - what python file the argparse object resides in\n- object - the name of arparse object in \"pyfile\" to import\n- function - the name of function in pyfile to call to get the argparse object\n\nThen run `setup.py build_manpages` to build a manpages for your project. Also,\nif you used `get_build_py` helper, `setup.py build` then transitively builds the\nmanual pages.\n\n# Command-line usage\n\nYou can also use `argparse-manpage` command on a command-line. Example:\n\n bin/argparse-manpage --pyfile ./pythonfile --function get_parser --author me --author-email me@domain.com --project-name myproject --url https://pagure.io/myproject > cool-manpage.1\n\nThis reads `./pythonfile` and executes function `get_parser` from it. The function should be programmed to return an `ArgumentParser` instance which is then used together with the other info supplied on the command-line to generate the man page.\n\nSee `bin/argparse-manpage --help` for full info.\n\n# License\n\nThis work is released under the terms of the Apache License v2.0.\nSee LICENSE for details.\n\n[gabrielegiammatteo]: https://github.com/andialbrecht/build\\_manpage\n[andialbrecht]: https://github.com/andialbrecht/build\\_manpage\n[frog]: http://crunchyfrog.googlecode.com/svn/\n[RunSQLRun]: https://github.com/andialbrecht/runsqlrun\n[old blog post]: https://andialbrecht.wordpress.com/2009/03/17/creating-a-man-page-with-distutils-and-optparse/\n[python pull request]: https://github.com/python/cpython/pull/1169", "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/praiskup/argparse-manpage", "keywords": "", "license": "Apache 2.0", "maintainer": "Pavel Raiskup", "maintainer_email": "praiskup@redhat.com", "name": "argparse-manpage", "package_url": "https://pypi.org/project/argparse-manpage/", "platform": "", "project_url": "https://pypi.org/project/argparse-manpage/", "project_urls": { "Homepage": "https://github.com/praiskup/argparse-manpage" }, "release_url": "https://pypi.org/project/argparse-manpage/1.2.2/", "requires_dist": null, "requires_python": "", "summary": "Build manual page from python's ArgumentParser object.", "version": "1.2.2" }, "last_serial": 5796133, "releases": { "1.0.0": [ { "comment_text": "", "digests": { "md5": "5f2333626bb0a5107fb60d4ecd47fd5a", "sha256": "486869d617b6b58146002dd643449b929cf69779cc612730863462559aa376ca" }, "downloads": -1, "filename": "argparse-manpage-1.0.0.tar.gz", "has_sig": false, "md5_digest": "5f2333626bb0a5107fb60d4ecd47fd5a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8493, "upload_time": "2018-01-22T14:44:40", "url": "https://files.pythonhosted.org/packages/11/04/c61a631bfaee7d9401f6cd28f8a097d5e15efe0acb69552cc72154584cd0/argparse-manpage-1.0.0.tar.gz" } ], "1.1": [ { "comment_text": "", "digests": { "md5": "65017bbff887d4bca1febc94a5c6b977", "sha256": "b7480e20841a34400bffc0dc93340924b480202f6ad1a46cb40a196d7f18902e" }, "downloads": -1, "filename": "argparse-manpage-1.1.tar.gz", "has_sig": false, "md5_digest": "65017bbff887d4bca1febc94a5c6b977", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 49044, "upload_time": "2018-06-25T20:50:34", "url": "https://files.pythonhosted.org/packages/c8/4b/0d08ef14a77105dd81dddb3aff4da7ab77e6f482c5167d2994b6566234a2/argparse-manpage-1.1.tar.gz" } ], "1.2.1": [ { "comment_text": "", "digests": { "md5": "9af77f5d0ff6e827127372348907a1b2", "sha256": "11d644e77085d1fbffc32933a5658362d1e5e2f9ae7f0c44c488bfcf6fb90f7e" }, "downloads": -1, "filename": "argparse-manpage-1.2.1.tar.gz", "has_sig": false, "md5_digest": "9af77f5d0ff6e827127372348907a1b2", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 12849, "upload_time": "2019-09-07T00:44:35", "url": "https://files.pythonhosted.org/packages/d4/35/9c85a25f00ce60d8fc7b87845fc99b71c201791845a34ab622620c2a6aa4/argparse-manpage-1.2.1.tar.gz" } ], "1.2.2": [ { "comment_text": "", "digests": { "md5": "4e00474b51c8b3c6ec4b23318030f556", "sha256": "daffa8e2d1bbcb1334c842ee2529bb1e1b58f4b17ed60f4b27891520e28cd842" }, "downloads": -1, "filename": "argparse-manpage-1.2.2.tar.gz", "has_sig": false, "md5_digest": "4e00474b51c8b3c6ec4b23318030f556", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 32261, "upload_time": "2019-09-07T13:26:16", "url": "https://files.pythonhosted.org/packages/87/c0/f29c67ecadfab69bdb2a78371e20c1a7d41a8502ee75f9037f5097d81ac2/argparse-manpage-1.2.2.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "4e00474b51c8b3c6ec4b23318030f556", "sha256": "daffa8e2d1bbcb1334c842ee2529bb1e1b58f4b17ed60f4b27891520e28cd842" }, "downloads": -1, "filename": "argparse-manpage-1.2.2.tar.gz", "has_sig": false, "md5_digest": "4e00474b51c8b3c6ec4b23318030f556", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 32261, "upload_time": "2019-09-07T13:26:16", "url": "https://files.pythonhosted.org/packages/87/c0/f29c67ecadfab69bdb2a78371e20c1a7d41a8502ee75f9037f5097d81ac2/argparse-manpage-1.2.2.tar.gz" } ] }