{"id":15202936,"url":"https://github.com/rezemika/oh_sanitizer","last_synced_at":"2026-02-06T18:32:46.867Z","repository":{"id":57448451,"uuid":"139863797","full_name":"rezemika/oh_sanitizer","owner":"rezemika","description":"A corrector for the 'opening_hours' fields from OpenStreetMap","archived":false,"fork":false,"pushed_at":"2019-01-24T16:09:53.000Z","size":31,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-09-25T04:37:09.228Z","etag":null,"topics":["openstreetmap","openstreetmap-data","python3","sanitization"],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"agpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rezemika.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-07-05T14:50:19.000Z","updated_at":"2024-08-11T01:24:46.000Z","dependencies_parsed_at":"2022-09-18T12:30:48.147Z","dependency_job_id":null,"html_url":"https://github.com/rezemika/oh_sanitizer","commit_stats":null,"previous_names":[],"tags_count":12,"template":false,"template_full_name":null,"purl":"pkg:github/rezemika/oh_sanitizer","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rezemika%2Foh_sanitizer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rezemika%2Foh_sanitizer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rezemika%2Foh_sanitizer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rezemika%2Foh_sanitizer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rezemika","download_url":"https://codeload.github.com/rezemika/oh_sanitizer/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rezemika%2Foh_sanitizer/sbom","scorecard":{"id":773288,"data":{"date":"2025-08-11","repo":{"name":"github.com/rezemika/oh_sanitizer","commit":"e25d8387afc2d13014eda96f15c11bd58bebdc87"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3,"checks":[{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Code-Review","score":0,"reason":"Found 0/25 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENCE:0","Info: FSF or OSI recognized license: GNU Affero General Public License v3.0: LICENCE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'","Warn: branch protection not enabled for branch 'releases'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-23T02:48:43.420Z","repository_id":57448451,"created_at":"2025-08-23T02:48:43.420Z","updated_at":"2025-08-23T02:48:43.420Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29172616,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-06T16:33:35.550Z","status":"ssl_error","status_checked_at":"2026-02-06T16:33:30.716Z","response_time":59,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["openstreetmap","openstreetmap-data","python3","sanitization"],"created_at":"2024-09-28T04:07:22.939Z","updated_at":"2026-02-06T18:32:46.840Z","avatar_url":"https://github.com/rezemika.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"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\u003e\u003e\u003e from oh_sanitizer import sanitize_field\n\u003e\u003e\u003e print(sanitize_field(\"mo-fr 10h - 19h00\"))\n\"Mo-Fr 10:00-19:00\"\n\u003e\u003e\u003e 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","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frezemika%2Foh_sanitizer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frezemika%2Foh_sanitizer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frezemika%2Foh_sanitizer/lists"}