{ "info": { "author": "Hernan Grecco", "author_email": "hernan.grecco@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3.2", "Programming Language :: Python :: 3.3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Topic :: Text Processing" ], "description": "Motivation\n----------\n\nThe ``stringparser`` module provides a simple way to match patterns and extract\ninformation within strings. As patterns are given using the familiar format\nstring specification :pep:`3101`, writing them is much easier than writing\nregular expressions (albeit less powerful).\n\n\nExamples\n--------\n\nYou can build a reusable parser object::\n\n >>> parser = Parser('The answer is {:d}')\n >>> parser('The answer is 42')\n 42\n >>> parser('The answer is 54')\n 54\n\nOr directly::\n\n >>> Parser('The answer is {:d}')('The answer is 42')\n 42\n\nYou can retrieve many fields::\n\n >>> Parser('The {:s} is {:d}')('The answer is 42')\n ('answer', 42)\n\nAnd you can use numbered fields to order the returned tuple::\n\n >>> Parser('The {1:s} is {0:d}')('The answer is 42')\n (42, 'answer')\n\nOr named fields to return an OrderedDict::\n\n >>> Parser('The {a:s} is {b:d}')('The answer is 42')\n OrderedDict([('a', 'answer'), ('b', 42)])\n\nYou can ignore some fields using _ as a name::\n\n >>> Parser('The {_:s} is {:d}')('The answer is 42')\n 42\n\n\nLimitations\n-----------\n\n- From the format string:\n `[[fill]align][sign][#][0][minimumwidth][.precision][type]`\n only `type`, `sign` and `#` are currently implemented.\n This might cause trouble to match certain notation like:\n\n - decimal: '-4' written as '- 4'\n - etc\n\n- Lines are matched from beginning to end. {:d} will NOT return all\n the numbers in the string. Use regex for that.", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "http://github.com/hgrecco/stringparser", "keywords": "", "license": "BSD", "maintainer": "", "maintainer_email": "", "name": "stringparser", "package_url": "https://pypi.org/project/stringparser/", "platform": "", "project_url": "https://pypi.org/project/stringparser/", "project_urls": { "Homepage": "http://github.com/hgrecco/stringparser" }, "release_url": "https://pypi.org/project/stringparser/0.5/", "requires_dist": null, "requires_python": "", "summary": "Easy to use pattern matching and information extraction", "version": "0.5" }, "last_serial": 5503678, "releases": { "0.1": [ { "comment_text": "", "digests": { "md5": "8dcf8b0321df4baf27fcda4b08b3439e", "sha256": "cc5b38e2a09a252bdf2c0ef9086011f2317454d05ba16c04bda35b41bde2d577" }, "downloads": -1, "filename": "stringparser-0.1.tar.gz", "has_sig": false, "md5_digest": "8dcf8b0321df4baf27fcda4b08b3439e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 1931, "upload_time": "2011-10-10T16:25:45", "url": "https://files.pythonhosted.org/packages/f6/2b/e97d78b1e81e0313525d3664f709f5d595af7413fe9a3f5f8d5f59d791e8/stringparser-0.1.tar.gz" } ], "0.2": [ { "comment_text": "", "digests": { "md5": "ca84474fee6d742861b126f9f586123e", "sha256": "74a157a38d58f018eadfd4857c49d3edf96113d30350d9ee22d63db12c9236b5" }, "downloads": -1, "filename": "stringparser-0.2.tar.gz", "has_sig": false, "md5_digest": "ca84474fee6d742861b126f9f586123e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 1918, "upload_time": "2011-10-16T02:26:00", "url": "https://files.pythonhosted.org/packages/83/45/618e957e59137965fcb04f5dcde799f50c3410fd9780647cfcfa0c83a48c/stringparser-0.2.tar.gz" } ], "0.3": [ { "comment_text": "", "digests": { "md5": "723425f91e1de115e3dd4e44140ef474", "sha256": "ab26a89dd351cccaf4335e58419eea0f913ba5db93b670101eb216a79f37dd6a" }, "downloads": -1, "filename": "stringparser-0.3.tar.gz", "has_sig": false, "md5_digest": "723425f91e1de115e3dd4e44140ef474", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 1848, "upload_time": "2011-10-30T20:27:11", "url": "https://files.pythonhosted.org/packages/12/db/4e6d929cbe228b15b529431e1d005305bd5b7244702c3d9983cc2b9ba314/stringparser-0.3.tar.gz" } ], "0.4": [ { "comment_text": "", "digests": { "md5": "62f1e00dcf13b98e2b61713801447a55", "sha256": "4dde57e4cbcdfccb0bc97f132f35211bab3593566b8864a6c8698c73f39bd99e" }, "downloads": -1, "filename": "stringparser-0.4.tar.gz", "has_sig": false, "md5_digest": "62f1e00dcf13b98e2b61713801447a55", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 1861, "upload_time": "2012-12-31T17:21:55", "url": "https://files.pythonhosted.org/packages/28/b0/9df16a6ac86e542c45fa14cd482300986d365b60e55354b9f31d3f8c873b/stringparser-0.4.tar.gz" } ], "0.4.1": [ { "comment_text": "", "digests": { "md5": "f3e28b05cd9eebec00d811e37b906b8e", "sha256": "7d133677ccda99fda200e31662cc5585b6db32b80c5ba75b00748e3f0444b8e8" }, "downloads": -1, "filename": "stringparser-0.4.1.tar.gz", "has_sig": false, "md5_digest": "f3e28b05cd9eebec00d811e37b906b8e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5126, "upload_time": "2013-01-01T02:10:50", "url": "https://files.pythonhosted.org/packages/08/66/ba7735d603984d0edae98b606ae5219cd319fa2736ed31dc60ee1d39f603/stringparser-0.4.1.tar.gz" } ], "0.5": [ { "comment_text": "", "digests": { "md5": "0cc619b0b51246658aa21f3509872d7d", "sha256": "fe651a623361a3555a5ed29704a4c3b990ce0b7071038ecff25087a87b0d9880" }, "downloads": -1, "filename": "stringparser-0.5.tar.gz", "has_sig": false, "md5_digest": "0cc619b0b51246658aa21f3509872d7d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6383, "upload_time": "2019-07-08T23:50:09", "url": "https://files.pythonhosted.org/packages/d2/2f/3046f6cbeb783163cf2962d98b7c2f44b4856c7a500f2f5bdafaffcf56e7/stringparser-0.5.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "0cc619b0b51246658aa21f3509872d7d", "sha256": "fe651a623361a3555a5ed29704a4c3b990ce0b7071038ecff25087a87b0d9880" }, "downloads": -1, "filename": "stringparser-0.5.tar.gz", "has_sig": false, "md5_digest": "0cc619b0b51246658aa21f3509872d7d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6383, "upload_time": "2019-07-08T23:50:09", "url": "https://files.pythonhosted.org/packages/d2/2f/3046f6cbeb783163cf2962d98b7c2f44b4856c7a500f2f5bdafaffcf56e7/stringparser-0.5.tar.gz" } ] }