GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - openthc/api: Proposal for Common Data Models and APIs for Cannabis Software

BranchesTags
Open more actions menu

Latest commit

 

History

359 Commits
359 Commits

Folders and files

NameName
Last commit message
Last commit date
bin
bin
 
 
doc
doc
 
 
docker
docker
 
 
etc
etc
 
 
json-example
json-example
 
 
lib/Controller
lib/Controller
 
 
openapi
openapi
 
 
test
test
 
 
view
view
 
 
webroot
webroot
 
 
.ackrc
.ackrc
 
 
.dockerignore
.dockerignore
 
 
.gitignore
.gitignore
 
 
CODE_OF_CONDUCT.md
CODE_OF_CONDUCT.md
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 
boot.php
boot.php
 
 
build.sh
build.sh
 
 
compose.yaml
compose.yaml
 
 
composer.json
composer.json
 
 
composer.lock
composer.lock
 
 
make.sh
make.sh
 
 
package-lock.json
package-lock.json
 
 
package.json
package.json
 
 
redocly.yaml
redocly.yaml
 
 

Repository files navigation

OpenTHC Common API

Provides a common reference and API end-point specification for implementing Cannabis Data Systems.

The world of cannabis regulatory compliance is complex and large. There are hundreds of vendors, each with a common goal but without an API, partial API, or have implemented a unique flavor. The goal of this interface is to provide a basis for data interoperability.

It's our hope that others in the cannabis industry could adopt, in whole or in part, some of the concepts and designs published here. Open Issues, submit PRs, etc and we can build the future we all want to see.

A Common Data Model

An important first step for bringing the industry together is to start talking in with common terms, a second is a common interface.

The OpenTHC API Specification aims to define core parts of this data model and suggested interfaces. The API and data-models are defined in the openapi directory. There are definitions of base-data (ie: lab-metric, product-type in etc. Both are defined with YAML.

Some scripts for processing that YAML into other flavours (JSON, CSV, SQL) are in bin. But, YAML is so easy, one can quickly process with their preferred tools.

A Common Interface

The OpenTHC API Module provides a method for reading/writing to a compatible system. A set of standard base data models for objects in the cannabis industry.

This API was heavily influenced by the Open API Initiative and the Data Transfer Project

  • Use International System of Units for weight and volume values.
  • Use ISO-8601 for date and time values.

We provide some base data examples and JSON schema.

Documentation

The documentation has been created using a combination of Asciidoc and OpenAPI.

Asciidoc is in doc and the OpenAPI sources are in openapi

./make.sh docs

JSON Schema

A JSON Schema is published for all the objects in this system, they are located in ./webroot/pub/json-schema These files are constructed from the YAML documentation in ./swagger Sample objects are provided in ./json-example

./make.sh docs-openapi

Data Models

There is a bunch of "base" data for this industry, Company, Company_Type, License, License_Type, Product_Type, Variety and Laboratory Metrics. Included in the ./etc directory are pre-populated yaml files describing these common objects. Usage of common, unique identifiers for data-fields we all care about will improve interoperablity.

License Configuration Data

These objects are defined and specific to each Company or License in the system. Includes: Product, Variety, Section, Vehicle (although, Section and Vehicle only exist for backwards compatibility)

License Operational Data

  • Crop / Plant
  • Inventory Lot
  • Lab Sample / Lab Result
  • B2B Transaction and B2B Transaction Items
  • B2C Transaction and B2C Transaction Items

Testing

Run the unit tests in ./test

./make.sh test

You could also use Prism for running a mock interface.

Dependencies

This thing depends on Asciidoc/Asciidoctor (Python, Ruby) and some build scripts (JS, PHP, Ruby). Just review the make.sh script for the latest information.

See Also

  • https://openapis.org/
  • https://asciidoctor.org/
  • https://redoc.ly/redoc/
  • https://jsonschema.net/#/
  • https://www.jsonschemavalidator.net/
  • https://github.com/epoberezkin/ajv
  • https://github.com/zircote/swagger-php
  • https://github.com/jensoleg/swagger-ui
  • https://github.com/E96/swagger2slate
  • How to Design the APIs of Tomorrow
  • Ask HN: What is your go-to example for a good REST API?
  • Ask HN: What are good reads for designing APIs?
  • Microsoft REST API Guidelines

About

Proposal for Common Data Models and APIs for Cannabis Software

api.openthc.org/

Topics

apicannabisseed-to-saletraceability

Resources

Readme
GPL-3.0 license

Code of conduct

Code of conduct
Activity
Custom properties

Stars

82 stars

Watchers

10 watching

Forks

16 forks
Report repository

Releases

Packages

Used by

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.