{"id":16399749,"url":"https://github.com/jayrbolton/hadrosaur","last_synced_at":"2026-06-25T13:31:37.316Z","repository":{"id":57436595,"uuid":"237343435","full_name":"jayrbolton/hadrosaur","owner":"jayrbolton","description":"File management for batch compute work","archived":false,"fork":false,"pushed_at":"2020-03-15T03:44:16.000Z","size":58,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-11-09T04:18:42.111Z","etag":null,"topics":["batch-processing","cluster-computing","hpc","hpc-applications"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jayrbolton.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":"2020-01-31T02:03:47.000Z","updated_at":"2021-01-12T00:48:56.000Z","dependencies_parsed_at":"2022-09-10T01:51:54.490Z","dependency_job_id":null,"html_url":"https://github.com/jayrbolton/hadrosaur","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/jayrbolton/hadrosaur","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jayrbolton%2Fhadrosaur","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jayrbolton%2Fhadrosaur/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jayrbolton%2Fhadrosaur/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jayrbolton%2Fhadrosaur/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jayrbolton","download_url":"https://codeload.github.com/jayrbolton/hadrosaur/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jayrbolton%2Fhadrosaur/sbom","scorecard":{"id":509187,"data":{"date":"2025-08-11","repo":{"name":"github.com/jayrbolton/hadrosaur","commit":"22babf9affabbf9bac076774d80ccce255040c49"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":2.2,"checks":[{"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":"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":"Code-Review","score":0,"reason":"Found 0/20 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":"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":"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":"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":"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":"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":0,"reason":"license file not detected","details":["Warn: project does not have a license file"],"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'"],"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":7,"reason":"3 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: PYSEC-2020-92 / GHSA-hj5v-574p-mj7c","Warn: Project is vulnerable to: PYSEC-2022-42969","Warn: Project is vulnerable to: GHSA-jfmj-5v4g-7637"],"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 9 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-20T00:05:31.745Z","repository_id":57436595,"created_at":"2025-08-20T00:05:31.745Z","updated_at":"2025-08-20T00:05:31.745Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34778079,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-25T02:00:05.521Z","response_time":101,"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":["batch-processing","cluster-computing","hpc","hpc-applications"],"created_at":"2024-10-11T05:25:35.250Z","updated_at":"2026-06-25T13:31:37.284Z","avatar_url":"https://github.com/jayrbolton.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# hadrosaur — computed resource management\n\n![logo](docs/logo.jpg)\n\nHadrosaur makes it easy to track the completion status, errors, and logs of large amounts of resources (files, metadata, analytics, database imports, etc.).\n\nYou simply define your resource as a decorated Python function that can create files and save metadata using an identifier in a certain namespace. Later on, you can quickly fetch the status and results of previously computed resources.\n\nThis library uses a combination of LevelDB and the file system to track the state of your tasks.\n\n## Quick usage tutorial\n\n### Install\n\n```sh\npip install hadrosaur\n```\n\n### Define a resource collection\n\nImport the lib and initialize a project using a base directory. Files, metadata, and logs will all get stored under this directory.\n\n```py\nfrom hadrosaur import Project\n\nproj = Project('./base_directory')\n```\n\nDefine a collection using a decorator around a function. This function's job is to generate a single resource for the collection given a unique ID and some arguments.\n\nThe collection should have a unique name, and its function must take these params:\n\n* `ident` — an identifier (unique across the collection) for each computed resource\n* `args` — a dictionary of optional arguments\n* `ctx` — a Context object which holds some extra data you may find useful during computation:\n  * `ctx.subdir` - the path of a directory in which you can store files for this resource\n  * `ctx.logger` - a special Python logging instance that will write to a rotating log file stored in the resource directory, with some nice default formatting\n\n```py\n@proj.resource('collection_name')\ndef compute_resource(ident, args, ctx):\n  ctx.logger.info(\"Starting up\")\n  # Run some things...\n  # Maybe save stuff into ctx.subdir...\n  time.sleep(1)\n  # Return any JSON-serializable data for the resource, such as metadata, run results, filepaths, etc.\n  return {'ts': time.time()}\n```\n\n### Fetch a resource\n\nUse the `proj.fetch(collection_name, ident)` method to compute and cache resources in a collection.\n\nKeyword arguments:\n\n* `args` -- an optional dict of extra arguments for the resource compute function\n* `recompute` -- force the resource to be re-computed, even if it has already been computed\n\nWhat happens when you fetch a resource:\n\n* If the resource has not yet been computed, the collection's compute function will be run.\n* If the resource was already computed in the past, then the saved results will get returned instantly (unless `recompute=True` has been set in the keyword arguments).\n* If an error is thrown in the function, logs will be saved and the status will be updated\n\n```py\n\u003e\u003e proj.fetch('collection_name', 'uniq_ident123', optional_args)\n\u003cResource\u003e\n```\n\nThe resource object has the following properties:\n\n* `resource.result`: any JSON-serializable data returned by the resource's compute function\n* `resource.start_time`: The unix epoch (in milliseconds) of when the resource started being computed\n* `eresource.end_time`: the unix epoch (in ms) of when the resource finished computing (or failed)\n* `resource.status`: whether the resource has been computed already (\"completed\"), is currently being computed (\"pending\"), has not yet been fetched at all (\"unavailable\"), or threw a Python error while running the function (\"error\")\n* `resource.paths`: A dictionary of all the filesystem paths associated with your resource, with the following keys:\n  * `'base'`: The base directory that holds all data for the resource\n  * `'error'`: A Python stacktrace of any error that occured while running the resource's function\n  * `'log`': A line-by-line log file produced by the resource's logger (`ctx.logger`)\n  * `'status'`: Path to the current status (\"unavailable\", \"completed\", \"pending\", \"error\")\n  * `'result'`: Path to a JSON file of serializable data returned by the resource's function\n  * `'storage'`: Directory path of additional files written by the resource's function (`ctx.subdir`)\n\n### Fetch status and information \n\n#### Fetch stats for a collection\n\nTo see status counts for a whole collection, use `proj.stats('collection_name')`:\n\n```py\n\u003e proj.stats('collection_name')\n{\n  'counts': {\n      'total': 100,\n      'pending': 75,\n      'completed': 20,\n      'error': 5,\n      'unavailable': 0\n  }\n}\n```\n\nUse `proj.stats()` without an argument to fetch the stats for all collections.\n\nTo get a list of resource IDs for a given status, use `proj.fetch_by_status`:\n\n```py\n\u003e proj.fetch_by_status('collection_name', 'pending')\n['1', '2', '3'..]\n```\n\n### Fetch info about a single resource\n\nUse `proj.status('collection_name', 'resource_id')` to see the status of a particular resource.\n\n```py\n\u003e proj.status('collection_name', 'resource_id')\n\"complete\"\n```\n\nIf an exception was raised during the execution of the function used to compute\na resource, then use `proj.fetch_error` to see the error.\n\n```py\n\u003e proj.fetch_error('collection_name', 'resource_id')\n\"\"\"Traceback (most recent call last):\n  File \"/home/j/code/hadrosaur/hadrosaur/main.py\", line 211, in fetch\n    result = func(ident, args, ctx)\n  File \"/home/j/code/hadrosaur/test/test_general.py\", line 26, in throw_something\n    raise RuntimeError('This is an error!')\nRuntimeError: This is an error!\"\"\"\n```\n\nTo see the run log (produced by `ctx.logger` during function execution), then use `proj.fetch_log`\n\n```py\n\u003e proj.fetch_log('collection_name', 'resource_id')\n\"\"\"\n2020-02-05 16:15:35 INFO     output here (test_general.py:25)\n2020-02-05 16:15:35 INFO     more output here (test_general.py:25)\n\"\"\"\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjayrbolton%2Fhadrosaur","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjayrbolton%2Fhadrosaur","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjayrbolton%2Fhadrosaur/lists"}