{"id":15009851,"url":"https://github.com/moralcode/parse-opening-hours","last_synced_at":"2025-10-10T04:32:45.934Z","repository":{"id":57450856,"uuid":"361848086","full_name":"MoralCode/parse-opening-hours","owner":"MoralCode","description":"a python library to convert arbitrary strings representing business opening hours into a JSON format that's easier to use in code","archived":false,"fork":false,"pushed_at":"2022-05-29T01:40:56.000Z","size":313,"stargazers_count":8,"open_issues_count":12,"forks_count":5,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-10T04:31:56.160Z","etag":null,"topics":["business-hours","datetime","json","library","opening-hours","package","parsing-library","pyparsing","python","python3","string-parser"],"latest_commit_sha":null,"homepage":"https://moralcode.github.io/parse-opening-hours/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/MoralCode.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-04-26T18:07:46.000Z","updated_at":"2023-01-31T18:52:05.000Z","dependencies_parsed_at":"2022-09-26T17:31:37.472Z","dependency_job_id":null,"html_url":"https://github.com/MoralCode/parse-opening-hours","commit_stats":null,"previous_names":["moralcode/jsonify-opening-hours"],"tags_count":7,"template":false,"template_full_name":null,"purl":"pkg:github/MoralCode/parse-opening-hours","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MoralCode%2Fparse-opening-hours","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MoralCode%2Fparse-opening-hours/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MoralCode%2Fparse-opening-hours/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MoralCode%2Fparse-opening-hours/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MoralCode","download_url":"https://codeload.github.com/MoralCode/parse-opening-hours/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MoralCode%2Fparse-opening-hours/sbom","scorecard":{"id":96031,"data":{"date":"2025-08-11","repo":{"name":"github.com/MoralCode/parse-opening-hours","commit":"a683395b58c8eb2942fdaa39f3957b1551328a35"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.2,"checks":[{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","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":"Code-Review","score":0,"reason":"Found 0/30 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":"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":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/docs.yml:1","Info: no jobLevel write permissions found"],"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":"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":"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":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/docs.yml:25: update your workflow using https://app.stepsecurity.io/secureworkflow/MoralCode/parse-opening-hours/docs.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/docs.yml:29: update your workflow using https://app.stepsecurity.io/secureworkflow/MoralCode/parse-opening-hours/docs.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/docs.yml:35: update your workflow using https://app.stepsecurity.io/secureworkflow/MoralCode/parse-opening-hours/docs.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/docs.yml:46: update your workflow using https://app.stepsecurity.io/secureworkflow/MoralCode/parse-opening-hours/docs.yml/main?enable=pin","Warn: pipCommand not pinned by hash: .github/workflows/docs.yml:39","Info:   0 out of   3 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of   1 third-party GitHubAction dependencies pinned","Info:   0 out of   1 pipCommand dependencies pinned"],"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":"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: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE: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 'main'"],"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":8,"reason":"2 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: PYSEC-2022-260 / GHSA-v973-fxgf-6xhp","Warn: Project is vulnerable to: PYSEC-2022-42969"],"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-15T09:04:26.728Z","repository_id":57450856,"created_at":"2025-08-15T09:04:26.728Z","updated_at":"2025-08-15T09:04:26.728Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279002675,"owners_count":26083442,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-10T02:00:06.843Z","response_time":62,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["business-hours","datetime","json","library","opening-hours","package","parsing-library","pyparsing","python","python3","string-parser"],"created_at":"2024-09-24T19:28:52.547Z","updated_at":"2025-10-10T04:32:45.918Z","avatar_url":"https://github.com/MoralCode.png","language":"Python","readme":"# Python Opening Hours parser\n\n[![CircleCI](https://circleci.com/gh/MoralCode/parse-opening-hours.svg?style=shield)](https://circleci.com/gh/MoralCode/parse-opening-hours)\n[![codecov](https://codecov.io/gh/MoralCode/parse-opening-hours/branch/main/graph/badge.svg?token=7JUFXSX43N)](https://codecov.io/gh/MoralCode/parse-opening-hours)\n[![Downloads](https://pepy.tech/badge/parse-opening-hours/month)](https://pepy.tech/project/parse-opening-hours)\n\nThis library parses opening hours from various human-readable strings such as \"Mon- Fri 9:00am - 5:30pm\" into a more standard JSON format that can be processed more easily.\n\n## The format\n```json\nopening_hours = [\n\t{\n\t\t\"day\": \"monday\",\n\t\t\"opens\": \"9:00\",\n\t\t\"closes\": \"17:00\"\n\t},\n\t//..\n]\n```\n## Installation\n`pip install parse-opening-hours`\n\n## Usage\n\nThe simplest example is just printing the JSON for an opening hours string:\n```python\nfrom opening_hours import OpeningHours\n\nprint(OpeningHours.parse(\"Mon- Fri 9:00am - 5:30pm\").json())\n```\n\nThis should give you the below output:\n```\n[\n\t{'day': 'monday', 'opens': '9:00', 'closes': '17:30'},\n\t{'day': 'tuesday', 'opens': '9:00', 'closes': '17:30'},\n\t{'day': 'wednesday', 'opens': '9:00', 'closes': '17:30'},\n\t{'day': 'thursday', 'opens': '9:00', 'closes': '17:30'},\n\t{'day': 'friday', 'opens': '9:00', 'closes': '17:30'}\n]\n```\n\nThis has been tested using Python 3.8.5\n### Documentation\nIn addition to this README, there is some documentation generated from inline documentation comments. This is available at https://moralcode.github.io/parse-opening-hours/ \n### Environment variables\nSetting the environment variable `OH_DEBUG` to a value of `Y` will set the root logging level to debug and will cause log entries to appear in stdout for debugging purposes\n\n## Troubleshooting\n### Assumptions\nWhen specifying a time without AM or PM indicators, you may get an error that reads `TypeError: Cannot convert a time of unknown type (AM, PM or 24H) without assuming its type.`. To resolve this, pass `assume_type=TimeType.AM` when calling the `parse()` function. This will use AM in place of an unknown AM or PM designation. In cases like the string \"9-5\", if the second value in the range (in this case the `5` is smaller than the first (i.e. the `9`) then it will be converted to PM automatically\n\n## Tests and Coverage\n\nrun pytet and generate coverage database `pipenv run pytest --cov=./`\n\nshow coverage report: `pipenv run coverage report`","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmoralcode%2Fparse-opening-hours","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmoralcode%2Fparse-opening-hours","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmoralcode%2Fparse-opening-hours/lists"}