{ "info": { "author": "rezemika", "author_email": "reze.mika@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "Intended Audience :: Developers", "License :: OSI Approved :: GNU Affero General Public License v3", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 2", "Programming Language :: Python :: 3", "Topic :: Other/Nonlisted Topic", "Topic :: Utilities" ], "description": "Opening hours sanitizer - A corrector for the 'opening_hours' fields\n=========================================================================\n\nIf you work with the `opening_hours` fields in OpenStreetMap, you probably need to check somewhere if a field is valid before to parse it, or to do anything with it.\n\nOf course, for simple formats, can do this with regexes, but [specifications](https://wiki.openstreetmap.org/wiki/Key:opening_hours/specification) are so rich that a full regex to handle them is quite impossible.\nThis is the goal of this tiny module: check if an `opening_hours` field is valid, and try to correct it if it isn't.\n\nIn addition to the simple formats, like `Mo-Fr 10:00-20:00`, it can parse and fix almost all shapes of opening hours.\nHere is what it can do.\n\n```python\n>>> from oh_sanitizer import sanitize_field\n>>> print(sanitize_field(\"mo-fr 10h - 19h00\"))\n\"Mo-Fr 10:00-19:00\"\n>>> print(sanitize_field(\"2010 - 2020/2 dec-feb 10:00 am - 12:00 am/1:00 pm-7:00pm\"))\n\"2010-2020/2 Dec-Feb 10:00-12:00,13:00-19:00\"\n```\n\n**It works both with Python 2 and 3.**\n\nIt is so small that you can include it directly into your projet.\nYou can also install it with PyPi:\n\n $ pip install oh-sanitizer\n\nThe `sanitize_field()` function can raise the following exceptions:\n- `TypeError` : If the given field is not a string.\n- `SanitizeError` : The generic exception of `oh_sanitizer`,\n raised when the field can't be parsed (if it is too complex,\n or \"too much invalid\").\n- `InconsistentField` : Inheriting from `SanitizeError`,\n raised when the field contains an invalid pattern which can't\n be corrected automatically.\n\nSo, you can simple do this.\n\n```python\nfrom oh_sanitizer import sanitize_field, SanitizeError\nfield = \"mo-fr 10h - 19h00\"\ntry:\n sanitized_field = sanitize_field(field)\n print(\"Here is the sanitized field:\", sanitized_field)\nexcept SanitizeError:\n print(\"So bad, the field could not be sanitized.\")\n```\n\nIf you want to parse `opening_hours` fields to know, for example, whether a facility is open, OH Sanitizer is NOT what you need.\nSee the [Humanized Opening Hours](https://github.com/rezemika/humanized_opening_hours) module or its [alternatives](https://github.com/rezemika/humanized_opening_hours#alternatives).\n\n\n", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "http://github.com/rezemika/oh_sanitizer", "keywords": "openstreetmap opening_hours", "license": "", "maintainer": "", "maintainer_email": "", "name": "oh-sanitizer", "package_url": "https://pypi.org/project/oh-sanitizer/", "platform": "", "project_url": "https://pypi.org/project/oh-sanitizer/", "project_urls": { "Homepage": "http://github.com/rezemika/oh_sanitizer" }, "release_url": "https://pypi.org/project/oh-sanitizer/0.1.10/", "requires_dist": [ "lark-parser" ], "requires_python": "", "summary": "A corrector for the 'opening_hours' fields from OpenStreetMap.", "version": "0.1.10" }, "last_serial": 4736387, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "d168f902b0bb3c64ed7eb4ee5cb45edf", "sha256": "f7125d05e0fd8d8aea6dcc095f9861bfa84ad39ca01ed3bc282a49d9573ad5c2" }, "downloads": -1, "filename": "oh_sanitizer-0.1.0-py3-none-any.whl", "has_sig": false, "md5_digest": "d168f902b0bb3c64ed7eb4ee5cb45edf", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 2132, "upload_time": "2018-07-05T15:19:59", "url": "https://files.pythonhosted.org/packages/78/e8/0fbd2351f2fbdb5d336087ae4306cacb483b4ebab4fa16d2e4b76438e183/oh_sanitizer-0.1.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "ff6a0eb5e95b9c4d786d9bf41a12898a", "sha256": "5ed2578df31582bd87ac75e484ace5e015f80eb8d4d3004405802cddb848df2c" }, "downloads": -1, "filename": "oh_sanitizer-0.1.0.tar.gz", "has_sig": false, "md5_digest": "ff6a0eb5e95b9c4d786d9bf41a12898a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3518, "upload_time": "2018-07-05T15:20:00", "url": "https://files.pythonhosted.org/packages/6d/0a/72c39cd2d31ac8e691d8c4d16b6dd4e4a135a7aa8cdd5799a66bd90536e9/oh_sanitizer-0.1.0.tar.gz" } ], "0.1.1": [ { "comment_text": "", "digests": { "md5": "27015724a58ca65a46b7bbe6d46425f0", "sha256": "e102c6a51989a3362bc975492898c0962cadeedd3dfe7efa41246ade5d55db2e" }, "downloads": -1, "filename": "oh_sanitizer-0.1.1-py3.5.egg", "has_sig": false, "md5_digest": "27015724a58ca65a46b7bbe6d46425f0", "packagetype": "bdist_egg", "python_version": "3.5", "requires_python": null, "size": 58085, "upload_time": "2018-07-14T13:07:40", "url": "https://files.pythonhosted.org/packages/4b/4b/29139918c282428fd3262226d56a031b4570734bb8e53d626a091f4678e8/oh_sanitizer-0.1.1-py3.5.egg" }, { "comment_text": "", "digests": { "md5": "b01e8d305aaed751e32f427e4ced337a", "sha256": "487b452c0c6c1ad137087b2dfe6ca1f4110e8d42b50bb66ae747f9d6a1c05415" }, "downloads": -1, "filename": "oh_sanitizer-0.1.1-py3-none-any.whl", "has_sig": false, "md5_digest": "b01e8d305aaed751e32f427e4ced337a", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 28421, "upload_time": "2018-07-14T13:07:37", "url": "https://files.pythonhosted.org/packages/66/d4/0fdada265de9e6427395e75dc129481efb6fb12fd045534d1ed7003f9b61/oh_sanitizer-0.1.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "14f24106ade0c2fa8e6d246d0684dfdc", "sha256": "edce79b9d495b27b3e078043a8ca04996ac52da162e572c94f890f65ee1cd503" }, "downloads": -1, "filename": "oh_sanitizer-0.1.1.tar.gz", "has_sig": false, "md5_digest": "14f24106ade0c2fa8e6d246d0684dfdc", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 19158, "upload_time": "2018-07-14T13:07:41", "url": "https://files.pythonhosted.org/packages/0c/ea/6009c30127d028cf58654a189265f872b86c9c7a69faaf1e61941bb54094/oh_sanitizer-0.1.1.tar.gz" } ], "0.1.10": [ { "comment_text": "", "digests": { "md5": "abe304698fc27c33c39f07bb9bb82e5b", "sha256": "3ebfe81ccb53e8111d55790b3e984608ff53f770b6cb5caab4441c4eef167bd2" }, "downloads": -1, "filename": "oh_sanitizer-0.1.10-py3-none-any.whl", "has_sig": false, "md5_digest": "abe304698fc27c33c39f07bb9bb82e5b", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 20691, "upload_time": "2019-01-24T16:13:02", "url": "https://files.pythonhosted.org/packages/21/94/c67647f8dda4ff62a4b4826ed3db858121ad6408d46f81bddeb867e85de7/oh_sanitizer-0.1.10-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "321caaf371c0598817d2eb152f45cbc5", "sha256": "42cb52e2f48f83ab7bd1735dd5cdc0baa99bb636ed7b063231399e1d9444db88" }, "downloads": -1, "filename": "oh_sanitizer-0.1.10.tar.gz", "has_sig": false, "md5_digest": "321caaf371c0598817d2eb152f45cbc5", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8075, "upload_time": "2019-01-24T16:13:04", "url": "https://files.pythonhosted.org/packages/a5/2e/58c60d34a7e9f686391c9732e93260e87f5b30f94569ea69a14eeadfaf59/oh_sanitizer-0.1.10.tar.gz" } ], "0.1.2": [ { "comment_text": "", "digests": { "md5": "8a303faebbce8bf37aa339079d289ca9", "sha256": "3c08963f2be14dbebea60c4261645bb86497cb13fefb9d949abd659118dd129b" }, "downloads": -1, "filename": "oh_sanitizer-0.1.2-py3-none-any.whl", "has_sig": false, "md5_digest": "8a303faebbce8bf37aa339079d289ca9", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 28466, "upload_time": "2018-07-14T14:40:16", "url": "https://files.pythonhosted.org/packages/89/32/cb99528b3e5bc36a8cfafc180678d2121285b73273e18c1886a7ca2876a6/oh_sanitizer-0.1.2-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "e38e4e98a88bd0413d16c90393c2771d", "sha256": "9c5fa7b826f38f2129d79a783722759a2ad8cb930148a5ab1412d28e01ab764c" }, "downloads": -1, "filename": "oh_sanitizer-0.1.2.tar.gz", "has_sig": false, "md5_digest": "e38e4e98a88bd0413d16c90393c2771d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 19215, "upload_time": "2018-07-14T14:40:17", "url": "https://files.pythonhosted.org/packages/ea/2c/95f73cb4190112423976a3af2786a45934a669b9df5bb780c5cbf88266aa/oh_sanitizer-0.1.2.tar.gz" } ], "0.1.3": [ { "comment_text": "", "digests": { "md5": "a3e4892ed8a783b38dd522f519dffb4a", "sha256": "abaeb409a35b927bc22b8348629edfcf48f7b0eaa556d363e77676db16613305" }, "downloads": -1, "filename": "oh_sanitizer-0.1.3-py3-none-any.whl", "has_sig": false, "md5_digest": "a3e4892ed8a783b38dd522f519dffb4a", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 28515, "upload_time": "2018-07-14T18:45:52", "url": "https://files.pythonhosted.org/packages/01/9d/88a3ae42b6d02edd9779ec343e07b3a07a9cd593ae977656ccaea93951dd/oh_sanitizer-0.1.3-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "f001d2bd4c5b9988486236230be41730", "sha256": "acf2880a87d4757f7a1eebde616490950fd11266ce8725719f6929414910be59" }, "downloads": -1, "filename": "oh_sanitizer-0.1.3.tar.gz", "has_sig": false, "md5_digest": "f001d2bd4c5b9988486236230be41730", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 19270, "upload_time": "2018-07-14T18:45:54", "url": "https://files.pythonhosted.org/packages/55/45/e18866145e63d71b0f1257059d589399b6efa0c19904c356e7692e991e71/oh_sanitizer-0.1.3.tar.gz" } ], "0.1.4": [ { "comment_text": "", "digests": { "md5": "80ca75010ab093d49348b7fc9d59f00c", "sha256": "4ac8e05a5a9b9ab9218e9c7ffc11bce1e82a95750c1e074a22c2006f38da351b" }, "downloads": -1, "filename": "oh_sanitizer-0.1.4-py3-none-any.whl", "has_sig": false, "md5_digest": "80ca75010ab093d49348b7fc9d59f00c", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 28507, "upload_time": "2018-07-24T20:06:30", "url": "https://files.pythonhosted.org/packages/95/b8/34155ad0b7330239d8613b31923b44933567d0497ec5b917ddb39f1dfc97/oh_sanitizer-0.1.4-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "4a879337e859871f642add16c8668399", "sha256": "35202b2bb67848599a9b9e61bac01d2622b51c78f7a5662cda2cacd67aa89930" }, "downloads": -1, "filename": "oh_sanitizer-0.1.4.tar.gz", "has_sig": false, "md5_digest": "4a879337e859871f642add16c8668399", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 19267, "upload_time": "2018-07-24T20:06:31", "url": "https://files.pythonhosted.org/packages/8d/82/81fbdfa2a9210e35165d8c9949fd77034067de3dccf4adb20fc7926883e4/oh_sanitizer-0.1.4.tar.gz" } ], "0.1.5": [ { "comment_text": "", "digests": { "md5": "33a91f8b8d046b8b2115ade189f055f7", "sha256": "b27c4980368da44a1d124863b52999a7df01ebd573452b0addbeac5e26b54c3b" }, "downloads": -1, "filename": "oh_sanitizer-0.1.5-py3-none-any.whl", "has_sig": false, "md5_digest": "33a91f8b8d046b8b2115ade189f055f7", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 28586, "upload_time": "2018-07-27T18:35:54", "url": "https://files.pythonhosted.org/packages/41/36/a1349381bbfbdd490f28de1570d969f0f60e31fa30f3ae54ee5f404c18ac/oh_sanitizer-0.1.5-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "03b5bc240f2fbeeb17e454571d6ae281", "sha256": "cc314c244af4ba2895b93a0e4c91555b1c7cbdf16e55645233b6b565deb91a18" }, "downloads": -1, "filename": "oh_sanitizer-0.1.5.tar.gz", "has_sig": false, "md5_digest": "03b5bc240f2fbeeb17e454571d6ae281", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 19326, "upload_time": "2018-07-27T18:35:55", "url": "https://files.pythonhosted.org/packages/d9/2c/01fc4bbaa733ced0022d555d7b54baab86ef27b78f81378deace44bcc4a3/oh_sanitizer-0.1.5.tar.gz" } ], "0.1.6": [ { "comment_text": "", "digests": { "md5": "551457d531d917531f33ca1ab5114785", "sha256": "d937c254453c33c56d0c890cc47d018c7635fc7f7820ed1010a06739ccb17cbc" }, "downloads": -1, "filename": "oh_sanitizer-0.1.6-py3-none-any.whl", "has_sig": false, "md5_digest": "551457d531d917531f33ca1ab5114785", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 28596, "upload_time": "2018-07-28T09:55:43", "url": "https://files.pythonhosted.org/packages/96/6c/a69b744b0bc30542787d4da2d6fc8b4e1d433ad1a47341a17143ded37530/oh_sanitizer-0.1.6-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "5864b35873eabbdddd118ba60724878b", "sha256": "4cb59291760d688c5480ece1b0eaf9ddeeb33288ebe4b8aa8f336b20413362b1" }, "downloads": -1, "filename": "oh_sanitizer-0.1.6.tar.gz", "has_sig": false, "md5_digest": "5864b35873eabbdddd118ba60724878b", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 19347, "upload_time": "2018-07-28T09:55:44", "url": "https://files.pythonhosted.org/packages/7f/62/2d38031b988187a5a8f21af2e4c792ba2b80c76894b1a4d85a1e38b9302d/oh_sanitizer-0.1.6.tar.gz" } ], "0.1.7": [ { "comment_text": "", "digests": { "md5": "f5228f8347d8d2c35cd40be7e243012d", "sha256": "97a8b7816cb65ca972275bb44bec9750f264116a167994846619658ea145c161" }, "downloads": -1, "filename": "oh_sanitizer-0.1.7-py3-none-any.whl", "has_sig": false, "md5_digest": "f5228f8347d8d2c35cd40be7e243012d", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 28580, "upload_time": "2018-07-28T20:56:02", "url": "https://files.pythonhosted.org/packages/15/6c/22fcac8e6b06f722e0729b42dc1f9bf57ad5a72c618884225c4a0d0f0fc3/oh_sanitizer-0.1.7-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "dffbabc9d70c0673365ed1b8fcc86b9f", "sha256": "912b8d22e0467098afa117c7e4454c41d6f9d7fea2c225c6cca045f3041e121e" }, "downloads": -1, "filename": "oh_sanitizer-0.1.7.tar.gz", "has_sig": false, "md5_digest": "dffbabc9d70c0673365ed1b8fcc86b9f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 19319, "upload_time": "2018-07-28T20:56:04", "url": "https://files.pythonhosted.org/packages/c1/6d/dc12ae80cca5d9c43ae7d6afac0fdfb41ba3d8de8396a553aac100aeb85d/oh_sanitizer-0.1.7.tar.gz" } ], "0.1.8": [ { "comment_text": "", "digests": { "md5": "4fccc999a769abeeeae0ff5a6ef0b7c6", "sha256": "77cdb85bfa5527a800f301256a88ca1d0164de21406dd9c5f09383c38d029238" }, "downloads": -1, "filename": "oh_sanitizer-0.1.8-py3-none-any.whl", "has_sig": false, "md5_digest": "4fccc999a769abeeeae0ff5a6ef0b7c6", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 28620, "upload_time": "2019-01-10T19:48:53", "url": "https://files.pythonhosted.org/packages/83/de/529b98cc1c31eb5d373e0797b6f0123fd02b09bd8f1a1bbdfa4f42631117/oh_sanitizer-0.1.8-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "1b3175c151046a952f924bdcfebf7a2d", "sha256": "12b529c3e099cf5b8635837d556186db408d8ea966c9bed992cde0f73e1742d0" }, "downloads": -1, "filename": "oh_sanitizer-0.1.8.tar.gz", "has_sig": false, "md5_digest": "1b3175c151046a952f924bdcfebf7a2d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 19382, "upload_time": "2019-01-10T19:48:55", "url": "https://files.pythonhosted.org/packages/68/fb/75560fd30a33720a632f19a91fb39e2ed4a39ebf612b7ec41fe96f6653f7/oh_sanitizer-0.1.8.tar.gz" } ], "0.1.9": [ { "comment_text": "", "digests": { "md5": "b0926cbacf0e0044d84aedfe28cf1d5d", "sha256": "f3cd15129b323bda7e1569e6f8a002390d8112d8137799fedf4321eb428ca086" }, "downloads": -1, "filename": "oh_sanitizer-0.1.9-py3-none-any.whl", "has_sig": false, "md5_digest": "b0926cbacf0e0044d84aedfe28cf1d5d", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 28856, "upload_time": "2019-01-13T11:18:28", "url": "https://files.pythonhosted.org/packages/ce/b9/f741556fcfb1219d2d3755e6fe4b15edc2e94bd4c35b93cb02f64147ef76/oh_sanitizer-0.1.9-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "db6eb139694948f4aedf8fe09796b2c9", "sha256": "87675b3031c2ba9e21f37494b818cd88257102b6e2a58048b5de8b4e20da1754" }, "downloads": -1, "filename": "oh_sanitizer-0.1.9.tar.gz", "has_sig": false, "md5_digest": "db6eb139694948f4aedf8fe09796b2c9", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 19724, "upload_time": "2019-01-13T11:18:30", "url": "https://files.pythonhosted.org/packages/6f/ed/72bc54db52c35b0a878b28e10f784457a6322a4cebe428fc7e66e333b80c/oh_sanitizer-0.1.9.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "abe304698fc27c33c39f07bb9bb82e5b", "sha256": "3ebfe81ccb53e8111d55790b3e984608ff53f770b6cb5caab4441c4eef167bd2" }, "downloads": -1, "filename": "oh_sanitizer-0.1.10-py3-none-any.whl", "has_sig": false, "md5_digest": "abe304698fc27c33c39f07bb9bb82e5b", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 20691, "upload_time": "2019-01-24T16:13:02", "url": "https://files.pythonhosted.org/packages/21/94/c67647f8dda4ff62a4b4826ed3db858121ad6408d46f81bddeb867e85de7/oh_sanitizer-0.1.10-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "321caaf371c0598817d2eb152f45cbc5", "sha256": "42cb52e2f48f83ab7bd1735dd5cdc0baa99bb636ed7b063231399e1d9444db88" }, "downloads": -1, "filename": "oh_sanitizer-0.1.10.tar.gz", "has_sig": false, "md5_digest": "321caaf371c0598817d2eb152f45cbc5", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8075, "upload_time": "2019-01-24T16:13:04", "url": "https://files.pythonhosted.org/packages/a5/2e/58c60d34a7e9f686391c9732e93260e87f5b30f94569ea69a14eeadfaf59/oh_sanitizer-0.1.10.tar.gz" } ] }