{"id":37687071,"url":"https://github.com/mjmikulski/horology","last_synced_at":"2026-01-16T12:35:30.506Z","repository":{"id":36469164,"uuid":"144642993","full_name":"mjmikulski/horology","owner":"mjmikulski","description":"timing functions, contexts and for-loops","archived":false,"fork":false,"pushed_at":"2025-10-26T13:36:27.000Z","size":658,"stargazers_count":88,"open_issues_count":0,"forks_count":3,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-10-26T15:29:32.408Z","etag":null,"topics":["hacktoberfest","hacktoberfest2021","python"],"latest_commit_sha":null,"homepage":"","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/mjmikulski.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":".github/contributing.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-08-13T23:11:07.000Z","updated_at":"2025-10-26T13:39:33.000Z","dependencies_parsed_at":"2024-06-19T09:54:57.449Z","dependency_job_id":"284c4bc7-d25f-4a9a-b02b-38f3f89e2a64","html_url":"https://github.com/mjmikulski/horology","commit_stats":{"total_commits":90,"total_committers":3,"mean_commits":30.0,"dds":0.09999999999999998,"last_synced_commit":"504faf8b103eb7aeaa609706c20f084025650533"},"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"purl":"pkg:github/mjmikulski/horology","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mjmikulski%2Fhorology","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mjmikulski%2Fhorology/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mjmikulski%2Fhorology/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mjmikulski%2Fhorology/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mjmikulski","download_url":"https://codeload.github.com/mjmikulski/horology/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mjmikulski%2Fhorology/sbom","scorecard":{"id":651648,"data":{"date":"2025-08-11","repo":{"name":"github.com/mjmikulski/horology","commit":"862db8ccc850fa7ea154a74273e0e29b62690df7"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":4.3,"checks":[{"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":"Code-Review","score":0,"reason":"Found 0/5 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":"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":"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":"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":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Info: jobLevel 'contents' permission set to 'read': .github/workflows/codeql.yaml:18","Info: jobLevel 'actions' permission set to 'read': .github/workflows/codeql.yaml:17","Warn: no topLevel permission defined: .github/workflows/codeql.yaml:1","Warn: no topLevel permission defined: .github/workflows/tests.yaml: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":"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/codeql.yaml:28: update your workflow using https://app.stepsecurity.io/secureworkflow/mjmikulski/horology/codeql.yaml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/codeql.yaml:31: update your workflow using https://app.stepsecurity.io/secureworkflow/mjmikulski/horology/codeql.yaml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/codeql.yaml:36: update your workflow using https://app.stepsecurity.io/secureworkflow/mjmikulski/horology/codeql.yaml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/tests.yaml:20: update your workflow using https://app.stepsecurity.io/secureworkflow/mjmikulski/horology/tests.yaml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/tests.yaml:23: update your workflow using https://app.stepsecurity.io/secureworkflow/mjmikulski/horology/tests.yaml/master?enable=pin","Warn: pipCommand not pinned by hash: .github/workflows/tests.yaml:29","Info:   0 out of   5 GitHub-owned 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":"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":"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"}},{"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":-1,"reason":"internal error: error during branchesHandler.setup: internal error: githubv4.Query: Resource not accessible by integration","details":null,"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":"SAST","score":7,"reason":"SAST tool detected but not run on all commits","details":["Info: SAST configuration detected: CodeQL","Warn: 11 commits out of 30 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-21T13:39:04.265Z","repository_id":36469164,"created_at":"2025-08-21T13:39:04.265Z","updated_at":"2025-08-21T13:39:04.265Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28478684,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-16T11:59:17.896Z","status":"ssl_error","status_checked_at":"2026-01-16T11:55:55.838Z","response_time":107,"last_error":"SSL_read: 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":["hacktoberfest","hacktoberfest2021","python"],"created_at":"2026-01-16T12:35:29.857Z","updated_at":"2026-01-16T12:35:30.491Z","avatar_url":"https://github.com/mjmikulski.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# `Horology`\n\n[![PyPI version](https://badge.fury.io/py/horology.svg)](https://badge.fury.io/py/horology)\n[![tests](https://github.com/mjmikulski/horology/actions/workflows/tests.yaml/badge.svg)](https://github.com/mjmikulski/horology/actions/workflows/tests.yaml)\n[![codeql](https://github.com/mjmikulski/horology/actions/workflows/codeql.yaml/badge.svg)](https://github.com/mjmikulski/horology/actions/workflows/codeql.yaml)\n[![PythonVersion](https://img.shields.io/badge/python-3.10%20%7C%203.11%20%7C%203.12%20%7C%203.13%20%7C%203.14-blue)](https://pypi.org/project/horology/)\n[![OperatingSystems](https://img.shields.io/badge/OS-linux%20%7C%20windows%20%7C%20macos-green)](https://pypi.org/project/horology/)\n[![Downloads](https://pepy.tech/badge/horology/month)](https://pepy.tech/project/horology)\n[![License: MIT](https://img.shields.io/badge/License-MIT-cyan.svg)](https://opensource.org/licenses/MIT)\n\n\nConveniently measures the time of your loops, contexts and functions.\n\n![](hourglass_violet.jpg \"Violet hourglass\")\n\n## Installation\n\n| horology version | compatible python |\n|------------------|-------------------|\n| 1.4.2            | 3.10-3.14         |\n| 1.4.1            | 3.10-3.13         |\n| 1.4              | 3.10-3.12         |\n| 1.3              | 3.8-3.11          |\n| 1.2              | 3.6-3.9           |\n| 1.1              | 3.6-3.8           |\n\nHorology can be installed with PIP. It has no dependencies.\n\n```\npip install horology\n```\n\n## Usage\n\nThe following 3 tools will let you measure practically any part of your Python code.\n\n### Timing an iterable (list, tuple, generator, etc)\n\n#### Quick example\n\n```python\nfrom horology import Timed\n\nanimals = ['cat', 'dog', 'crocodile']\n\nfor x in Timed(animals):\n    feed(x)\n```\n\nResult:\n\n```\niteration    1: 12.0 s\niteration    2: 8.00 s\niteration    3: 100 s\n\ntotal 3 iterations in 120 s\nmin/median/max: 8.00/12.0/100 s\naverage (std): 40.0 (52.0) s\n\n```\n\n#### Customization\n\nYou can specify where (if at all) you want each iteration and summary to be printed, eg.:\n\n```python\nfor x in Timed(animals, unit='ms',\n               iteration_print_fn=logger.debug,\n               summary_print_fn=logger.info):\n    feed(x)\n```\n\n### Timing a function with a `@timed` decorator\n\n#### Quick example\n\n```python\nfrom horology import timed\n\n\n@timed\ndef foo():\n    ...\n```\n\nResult:\n\n```\n\u003e\u003e\u003e foo()\nfoo: 7.12 ms\n```\n\n#### Customization\n\nChose time unit and name:\n\n```python\n@timed(unit='s', name='Processing took ')\ndef bar():\n    ...\n```\n\nResult:\n\n```\n\u003e\u003e\u003e bar()\nProcessing took 0.185 s\n```\n\n### Timing part of code with a `Timing` context\n\n#### Quick example\n\nJust wrap your code using a `with` statement\n\n```python\nfrom horology import Timing\n\nwith Timing(name='Important calculations: '):\n    ...\n```\n\nResult:\n\n```\nImportant calculations: 12.4 s\n```\n\n#### Customization\n\nYou can suppress default printing and directly use measured time (also within context)\n\n```python\nwith Timing(print_fn=None) as t:\n    ...\n\nmake_use_of(t.interval)\n```\n\n## Time units\n\nTime units are by default automatically adjusted, for example you will see\n`foo: 7.12 ms` rather than `foo: 0.007 s`. If you don't like it, you can\noverride this by setting the `unit` argument with one of these names:\n`['ns', 'us', 'ms', 's', 'min', 'h', 'd']`.\n\n## Contributions\n\nContributions are welcomed, see [contribution guide](.github/contributing.md).\n\n## Internals\n\nHorology internally measures time with `perf_counter` which provides the *highest available resolution,*\nsee [docs](https://docs.python.org/3/library/time.html#time.perf_counter).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmjmikulski%2Fhorology","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmjmikulski%2Fhorology","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmjmikulski%2Fhorology/lists"}