{ "info": { "author": "Steve Matsumoto", "author_email": "stephanos.matsumoto@sporic.me", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "Environment :: Console", "Intended Audience :: Science/Research", "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python :: 3" ], "description": "# LineSample\n\nUtility to randomly sample lines from an input file.\n\nThis module implements a command-line utility that randomly samples lines\nfrom an input file. It is possible to sample lines by the probability of\neach line being selected or by giving an overall number of lines. In either\ncase, the lines can be sampled with a single pass through the file, and the\nordering of lines in the original file is preserved. For reproducibility,\nthis module also supports seeding of the pseudorandom number generator used.\n\nOnly modules from the Python 3 standard library are used in this code. Type\nhints (from the typing module), which at the time of writing is still a\nprovisional API, are also used.\n\n# Installation\n\nCurrently, this module is only available for Python 3. You can install it \nwith `pip install linesample`.\n\n# Usage\n\nTo sample half of all lines from an input file `foo.txt`, run\n\n```\nlinesample -f0.5 foo.txt\n```\n\nTo sample up to 100 lines from `bar.txt`, run\n```\nlinesample -n100 bar.txt\n```\n\nYou must use one of the forms above. Specifying neither or both options will\nresult in an error.\n\nBy default, the utility uses the system time as the seed for its \npseudorandom number generator. You can choose your own seed using a form \nlike this:\n\n```\nlinesample -s42 -n100 baz.txt\n```\n\nFor reference, the usage string is as follows:\n\n```\nusage: ['linesample.py', '-h'] [-h] [-s SEED] [-f FRACTION | -n NUMBER] infile\n\npositional arguments:\n infile input file\n\noptional arguments:\n -h, --help show this help message and exit\n -s SEED, --seed SEED seed for random number generator\n -f FRACTION, --fraction FRACTION\n fraction of lines to select\n -n NUMBER, --number NUMBER\n number of lines to select\n```\n\n# License\n\nThis module is distributed under the MIT License, whose text is listed both\nin the LICENSE file provided with this package and immediately below.\n\nCopyright (c) 2019 Steve Matsumoto\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\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/syclops/linesample", "keywords": "", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "linesample", "package_url": "https://pypi.org/project/linesample/", "platform": "", "project_url": "https://pypi.org/project/linesample/", "project_urls": { "Homepage": "https://github.com/syclops/linesample" }, "release_url": "https://pypi.org/project/linesample/0.1.1/", "requires_dist": null, "requires_python": ">=3", "summary": "Utility to randomly sample lines from a file", "version": "0.1.1" }, "last_serial": 5498409, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "7328dc189c11065c75f1f0afc176ed81", "sha256": "77b573ae717167707e9c8cac28ea63818f33b18cac3b418b17a3717236308688" }, "downloads": -1, "filename": "linesample-0.1.0-py3-none-any.whl", "has_sig": false, "md5_digest": "7328dc189c11065c75f1f0afc176ed81", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3", "size": 3517, "upload_time": "2019-07-07T22:09:39", "url": "https://files.pythonhosted.org/packages/c5/9a/38e9442bc07c37d7da80ad5ae712ec756a077a2b1525e828ed8a66115865/linesample-0.1.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "c2645e087d0797d4195715a1379a0485", "sha256": "8640318253b49b24003c6d83eb80ee39b0cdf45ee3b716112834517ad0a070e7" }, "downloads": -1, "filename": "linesample-0.1.0.tar.gz", "has_sig": false, "md5_digest": "c2645e087d0797d4195715a1379a0485", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3", "size": 2890, "upload_time": "2019-07-07T22:09:41", "url": "https://files.pythonhosted.org/packages/d4/e2/08833382a62534d05cdf025ef1403b13261c428f982042e6490e3a28a134/linesample-0.1.0.tar.gz" } ], "0.1.1": [ { "comment_text": "", "digests": { "md5": "ab502b96432f8c353c451ee1cbc0eb38", "sha256": "38aab3fdcb979d903945b33fca2173730a07248917832d26f4fe06e110ac8144" }, "downloads": -1, "filename": "linesample-0.1.1-py3-none-any.whl", "has_sig": false, "md5_digest": "ab502b96432f8c353c451ee1cbc0eb38", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3", "size": 6902, "upload_time": "2019-07-07T23:36:46", "url": "https://files.pythonhosted.org/packages/58/f3/81fce917ea77bf95c46fac6fc54dcae0d8d6ec0e5aaf84c779fa2eaf724c/linesample-0.1.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "00f326c4745e5933192afc619edea61a", "sha256": "aabd9f6c303a00fc5ab405557e803cd32adffaf02ceaaa549ddfd42a74b6104b" }, "downloads": -1, "filename": "linesample-0.1.1.tar.gz", "has_sig": false, "md5_digest": "00f326c4745e5933192afc619edea61a", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3", "size": 4669, "upload_time": "2019-07-07T23:36:48", "url": "https://files.pythonhosted.org/packages/c7/f8/ab5993ea74e2a2ca00a195f9d7a2fd87d2bfcecc9c2ce041ab4dc28a068d/linesample-0.1.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "ab502b96432f8c353c451ee1cbc0eb38", "sha256": "38aab3fdcb979d903945b33fca2173730a07248917832d26f4fe06e110ac8144" }, "downloads": -1, "filename": "linesample-0.1.1-py3-none-any.whl", "has_sig": false, "md5_digest": "ab502b96432f8c353c451ee1cbc0eb38", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3", "size": 6902, "upload_time": "2019-07-07T23:36:46", "url": "https://files.pythonhosted.org/packages/58/f3/81fce917ea77bf95c46fac6fc54dcae0d8d6ec0e5aaf84c779fa2eaf724c/linesample-0.1.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "00f326c4745e5933192afc619edea61a", "sha256": "aabd9f6c303a00fc5ab405557e803cd32adffaf02ceaaa549ddfd42a74b6104b" }, "downloads": -1, "filename": "linesample-0.1.1.tar.gz", "has_sig": false, "md5_digest": "00f326c4745e5933192afc619edea61a", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3", "size": 4669, "upload_time": "2019-07-07T23:36:48", "url": "https://files.pythonhosted.org/packages/c7/f8/ab5993ea74e2a2ca00a195f9d7a2fd87d2bfcecc9c2ce041ab4dc28a068d/linesample-0.1.1.tar.gz" } ] }