{ "info": { "author": "David A Krauth", "author_email": "dakrauth@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "License :: OSI Approved :: MIT License", "Programming Language :: Python", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Topic :: Software Development :: Libraries :: Python Modules", "Topic :: Text Processing" ], "description": ".. image:: https://travis-ci.org/dakrauth/strutil.svg?branch=master\n :target: https://travis-ci.org/dakrauth/strutil\n\n\nStrutil\n=======\n\nSimple helper functions for using strings and regular expressions (mostly) interchangeably.\n\n\nRequirements\n------------\n\n* Python 3.4+\n\nModule Contents\n---------------\n\n``strutil.is_string(obj)``\n\n Check if ``obj`` is a string\n\n``strutil.is_regex(obj)``\n\n Check if ``obj`` is a regular expression\n\n``strutil.replace(text, old, new, count=None, strip=False)``\n Replace an ``old`` subset of ``text`` with ``new``.\n\n ``old`` type may be either a string or regular expression.\n\n If ``strip``, remove all leading/trailing whitespace.\n\n If ``count``, replace the specified number of occurence, otherwise replace all.\n\n``strutil.remove(text, what, count=None, strip=False)``\n\n Like ``replace``, where ``new`` replacement is an empty string.\n\n``strutil.replace_each(text, items, count=None, strip=False)``\n\n Like ``replace``, where each occurrence in ``items`` is a 2-tuple of \n ``(old, new)`` pair.\n\n``strutil.remove_each(text, items, count=None, strip=False)``\n\n Like ``remove``, where each occurrence in ``items`` is ``what`` to remove.\n\n``strutil.contains(text, what)``\n\n Check if ``what`` occurs in ``text``\n\n``strutil.find_first(data, what)``\n\n Search for ``what`` in the iterable ``data`` and return the index of the \n first match. Return ``None`` if no match found.\n\n``strutil.splitter(text, token=None, expected=2, default='', strip=False)``\n\n Split ``text`` by ``token`` into at least ``expected`` number of results.\n\n When ``token`` is ``None``, the default for Python ``str.split`` is used, \n which will split on all whitespace.\n\n ``token`` may also be a regex.\n\n If actual number of results is less than ``expected``, pad with ``default``.\n\n If ``strip``, than do just that to each result.\n\n\n\n", "description_content_type": null, "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/dakrauth/strutil", "keywords": "", "license": "MIT License", "maintainer": "", "maintainer_email": "", "name": "strutil", "package_url": "https://pypi.org/project/strutil/", "platform": "any", "project_url": "https://pypi.org/project/strutil/", "project_urls": { "Homepage": "https://github.com/dakrauth/strutil" }, "release_url": "https://pypi.org/project/strutil/0.2.1/", "requires_dist": null, "requires_python": "", "summary": "Simple tools for downloading, cleaning, extracting and parsing content", "version": "0.2.1" }, "last_serial": 3639102, "releases": { "0.1.1": [ { "comment_text": "", "digests": { "md5": "d164307ae38fa9a6eef52b7284569e71", "sha256": "bc45b7717591b8c5ffa4fe78eb604098382b903b397605cab09fb6139fcea481" }, "downloads": -1, "filename": "strutil-0.1.1.tar.gz", "has_sig": false, "md5_digest": "d164307ae38fa9a6eef52b7284569e71", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2933, "upload_time": "2015-05-29T15:36:38", "url": "https://files.pythonhosted.org/packages/91/28/8f2354115959021d3789dacc7adce316298e33b2a6bc6ae096721e7c0806/strutil-0.1.1.tar.gz" } ], "0.1.3": [ { "comment_text": "", "digests": { "md5": "d63ac220cd16b168f8337a1efc64e70e", "sha256": "39066dc52f042af3d5423dbc13566400881656fecd649b317f1d5d6bbe03dad1" }, "downloads": -1, "filename": "strutil-0.1.3.tar.gz", "has_sig": false, "md5_digest": "d63ac220cd16b168f8337a1efc64e70e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3435, "upload_time": "2015-07-23T10:53:05", "url": "https://files.pythonhosted.org/packages/f3/b2/8a1987c5afa98ae21353dea7e735fd5c8502458cb80acdb6c9b0ebf2f016/strutil-0.1.3.tar.gz" } ], "0.2.1": [ { "comment_text": "", "digests": { "md5": "216501f3a3a01fb31692f992f7c95fdf", "sha256": "c73102a4bd745c736068a88858e017d70c1598de5facd3963337566285b1756f" }, "downloads": -1, "filename": "strutil-0.2.1-py3-none-any.whl", "has_sig": false, "md5_digest": "216501f3a3a01fb31692f992f7c95fdf", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 4808, "upload_time": "2018-03-05T00:22:58", "url": "https://files.pythonhosted.org/packages/33/66/3e4b51c7a123809ac4fcd2afb677b19e5798502b6a85c36383d6454223a6/strutil-0.2.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "bb01abbb00b7119d266efdefe110e9ee", "sha256": "60c162169bf6d5eba97ceea2a08442659ce9e9795129f136afd704e96e063bb0" }, "downloads": -1, "filename": "strutil-0.2.1.tar.gz", "has_sig": false, "md5_digest": "bb01abbb00b7119d266efdefe110e9ee", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3444, "upload_time": "2018-03-05T00:23:00", "url": "https://files.pythonhosted.org/packages/37/98/b3d93ac2352be16e61cf9ee00961f41cef3bfd5194e7c591be8414f3826a/strutil-0.2.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "216501f3a3a01fb31692f992f7c95fdf", "sha256": "c73102a4bd745c736068a88858e017d70c1598de5facd3963337566285b1756f" }, "downloads": -1, "filename": "strutil-0.2.1-py3-none-any.whl", "has_sig": false, "md5_digest": "216501f3a3a01fb31692f992f7c95fdf", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 4808, "upload_time": "2018-03-05T00:22:58", "url": "https://files.pythonhosted.org/packages/33/66/3e4b51c7a123809ac4fcd2afb677b19e5798502b6a85c36383d6454223a6/strutil-0.2.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "bb01abbb00b7119d266efdefe110e9ee", "sha256": "60c162169bf6d5eba97ceea2a08442659ce9e9795129f136afd704e96e063bb0" }, "downloads": -1, "filename": "strutil-0.2.1.tar.gz", "has_sig": false, "md5_digest": "bb01abbb00b7119d266efdefe110e9ee", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3444, "upload_time": "2018-03-05T00:23:00", "url": "https://files.pythonhosted.org/packages/37/98/b3d93ac2352be16e61cf9ee00961f41cef3bfd5194e7c591be8414f3826a/strutil-0.2.1.tar.gz" } ] }