PHPackages                             openthc/cre-adapter - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. openthc/cre-adapter

ActiveLibrary[API Development](/categories/api)

openthc/cre-adapter
===================

OpenTHC Cannabis Reporting Engine API Adapters

22.1k3[1 issues](https://github.com/openthc/cre-adapter/issues)[1 PRs](https://github.com/openthc/cre-adapter/pulls)PHP

Since Nov 6Pushed 1w ago3 watchersCompare

[ Source](https://github.com/openthc/cre-adapter)[ Packagist](https://packagist.org/packages/openthc/cre-adapter)[ RSS](/packages/openthc-cre-adapter/feed)WikiDiscussions main Synced 5d ago

READMEChangelogDependenciesVersions (3)Used By (0)

Cannabis Reporting Engine Adapters
==================================

[](#cannabis-reporting-engine-adapters)

API Adapters for BioTrack, METRC and other Cannabis Regulatory Engines. These scripts expose a common interface for these different API interfaces.

Examples
--------

[](#examples)

There is a convenience factory method to use with the proper configuration (loaded from `etc/cre.yaml`).

```
$cfg = \OpenTHC\CRE::getConfig('usa-wa');
$cre = \OpenTHC\CRE::factory($cfg);
$res = $cre->license()->search();
$res = $cre->crop()->search();
foreach ($res as $rec) {
	echo $rec['variety']['name'] . "\n";
}

$res = $cre->inventory()->search();
foreach ($res as $rec) {
	echo $rec['id'] . ' ' . $rec['product_id'] . "\n";
}
```

Supported Cannabis Reporting Engines
------------------------------------

[](#supported-cannabis-reporting-engines)

- BioTrack: Hawai'i, Illinois, New Mexico, Puerto Rico
- METRC: Alaska, California, Colorado, Maine, Massachusetts, Michigan, Montana, Nevada, Oklahoma, Oregon, etc

Other engines will be added, of course :) Some of the engine specific adapters are very thin layers, they really only exist for consistency.

Connect
-------

[](#connect)

```
$cre = \OpenTHC\CRE::factory($cfg);
$cre->ping();
```

Reading Objects
---------------

[](#reading-objects)

A low level, GET and POST/PUT interface exists.

```
$res = $cre->get('/object?page=0&sort=created_at');
$res = $cre->post('/object', $arg);
$res = $cre->put('/object/id', $arg);
```

High Level API
--------------

[](#high-level-api)

It's also possible to interface with the objects at a higher level.

```
$obj_list = $cre->license()->search($arg);
$obj = $cre->license()->single($oid);
$res = $cre->license()->create($obj);
$res = $cre->license()->update($oid, $obj);
```

###  Health Score

29

—

LowBetter than 59% of packages

Maintenance54

Moderate activity, may be stable

Popularity24

Limited adoption so far

Community14

Small or concentrated contributor base

Maturity20

Early-stage or recently created project

 Bus Factor1

Top contributor holds 89.7% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://www.gravatar.com/avatar/ddcf41d804b34c0483ade6ebca0b473fcf6cce2e6bf8bdf9056999b6bb48b9c1?d=identicon)[openthc](/maintainers/openthc)

---

Top Contributors

[![djbusby](https://avatars.githubusercontent.com/u/3802734?v=4)](https://github.com/djbusby "djbusby (305 commits)")[![mashiox](https://avatars.githubusercontent.com/u/308284?v=4)](https://github.com/mashiox "mashiox (32 commits)")[![theCompanyDream](https://avatars.githubusercontent.com/u/1742051?v=4)](https://github.com/theCompanyDream "theCompanyDream (3 commits)")

---

Tags

api-adapterbiotrackccrsleafdatametrcseed-to-saletraceabilitywcia

### Embed Badge

![Health badge](/badges/openthc-cre-adapter/health.svg)

```
[![Health](https://phpackages.com/badges/openthc-cre-adapter/health.svg)](https://phpackages.com/packages/openthc-cre-adapter)
```

###  Alternatives

[stripe/stripe-php

Stripe PHP Library

4.0k143.3M480](/packages/stripe-stripe-php)[twilio/sdk

A PHP wrapper for Twilio's API

1.6k92.9M272](/packages/twilio-sdk)[knplabs/github-api

GitHub API v3 client

2.2k15.8M187](/packages/knplabs-github-api)[facebook/php-business-sdk

PHP SDK for Facebook Business

90121.9M34](/packages/facebook-php-business-sdk)[meilisearch/meilisearch-php

PHP wrapper for the Meilisearch API

73813.7M114](/packages/meilisearch-meilisearch-php)[google/gax

Google API Core for PHP

263103.1M454](/packages/google-gax)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
