{ "info": { "author": "Mark Ewing", "author_email": "b.mark@ewingsonline.com", "bugtrack_url": null, "classifiers": [ "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python :: 3" ], "description": "# mgsub \n\n***A safe, multiple, simultaneous string substitution function***\n\n## Why do I want this?\nYou have a string you want to make substitutions on. You want to make many different substitutions at the same time \nand you want them done in a safe way. For example, you want to shift each word in \"hey, how are you?\" to the left \nby replacing \"hey\" with \"how\", \"how\" with \"are, etc. This is a lightweight, pure python function with no \ndependencies to avoid package bloat when being used.\n\n## Install it!\n\nYou need to have git installed\n\n1. Clone the repo to your loacl machine. Type this in a command promp/terminal\n\n```sh\ngit clone https://github.com/bmewing/mgsub-python\n```\n\n2. goto repo directory\n\n```sh\ncd mgsub-python\n```\n\n3. install the module\n\n```sh\npython setup.py install\n```\n\n4. You are all done!\n\n## Usage\n\nSimply pass in a vector of strings to be modified, a vector of patterns to match and a vector of replacements. Then watch as they are safely, simultaneously replaced!\n\n```python\nfrom mgsub import mgsub\nmgsub(string, pattern=[], replacement=[], flags=0)\n```\n\nThe pattern to match is supplied first and the replacement vector follows.\n\n```python\nmgsub(\"hey, how are you?\",[\"hey\",\"how\",\"are\",\"you\"],[\"how\",\"are\",\"you\",\"hey\"])\n```\n\nMatches and replacements can still be supplied as regex exressions. Flags from `re` can be set to modify how the regex works.\n\n```python\nimport re\nmgsub(\"Dopazamine is not the same as Dopachloride and is still fake.\", \n [r'[Dd]opa(.*?mine)',\"fake\"], [\"Meta\\\\1\",\"real\"], flags=re.I)\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/bmewing/mgsub-python", "keywords": "string,substitution,regex,regular expression", "license": "", "maintainer": "", "maintainer_email": "", "name": "mgsub", "package_url": "https://pypi.org/project/mgsub/", "platform": "", "project_url": "https://pypi.org/project/mgsub/", "project_urls": { "Homepage": "https://github.com/bmewing/mgsub-python" }, "release_url": "https://pypi.org/project/mgsub/0.1.0/", "requires_dist": null, "requires_python": "", "summary": "A safe, multiple, simultaneous string substitution function", "version": "0.1.0" }, "last_serial": 4396346, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "79e98abf49b3aae5ba6dc2403f8bba3a", "sha256": "3a384cb77315ce01c8b4fa65dc6a4baff86d7b05cac83e8cd65957cf68427f85" }, "downloads": -1, "filename": "mgsub-0.1.0-py3-none-any.whl", "has_sig": false, "md5_digest": "79e98abf49b3aae5ba6dc2403f8bba3a", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 4443, "upload_time": "2018-10-20T02:42:21", "url": "https://files.pythonhosted.org/packages/84/29/45381b4b1e6fa52a129223b31314665ac333413ac3e0104ede11efe69d1b/mgsub-0.1.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "296cb839e84c78d1da20807526f845d4", "sha256": "092fda9c18826df5b3b075a819f0f8debc7c52813150f4fc876ab67a0745d51a" }, "downloads": -1, "filename": "mgsub-0.1.0.tar.gz", "has_sig": false, "md5_digest": "296cb839e84c78d1da20807526f845d4", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3208, "upload_time": "2018-10-20T02:42:22", "url": "https://files.pythonhosted.org/packages/08/b6/790a95405dc13cd53ba86bbb4390a91bbf13566ab7819a691f83c195033f/mgsub-0.1.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "79e98abf49b3aae5ba6dc2403f8bba3a", "sha256": "3a384cb77315ce01c8b4fa65dc6a4baff86d7b05cac83e8cd65957cf68427f85" }, "downloads": -1, "filename": "mgsub-0.1.0-py3-none-any.whl", "has_sig": false, "md5_digest": "79e98abf49b3aae5ba6dc2403f8bba3a", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 4443, "upload_time": "2018-10-20T02:42:21", "url": "https://files.pythonhosted.org/packages/84/29/45381b4b1e6fa52a129223b31314665ac333413ac3e0104ede11efe69d1b/mgsub-0.1.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "296cb839e84c78d1da20807526f845d4", "sha256": "092fda9c18826df5b3b075a819f0f8debc7c52813150f4fc876ab67a0745d51a" }, "downloads": -1, "filename": "mgsub-0.1.0.tar.gz", "has_sig": false, "md5_digest": "296cb839e84c78d1da20807526f845d4", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3208, "upload_time": "2018-10-20T02:42:22", "url": "https://files.pythonhosted.org/packages/08/b6/790a95405dc13cd53ba86bbb4390a91bbf13566ab7819a691f83c195033f/mgsub-0.1.0.tar.gz" } ] }