{"id":36252804,"url":"https://github.com/openthc/cre-adapter","last_synced_at":"2026-01-11T07:02:14.873Z","repository":{"id":49625618,"uuid":"152337632","full_name":"openthc/cre-adapter","owner":"openthc","description":"API Adapter for BioTrackTHC, LeafDat, METRC, WCIA, and CCRS","archived":false,"fork":false,"pushed_at":"2025-12-19T17:26:43.000Z","size":454,"stargazers_count":2,"open_issues_count":2,"forks_count":2,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-12-22T07:25:32.692Z","etag":null,"topics":["api-adapter","biotrack","ccrs","leafdata","metrc","seed-to-sale","traceability","wcia"],"latest_commit_sha":null,"homepage":"","language":"PHP","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/openthc.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2018-10-10T00:08:09.000Z","updated_at":"2025-12-19T17:26:46.000Z","dependencies_parsed_at":"2022-09-07T03:03:00.276Z","dependency_job_id":"02ae7574-09b3-422c-9369-760b744d3e01","html_url":"https://github.com/openthc/cre-adapter","commit_stats":{"total_commits":216,"total_committers":4,"mean_commits":54.0,"dds":0.1527777777777778,"last_synced_commit":"3d72e9cffff074520ba87577bdf692983bd50ff2"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/openthc/cre-adapter","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openthc%2Fcre-adapter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openthc%2Fcre-adapter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openthc%2Fcre-adapter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openthc%2Fcre-adapter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/openthc","download_url":"https://codeload.github.com/openthc/cre-adapter/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openthc%2Fcre-adapter/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28296941,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-11T04:44:51.577Z","status":"ssl_error","status_checked_at":"2026-01-11T04:44:44.232Z","response_time":60,"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":["api-adapter","biotrack","ccrs","leafdata","metrc","seed-to-sale","traceability","wcia"],"created_at":"2026-01-11T07:02:14.776Z","updated_at":"2026-01-11T07:02:14.863Z","avatar_url":"https://github.com/openthc.png","language":"PHP","readme":"# Cannabis Reporting Engine Adapters\n\nAPI Adapters for BioTrack, METRC and other Cannabis Regulatory Engines.\nThese scripts expose a common interface for these different API interfaces.\n\n\n## Examples\n\nThere is a convenience factory method to use with the proper configuration (loaded from `etc/cre.yaml`).\n\n\n```php\n$cfg = \\OpenTHC\\CRE::getConfig('usa-wa');\n$cre = \\OpenTHC\\CRE::factory($cfg);\n$res = $cre-\u003elicense()-\u003esearch();\n$res = $cre-\u003ecrop()-\u003esearch();\nforeach ($res as $rec) {\n\techo $rec['variety']['name'] . \"\\n\";\n}\n\n$res = $cre-\u003einventory()-\u003esearch();\nforeach ($res as $rec) {\n\techo $rec['id'] . ' ' . $rec['product_id'] . \"\\n\";\n}\n```\n\n\n## Supported Cannabis Reporting Engines\n\n* BioTrack: Hawai'i, Illinois, New Mexico, Puerto Rico\n* METRC: Alaska, California, Colorado, Maine, Massachusetts, Michigan, Montana, Nevada, Oklahoma, Oregon, etc\n\nOther engines will be added, of course :)\nSome of the engine specific adapters are very thin layers, they really only exist for consistency.\n\n\n## Connect\n\n```php\n$cre = \\OpenTHC\\CRE::factory($cfg);\n$cre-\u003eping();\n```\n\n\n## Reading Objects\n\nA low level, GET and POST/PUT interface exists.\n\n\n```php\n$res = $cre-\u003eget('/object?page=0\u0026sort=created_at');\n$res = $cre-\u003epost('/object', $arg);\n$res = $cre-\u003eput('/object/id', $arg);\n```\n\n\n## High Level API\n\nIt's also possible to interface with the objects at a higher level.\n\n\n```php\n$obj_list = $cre-\u003elicense()-\u003esearch($arg);\n$obj = $cre-\u003elicense()-\u003esingle($oid);\n$res = $cre-\u003elicense()-\u003ecreate($obj);\n$res = $cre-\u003elicense()-\u003eupdate($oid, $obj);\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopenthc%2Fcre-adapter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fopenthc%2Fcre-adapter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopenthc%2Fcre-adapter/lists"}