{"id":49792408,"url":"https://github.com/ljrobinson/cannabismath","last_synced_at":"2026-05-12T06:06:30.361Z","repository":{"id":353677106,"uuid":"1220457027","full_name":"LJrobinson/CannabisMath","owner":"LJrobinson","description":"CannabisMath Multi-language cannabis math library for potency, dosing, pricing, weights, and retail calculations.","archived":false,"fork":false,"pushed_at":"2026-05-12T00:19:16.000Z","size":2213,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-05-12T00:24:14.764Z","etag":null,"topics":["cannabis","cannabis-calculator","cannabis-compliance","cannabis-industry","cannabis-retail","cannabis-tech","csharp","dosing","dotnet","kotlin","npm","nuget","potency","pricing","pypi","python","retail-analytics","rust","typescript"],"latest_commit_sha":null,"homepage":"","language":"C#","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/LJrobinson.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,"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":"2026-04-24T23:24:23.000Z","updated_at":"2026-05-12T00:19:04.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/LJrobinson/CannabisMath","commit_stats":null,"previous_names":["ljrobinson/cannabismath"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/LJrobinson/CannabisMath","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LJrobinson%2FCannabisMath","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LJrobinson%2FCannabisMath/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LJrobinson%2FCannabisMath/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LJrobinson%2FCannabisMath/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/LJrobinson","download_url":"https://codeload.github.com/LJrobinson/CannabisMath/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LJrobinson%2FCannabisMath/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32926049,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-11T17:09:15.040Z","status":"online","status_checked_at":"2026-05-12T02:00:06.338Z","response_time":102,"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":["cannabis","cannabis-calculator","cannabis-compliance","cannabis-industry","cannabis-retail","cannabis-tech","csharp","dosing","dotnet","kotlin","npm","nuget","potency","pricing","pypi","python","retail-analytics","rust","typescript"],"created_at":"2026-05-12T06:06:20.829Z","updated_at":"2026-05-12T06:06:30.356Z","avatar_url":"https://github.com/LJrobinson.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# CannabisMath\n\nCannabisMath is a cross-platform cannabis calculation engine built for accuracy, consistency, and real-world retail workflows.\n\nIt provides deterministic cannabis calculations across:\n\n- C# / .NET\n- TypeScript / JavaScript\n- Python\n- Rust\n- Kotlin / JVM\n\nAll implementations are validated against shared JSON fixtures to ensure identical results across every platform.\n\n## Why CannabisMath?\n\nCannabis calculations are often inconsistent across systems.\n\nSmall differences in:\n\n- rounding rules\n- potency formulas\n- weight assumptions\n- tax handling\n- packaging logic\n\ncan lead to mismatched totals, POS errors, reporting issues, and customer frustration.\n\nCannabisMath provides a single source of truth for common cannabis retail and compliance math.\n\n## Features\n\n- Potency calculations\n- THC / CBD total calculations\n- Weight conversions\n- Dosing calculations\n- Pricing logic\n- Tax calculations\n- Rounding utilities\n- Nickel rounding\n- Packaging breakdowns\n- Composite calculations\n\n## Installation\n\n### C# / .NET\n\n```bash\ndotnet add package CannabisMath.Core\n```\n\n### TypeScript / JavaScript\n\n```bash\nnpm install @ljrobinson/cannabismath\n```\n\n### Python\n\n```bash\npip install cannabismath\n```\n\n### Rust\n\n```bash\ncd rust\ncargo test\ncargo run --example basic_usage\n```\n\n### Kotlin / JVM\n\n```bash\ncd kotlin\n./gradlew test\n```\n\n## Example\n\n### Python\n\n```python\nfrom cannabismath import CannabisValueCalculator\n\nvalue = CannabisValueCalculator.price_per_mg_from_weight_and_potency(\n    price=35,\n    weight_grams=3.5,\n    potency_percent=20\n)\n\nprint(value)\n```\n\nOutput:\n\n```text\n0.05\n```\n\n## Architecture\n\nCannabisMath uses shared JSON fixtures to validate behavior across every supported language implementation.\n\nThe same fixture data is used to test:\n\n- C#\n- TypeScript\n- Python\n- Rust\n- Kotlin\n\nThis helps prevent calculation drift between platforms.\n\n## Use Cases\n\nCannabisMath can be used in:\n\n- POS systems\n- analytics dashboards\n- inventory tools\n- data pipelines\n- pricing tools\n- consumer calculators\n- compliance-adjacent internal tools\n\n## Disclaimer\n\nCannabisMath is a calculation library only.\n\nIt does not provide legal, regulatory, medical, tax, or compliance advice. Users are responsible for validating calculations against their own jurisdiction, business rules, and reporting requirements.\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fljrobinson%2Fcannabismath","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fljrobinson%2Fcannabismath","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fljrobinson%2Fcannabismath/lists"}