{ "info": { "author": "Christopher D. Lasher", "author_email": "chris.lasher@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 5 - Production/Stable", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3.2", "Programming Language :: Python :: 3.3", "Topic :: Software Development :: Libraries" ], "description": "*********\nConvUtils\n*********\n\nConvUtils provides a small library of convenience functions for dealing\nwith a variety of tasks, such as creating CSV readers and writers, and\nconvenient data structures, such as a two-way dictionary.\n\nThis package provides two modules: ``utils`` and ``structs``.\nTypically, the user will want to import one or the other, e.g.\n\n::\n\n from convutils import utils\n\n\n#####\nutils\n#####\n\n``utils`` provides the following classes:\n\n* ``SimpleTsvDialect`` is similar to the ``csv.excel_tab`` dialect, but\n uses the newline character (``'\\n'``) as the line separator, and does\n no special quoting, giving a more Unix-friendly TSV (tab-separated\n values) format. (*New in v2.0: formerly ExcelTabNewlineDialect.*)\n\n``utils`` also provides the following functions:\n\n* ``make_csv_reader`` creates a ``csv.DictReader`` or ``csv.Reader``\n instance with the convenience of the user not having to explicitly\n specify the CSV dialect.\n* ``make_simple_tsv_reader`` is similar to ``make_csv_reader``, but\n always uses ``SimpleTsvDialect``. (*New in v2.0.*)\n* ``make_csv_dict_writer`` creates a ``csv.DictWriter`` instance with\n the convenience of not having to manually enter the header row\n yourself; uses ``csv.excel`` as the dialect, by default.\n* ``make_simple_tsv_dict_writer`` is similar to\n ``make_csv_dict_writer``, but uses the ``SimpleTsvDialect`` instead.\n (*New in v2.0.*)\n* ``append_to_file_base_name`` will return a modified file name given\n an original one and a string between the base name and the extension\n (e.g., ``append_to_file_base_name('myfile.txt', '-2')`` returns\n ``'myfile-2.txt'``).\n* ``count_lines`` counts the number of lines in a file.\n* ``split_file_by_parts`` takes one large file and splits it into new\n files, the maximum number of which is given by the user.\n* ``split_file_by_num_lines`` takes one large file and splits it into\n new file, the maximum number of lines in each being defined by the\n user.\n* ``column_args_to_indices`` takes a string representing desired\n columns (e.g., ``'1-4,6,8'``) and converts it into actual indices\n and slices of an indexable Python sequence.\n* ``cumsum`` produces the cumulative sum of any iterable whose elements\n support the add operator. (*New in v1.1.*)\n\n\n#######\nstructs\n#######\n\n``structs`` provides two convenient data structures, both\nspecialized subclasses of Python's ``dict``.\n\n* ``SortedTupleKeysDict`` is a dictionary which expects 2-tuples as\n keys, and will always sort the tuples, either when setting or\n retrieving values.\n* ``TwoWaySetDict`` is a dictionary that assumes the values are sets,\n and will store a reverse lookup dictionary to tell you, for each set\n in the values that some item belongs to, the keys with which item is\n associated.\n\n``structs`` also provides two functions for sampling Python\ndictionaries whose values are lists:\n\n* ``sample_list_dict`` is like ``random.sample`` but for dictionaries\n whose values are lists or other enumerable, iterable container types.\n (*New in v1.1; relocated to* ``structs`` *in v2.0.*)\n* ``sample_list_dict_low_mem`` is similar to ``sample_list_dict`` but\n has a lower memory consumption for larger dictionaries. (*New in\n v1.1; relocated to* ``structs`` *in v2.0.*)\n\n\n############\nInstallation\n############\n\nInstallation is easy with `pip`_; simply run ::\n\n pip install ConvUtils\n\n.. _pip: http://pypi.python.org/pypi/pip\n\n\n############\nAvailability\n############\n\n* PyPI page: http://pypi.python.org/pypi/ConvUtils/\n* GitHub project page: https://github.com/gotgenes/python-ConvUtils\n\n#########\nCHANGELOG\n#########\n\nv2.0\n====\n\n* Refactored code for Python 3 compatibility via 2to3 during installation.\n* Dropped compatibility for Python 2 versions less than 2.7.\n* Added dependency on `mock`_ for unit tests. This dependency is\n satisfied by the standard library for Python 3.3 and newer.\n* Renamed ``convutils.convutils`` to ``convutils.utils``; renamed\n ``convutils.convstructs`` to ``convutils.structs``.\n* Added unit tests for ``convutils.utils``.\n* Renamed ``ExcelTabNewlineDialect`` to ``SimpleTsvDialect``, and\n changed its quoting style to no quoting.\n* Refactored ``make_csv_reader`` and ``make_simple_tsv_dict_writer`` to\n use the ``csv.excel`` dialect by default, to be more in line with the\n standard library. Added new functions ``make_simple_tsv_reader`` and\n ``make_simple_tsv_dict_writer`` for the previous functionality.\n* Renamed the ``headers`` parameter to ``header`` for\n ``make_csv_reader`` and ``make_simple_tsv_reader``.\n* Changed the signatures of ``split_file_by_num_lines`` and\n ``split_file_by_parts``. The functions now accept a file handle\n instead of a file name. The parameter ``has_header`` has been renamed\n ``header``. Added two new parameters, ``pad_file_names`` and\n ``num_lines_total``. If ``pad_file_names`` is ``True``, the numerical\n portion of the output file names will be zero-padded. If\n ``num_lines_total`` is provided in addition to ``pad_file_names``,\n ``split_file_by_num_lines`` and ``split_file_by_parts`` will skip\n counting the number of lines in the file, itself, which can save time.\n* ``SortedTupleKeysDict`` and ``TwoWaySetDict`` now subclass\n ``collections.MutableMapping`` instead of ``dict`` directly due to the\n suggestions on best-practices from Stack Overflow:\n http://stackoverflow.com/questions/3387691/python-how-to-perfectly-override-a-dict\n* Relocated ``sample_list_dict`` and ``sample_list_dict_low_mem`` to\n ``convutils.structs``.\n* Added Sphinx-based documentation.\n\n.. _mock: http://www.voidspace.org.uk/python/mock/\n\n\nv1.1 2012-03-23\n===============\n\n* Changed docstrings to use Sphinx info field lists.\n* Added ``cumsum``\n* Added ``sample_list_dict`` and ``sample_list_dict_low_mem``.\n\n\nv1.0.1 2011-01-18\n=================\n\n* Added imports of modules into package __init__.py.\n\n\nv1.0 2011-01-10\n===============\n\n* Initial release.", "description_content_type": null, "docs_url": "https://pythonhosted.org/ConvUtils/", "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "http://pypi.python.org/pypi/ConvUtils/", "keywords": null, "license": "MIT License", "maintainer": null, "maintainer_email": null, "name": "ConvUtils", "package_url": "https://pypi.org/project/ConvUtils/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/ConvUtils/", "project_urls": { "Download": "UNKNOWN", "Homepage": "http://pypi.python.org/pypi/ConvUtils/" }, "release_url": "https://pypi.org/project/ConvUtils/2.0/", "requires_dist": null, "requires_python": null, "summary": "A library of convenient utility functions and pure Python data structures.", "version": "2.0" }, "last_serial": 784018, "releases": { "1.0": [ { "comment_text": "", "digests": { "md5": "400f943c8ce3fa4ffd9d37c23934d4bd", "sha256": "93b3e187b6acac8497d78d37dd8a849ece1f4ac1ac7b6d6e6426afc28edb7bc1" }, "downloads": -1, "filename": "ConvUtils-1.0.tar.gz", "has_sig": false, "md5_digest": "400f943c8ce3fa4ffd9d37c23934d4bd", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7660, "upload_time": "2011-01-11T04:27:47", "url": "https://files.pythonhosted.org/packages/df/6c/74efa96953b35b7cb9c5a8fb2226b4f954dd8ad84670e4238262a362e063/ConvUtils-1.0.tar.gz" } ], "1.0.1": [ { "comment_text": "", "digests": { "md5": "644576294fdc46147026d9fb0a1e6c27", "sha256": "9b7c139b07894f421a6648fe3e70b0e8a79bd1ba711a69da0ea462debb37bc26" }, "downloads": -1, "filename": "ConvUtils-1.0.1.tar.gz", "has_sig": false, "md5_digest": "644576294fdc46147026d9fb0a1e6c27", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8128, "upload_time": "2011-01-18T17:19:30", "url": "https://files.pythonhosted.org/packages/fd/8e/121fc5d8ec98e6b817d87d62d7453e04ba482b46352ad024aa430d7687b9/ConvUtils-1.0.1.tar.gz" } ], "1.1": [ { "comment_text": "", "digests": { "md5": "c9d240e317b3005b2e06922d32a7779d", "sha256": "27772a948ec74b6a51b24e36a8e4d5df526a13b6a4d2beb1006907b0badf32e9" }, "downloads": -1, "filename": "ConvUtils-1.1.tar.gz", "has_sig": true, "md5_digest": "c9d240e317b3005b2e06922d32a7779d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10157, "upload_time": "2012-03-26T21:04:40", "url": "https://files.pythonhosted.org/packages/a7/3f/801f637de7f0d9d1ea88b375746ef717d23e6877ae73ac99c1fe474112a0/ConvUtils-1.1.tar.gz" }, { "comment_text": "", "digests": { "md5": "edee0f2dd85ed0064b5e03a3eb55781f", "sha256": "3ca179dd6e74fdb3c6142c2ccbefb7a7a4805509b18be4d84c212affd1c0b731" }, "downloads": -1, "filename": "ConvUtils-1.1.zip", "has_sig": true, "md5_digest": "edee0f2dd85ed0064b5e03a3eb55781f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 12709, "upload_time": "2012-03-26T21:04:42", "url": "https://files.pythonhosted.org/packages/c9/e0/55dab7f2b9064e42dff67b2becb4e2bae6961c4142f8a2d24c50fcd0d6cd/ConvUtils-1.1.zip" } ], "2.0": [ { "comment_text": "", "digests": { "md5": "7b7b7e172fe404844d9433d376bd77a1", "sha256": "72071adb777a4a717b82777598112ea1a115fecb1ec8b50b27cc2846a9d478b1" }, "downloads": -1, "filename": "ConvUtils-2.0.tar.gz", "has_sig": true, "md5_digest": "7b7b7e172fe404844d9433d376bd77a1", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 14471, "upload_time": "2013-02-19T22:15:37", "url": "https://files.pythonhosted.org/packages/87/a7/0f33fc6ae2e7f6fce6b11fce805a8de11fbb4d71e42ba0362c59289a488d/ConvUtils-2.0.tar.gz" }, { "comment_text": "", "digests": { "md5": "3c60dcc09360e6973483199722463036", "sha256": "c9b5adb4258b6ffb71040d3d0b9257a1236da44d7b2a401bb78f9cec5385bcdb" }, "downloads": -1, "filename": "ConvUtils-2.0.zip", "has_sig": true, "md5_digest": "3c60dcc09360e6973483199722463036", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 19725, "upload_time": "2013-02-19T22:15:42", "url": "https://files.pythonhosted.org/packages/6e/c1/bf9b6cf6135741383f4cade7acaf2d43a3c7fa9db02067beddfffe585fb2/ConvUtils-2.0.zip" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "7b7b7e172fe404844d9433d376bd77a1", "sha256": "72071adb777a4a717b82777598112ea1a115fecb1ec8b50b27cc2846a9d478b1" }, "downloads": -1, "filename": "ConvUtils-2.0.tar.gz", "has_sig": true, "md5_digest": "7b7b7e172fe404844d9433d376bd77a1", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 14471, "upload_time": "2013-02-19T22:15:37", "url": "https://files.pythonhosted.org/packages/87/a7/0f33fc6ae2e7f6fce6b11fce805a8de11fbb4d71e42ba0362c59289a488d/ConvUtils-2.0.tar.gz" }, { "comment_text": "", "digests": { "md5": "3c60dcc09360e6973483199722463036", "sha256": "c9b5adb4258b6ffb71040d3d0b9257a1236da44d7b2a401bb78f9cec5385bcdb" }, "downloads": -1, "filename": "ConvUtils-2.0.zip", "has_sig": true, "md5_digest": "3c60dcc09360e6973483199722463036", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 19725, "upload_time": "2013-02-19T22:15:42", "url": "https://files.pythonhosted.org/packages/6e/c1/bf9b6cf6135741383f4cade7acaf2d43a3c7fa9db02067beddfffe585fb2/ConvUtils-2.0.zip" } ] }