{"id":35256397,"url":"https://github.com/metabolize/harrison","last_synced_at":"2026-04-05T01:32:54.877Z","repository":{"id":50233402,"uuid":"58896151","full_name":"metabolize/harrison","owner":"metabolize","description":"Time a block of Python code","archived":false,"fork":false,"pushed_at":"2023-07-01T20:53:27.000Z","size":46,"stargazers_count":6,"open_issues_count":3,"forks_count":1,"subscribers_count":5,"default_branch":"main","last_synced_at":"2025-09-22T16:55:39.264Z","etag":null,"topics":["profiling","timer","timing"],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-2-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/metabolize.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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":"2016-05-16T02:02:58.000Z","updated_at":"2024-03-23T22:40:20.000Z","dependencies_parsed_at":"2023-02-17T10:25:14.756Z","dependency_job_id":null,"html_url":"https://github.com/metabolize/harrison","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/metabolize/harrison","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/metabolize%2Fharrison","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/metabolize%2Fharrison/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/metabolize%2Fharrison/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/metabolize%2Fharrison/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/metabolize","download_url":"https://codeload.github.com/metabolize/harrison/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/metabolize%2Fharrison/sbom","scorecard":{"id":637569,"data":{"date":"2025-08-11","repo":{"name":"github.com/metabolize/harrison","commit":"8e824e124c4c209e5a06489c636e6982c98ece41"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.4,"checks":[{"name":"Code-Review","score":0,"reason":"Found 0/16 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":-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":"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":"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":"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":-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":"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: BSD 2-Clause \"Simplified\" 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":"Vulnerabilities","score":9,"reason":"1 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: PYSEC-2024-48 / GHSA-fj7x-q9j7-g6q6"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 28 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-21T09:38:43.716Z","repository_id":50233402,"created_at":"2025-08-21T09:38:43.716Z","updated_at":"2025-08-21T09:38:43.716Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31421869,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-05T00:25:07.052Z","status":"ssl_error","status_checked_at":"2026-04-05T00:25:05.923Z","response_time":60,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6: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":["profiling","timer","timing"],"created_at":"2025-12-30T08:02:39.064Z","updated_at":"2026-04-05T01:32:54.870Z","avatar_url":"https://github.com/metabolize.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"harrison\n========\n\nTime a block of code.\n\n[![version](https://img.shields.io/pypi/v/harrison?style=flat-square)][pypi]\n[![python version](https://img.shields.io/pypi/pyversions/harrison?style=flat-square)][pypi]\n[![license](https://img.shields.io/pypi/l/harrison?style=flat-square)][pypi]\n[![build](https://img.shields.io/circleci/project/github/metabolize/harrison/master?style=flat-square)][build]\n[![code style](https://img.shields.io/badge/code%20style-black-black?style=flat-square)][black]\n\n[pypi]: https://pypi.org/project/harrison/\n[build]: https://circleci.com/gh/metabolize/harrison/tree/master\n[black]: https://black.readthedocs.io/en/stable/\n\nUse as the context expression of a `with` statement:\n\n```pyconsole\n\u003e\u003e\u003e from harrison import Timer\n\u003e\u003e\u003e with Timer() as t:\n\u003e\u003e\u003e     ...\n\u003e\u003e\u003e print(t.elapsed_time_ms)\n12345\n```\n\nWhen a description string is passed on initialization, the elapsed time will\nbe printed on completion, keyed by this description.\n\n```pyconsole\n\u003e\u003e\u003e with Timer('My expensive block of code'):\n\u003e\u003e\u003e     ...\nMy expensive block of code: 12345 ms\n```\n\nYou can also start and stop a Timer explicitly:\n\n```py\ntimer = Timer()\ntimer.start()\n\nsome_expensive_function(...)\nprint(timer.elapsed_time_s)\n\nanother_expensive_function(...)\ntimer.stop()\nprint(timer.elapsed_time_s)\n```\n\nYou can also time each execution of a function using a decorator:\n\n```py\nfrom harrison import profile\n\n@profile('Describes the function')\ndef some_function():\n    pass\n\n# Without args, the function name (e.g. 'some_function') will be used\n# as the description.\n@profile()\ndef another_function():\n    pass\n```\n\nYou can also use `RegisteredTimer`, which groups together a bunch of named\ntimers, provides utilities for serializing their times, and an optional global\ntimer registry.\n\nNamed after John Harrison, the English carpenter and clockmaker who\ninvented the [marine chronometer][].\n\n[John Harrison]: https://en.wikipedia.org/wiki/John_Harrison\n[marine chronometer]: https://en.wikipedia.org/wiki/Marine_chronometer\n\n\nSimilar libraries\n-----------------\n\nThis is similar to the library [contexttimer][], but that library is licensed\nunder the GPLv3 which is more restrictive than two-clause BSD license used\nhere.\n\n[contexttimer]: https://github.com/brouberol/contexttimer\n\n\nDevelopment\n-----------\n\n```sh\n./dev.py init\n./dev.py test\n```\n\n\nContribute\n----------\n\n- Issue Tracker: https://github.com/metabolize/harrison/issues\n- Source Code: https://github.com/metabolize/harrison\n\nPull requests welcome!\n\n\nSupport\n-------\n\nIf you are having issues, please let us know.\n\n\nAcknowledgements\n----------------\n\nThis project was packaged by [Paul Melnikow][] while at [Body Labs][]. Thanks\nto Body Labs for the repository transfer.\n\n\n[paul melnikow]: https://github.com/paulmelnikow\n[body labs]: https://github.com/bodylabs\n\n\nLicense\n-------\n\nThe project is licensed under the two-clause BSD license.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmetabolize%2Fharrison","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmetabolize%2Fharrison","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmetabolize%2Fharrison/lists"}