{ "info": { "author": "Hiroyuki Ohsaki", "author_email": "h-ohsaki@lsnl.jp", "bugtrack_url": null, "classifiers": [ "License :: OSI Approved :: GNU General Public License v3 (GPLv3)", "Operating System :: OS Independent", "Programming Language :: Python :: 3" ], "description": "# perlcompat Package\n\nperlcompat - Perl-like utility functions such as warn, die, getopt, and require.\n\n# DESCRIPTION\n\nThis manual page documents **perlcompat** module, a Python module providing\nPerl-like utility functions such as warn, die, getopt, and require.\n\nPerl programmers are generally familiar with Perl's useful buil-in functions\nsuch as warn() and die() for displaying debug/error messages as well as its\nstandard modules such as Getopt::Std for parsing UNIX-style command-line\noptions.\n\n**perlcompat** module provides several utility fucntions with functionarites\nsimilar to Perl's counterparts.\n\n# EXAMPLE\n\n```python\nimport os\nimport sys\nfrom perlcompat import warn, die, getopts, require\n\n# make sure the Python is no older than version 3.6\nrequire('3.6')\n\n# display warning message\nwarn('starting of sample program in directory {}...'.format(os.getcwd()))\n\n# parse command-line options\n# variables opt.v, opt.f, and opt.o are automatically defined\nopt = getopts('vf:o:') or die('usage: {} [-v] [-f config] [-o outfile]'.format(sys.argv[0]))\n\nif opt.v:\n warn('verbose mode')\nif opt.f:\n conffile = opt.f if opt.f else 'config.ini'\n warn('config file: {}'.format(conffile))\nif opt.o:\n outfile = opt.o if opt.o else 'out.txt'\n warn('output file: {}'.format(outfile))\n\nwarn('remaining arguments: {}'.format(sys.argv[1:]))\n```\n\n# FUNCTIONS\n\n**perlcompat** module provides the following functions.\n\n- warn(astr)\n\n Display warning message ASTR to the standard error output.\n\n- die(astr)\n\n Display message ASTR to the standard error output and terminate the program\n execution\n\n- getopts(spec)\n\n Parse UNIX-style command line options. Options are specified by SPEC.\n Parsed options are returned as an object. A value for option X is\n accessible trhough the object attribute X.\n\n **perlcompat** module only supports short options (e.g., -v, -f foo.txt).\n Log options (e..g, --verbose, --file foo.txt) are not suported.\n\n- require(version)\n\n Abort the program if the current Python interepter does not satisfy version\n requirement (i.e., the version is older than VERSION).\n\n# INSTALLATION\n\n```python\npip3 install perlcompat\n```\n\n# AVAILABILITY\n\nThe latest version of **perlcompat** module is available at\nhttps://github.com/h-ohsaki/perlcompat.git .\n\n# SEE ALSO\n\nperl(1), perlfunc(1), getopt(3), Getopt::Std(3perl)\n\n# AUTHOR\n\nHiroyuki Ohsaki \n\n\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/h-ohsaki/perlcompat", "keywords": "", "license": "", "maintainer": "", "maintainer_email": "", "name": "perlcompat", "package_url": "https://pypi.org/project/perlcompat/", "platform": "", "project_url": "https://pypi.org/project/perlcompat/", "project_urls": { "Homepage": "https://github.com/h-ohsaki/perlcompat" }, "release_url": "https://pypi.org/project/perlcompat/1.1/", "requires_dist": null, "requires_python": "", "summary": "Perl-like utility functions such as warn, die, getopt, and require", "version": "1.1" }, "last_serial": 5490428, "releases": { "1.1": [ { "comment_text": "", "digests": { "md5": "008443809183e800a4e50c5674e07039", "sha256": "4548c2c91fd3df95015581d8454f1d568b0851f6e89057315cfb3baf80c0af6d" }, "downloads": -1, "filename": "perlcompat-1.1-py3-none-any.whl", "has_sig": false, "md5_digest": "008443809183e800a4e50c5674e07039", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 15780, "upload_time": "2019-07-05T09:20:10", "url": "https://files.pythonhosted.org/packages/42/ab/328e564486228c8ed12085e4439fd39351e23333f52a8ed6833e4715efb8/perlcompat-1.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "4715fa6748f12933117e7559a3dd5937", "sha256": "1d2568814b2ceef1dc32c1393fab78c6dd94bea04eb50b97828f7dc3c3b1a5ea" }, "downloads": -1, "filename": "perlcompat-1.1.tar.gz", "has_sig": false, "md5_digest": "4715fa6748f12933117e7559a3dd5937", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3100, "upload_time": "2019-07-05T09:20:12", "url": "https://files.pythonhosted.org/packages/38/aa/0c57c10ce466505988f04c7e05a35279a4dedb6b6bf8819a165e02819f56/perlcompat-1.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "008443809183e800a4e50c5674e07039", "sha256": "4548c2c91fd3df95015581d8454f1d568b0851f6e89057315cfb3baf80c0af6d" }, "downloads": -1, "filename": "perlcompat-1.1-py3-none-any.whl", "has_sig": false, "md5_digest": "008443809183e800a4e50c5674e07039", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 15780, "upload_time": "2019-07-05T09:20:10", "url": "https://files.pythonhosted.org/packages/42/ab/328e564486228c8ed12085e4439fd39351e23333f52a8ed6833e4715efb8/perlcompat-1.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "4715fa6748f12933117e7559a3dd5937", "sha256": "1d2568814b2ceef1dc32c1393fab78c6dd94bea04eb50b97828f7dc3c3b1a5ea" }, "downloads": -1, "filename": "perlcompat-1.1.tar.gz", "has_sig": false, "md5_digest": "4715fa6748f12933117e7559a3dd5937", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3100, "upload_time": "2019-07-05T09:20:12", "url": "https://files.pythonhosted.org/packages/38/aa/0c57c10ce466505988f04c7e05a35279a4dedb6b6bf8819a165e02819f56/perlcompat-1.1.tar.gz" } ] }