Skip to main content

CDES Python SDK

Official Python SDK for the Cannabis Data Exchange Standard (CDES).

Installation

pip install cdes

Quick Start

Validate Cannabis Data

from cdes import validate_strain, validate_terpene_profile

# Validate a strain record
result = validate_strain({
    "id": "blue-dream",
    "name": "Blue Dream",
    "type": "hybrid"
})

if result.valid:
    print(" Strain data is valid!")
else:
    for error in result.errors:
        print(f" {error.path}: {error.message}")

Access Reference Data

from cdes import get_terpene_library, get_terpene_by_id

# Get the complete terpene library
library = get_terpene_library()
print(f"Library version: {library.version}")
print(f"Total terpenes: {len(library.terpenes)}")

# Look up a specific terpene
myrcene = get_terpene_by_id("terp-myrcene")
print(f"{myrcene.name}: CAS {myrcene.casNumber}")
print(f"Aromas: {', '.join(myrcene.aroma)}")

Features

  • Schema Validation - Validate strains, COAs, terpene profiles, and cannabinoid profiles
  • Reference Data - Access the official CDES terpene library with CAS numbers and effects
  • Type Safety - Full type hints and dataclass models
  • Zero Dependencies - Pure Python, no external packages required

API Reference

Validators

Function Description
validate_strain(data) Validate a strain record
validate_coa(data) Validate a Certificate of Analysis
validate_terpene_profile(data) Validate a terpene profile
validate_cannabinoid_profile(data) Validate a cannabinoid profile

Reference Data

Function Description
get_terpene_library() Get the complete terpene library
get_terpene_by_id(id) Look up a terpene by CDES ID

Models

Class Description
ValidationResult Result of a validation operation
ValidationError A single validation error
Terpene A cannabis terpene
TerpeneLibrary The complete terpene reference

Development

# Clone the repository
git clone https://github.com/Acidni-LLC/cdes-sdk-python.git
cd cdes-sdk-python

# Install dev dependencies
pip install -e ".[dev]"

# Run tests
pytest

# Format code
black cdes tests

License

MIT License - see LICENSE for details.

Maintained By

Acidni LLC - Cannabis Data Analytics & AI Solutions

Metadata

Release files for cdes 1.5.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for cdes 1.5.0
File Size Uploaded Provenance Actions
cdes-1.5.0.tar.gz 25.3 kB With provenance Details for cdes-1.5.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for cdes 1.5.0
File Interpreter ABI Platform Actions
cdes-1.5.0-py3-none-any.whl Python 3 none any Details for cdes-1.5.0-py3-none-any.whl

Total release size: 53.0 kB

Release files / cdes-1.5.0.tar.gz

Download URL cdes-1.5.0.tar.gz
Size 25.3 kB
Tags Source
SHA-256 checksum
How to use checksums
ae21065e12aef708bcd166bacffcb3a6491922613f3b30116fe9b086fb0973c8
BLAKE2b-256 checksum
How to use checksums
28c14a63d92de82ddcf89c511df1f81eceb6bcc22cfd4020a18858941684399e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Mar 10, 2026.

Transparency log

Release files / cdes-1.5.0-py3-none-any.whl

Download URL cdes-1.5.0-py3-none-any.whl
Size 27.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d99927224741973aadd283267ac4c17e1a0ba750d6c0f4c9ef69d9a27a2091d5
BLAKE2b-256 checksum
How to use checksums
ec2fb2c3200aaac03a26b962690d00b247ecb8b66f19c9cba910625be50f02d1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Mar 10, 2026.

Transparency log

Security for cdes 1.5.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for cdes-1.5.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Mar 10, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page