FlowerTrack is a Windows desktop app for tracking medical cannabis usage and stock, with an integrated Medicann scraper and local Flower Browser. It combines a dosage tracker, flower library, API-first catalog capture, and automated price/stock change detection with optional Home Assistant and Windows notifications.
Download the latest FlowerTrack.exe from Releases.
- Track flower stock, THC/CBD potency, remaining grams, and daily targets.
- Log doses by route of administration with per-day totals.
- Flower Library and Mix Calculator tools.
- Medicann scraper with API pagination and change detection (new/removed items, price/stock changes, restocks, out-of-stock).
- API auth bootstrap flow (including manual login bootstrap on first run when credentials are missing).
- Home Assistant webhook notifications and optional Windows desktop notifications.
- Flower Browser served at fixed endpoint (
/flowerbrowser) with filters, badges, favorites, basket, and image previews. - Change history viewer in both scraper UI and Flower Browser.
- Theme customization with colour pickers (including tracker thresholds and dark/light palette overrides).
- Optional network modes (
-host/-client) to share tracker/library data and the Flower Browser over LAN (access-key protected, LAN-only by default, optional rate limiting). - Optional console mode (
-console) for live stdout/stderr output from the built exe. - Minimize/close-to-tray support (when enabled in settings).
Shows usage, stock, and daily targets in a single view.
Shows usage history and trends over time.
Stores strains, notes, and metadata.
Shows auto-scraper controls, progress, and log output.
Local webpage with filters, badges, and change highlights.
Favorites list for quick access.
Basket view for comparing items.
Calculator for blend ratios.
Calculator view for combining stock entries.
The scraper generates HTML that is served from a fixed endpoint:
http://127.0.0.1:<port>/flowerbrowser (default port: 8765)
In -client mode, the app opens the host endpoint instead:
http://<host-ip>:<browser-port>/flowerbrowser
It is designed for fast scanning and filtering of the live product list.
Key features:
- Search, filter, and sort by brand, strain, type, stock, THC, and CBD.
- Dedicated irradiation filters (
βandγ) for quick beta/gamma product filtering. - Category filters for flower, oil, vape, and pastille products.
- Visual badges for new/removed items, price movement, out‑of‑stock, and restock highlights.
- Per‑gram pricing and THC/CBD normalization.
- Flags for origin country and irradiation type (where available).
- Brand images with click‑to‑enlarge previews.
- Favorites and basket lists stored locally in the page.
- Live "new page available" banner when a newer export is detected.
- Embedded change history modal with readable detail formatting.
- Uses API-first capture and paginates through the full product list.
- Validates pagination completeness and skips parse/apply on interrupted/partial capture.
- Uses cached auth tokens and refreshes via Playwright bootstrap when required.
- Supports manual visible-browser bootstrap when credentials are incomplete on first run.
- Sends notifications only when changes are detected (per notification toggles).
- In
-clientmode, scraper controls are disabled and data is read from host sync.
FlowerTrack.exe(orpy .\flowertracker.py): standalone mode.FlowerTrack.exe -host: host mode (runs local tracker + data sync API + browser endpoint for clients).FlowerTrack.exe -client: client mode (reads tracker/library data from host, disables local scraper controls).FlowerTrack.exe -console: opens a console window and mirrors runtime logs to stdout/stderr.FlowerTrack.exe --diagnostics: prints diagnostic JSON and exits.
- In Home Assistant, create a webhook automation (Settings → Automations → Create → Webhook).
- Set the webhook ID (e.g.,
flowertrack) and save the automation. - Copy the webhook URL from the automation (it looks like
https://YOUR_HA/api/webhook/flowertrack). - In FlowerTrack → Scraper settings, paste the webhook URL into Home Assistant webhook URL.
- Optional: set a long‑lived access token in Home Assistant token if your HA instance requires it.
- Save settings and use Send test notification to verify.
- Payload includes new/removed items, price changes, and stock changes.
- Quiet hours and summary/full detail are configurable.
- id: flowertrack_webhook
alias: FlowerTrack Webhook
mode: parallel
trigger:
- platform: webhook
webhook_id: flowertrack
variables:
new_msg: >
{% if trigger.json.new_item_summaries %}
New: {{ trigger.json.new_item_summaries | join(', ') }}
{% elif trigger.json.new_items %}
New: {{ trigger.json.new_items | join(', ') }}
{% else %}{{ '' }}{% endif %}
removed_msg: >
{% if trigger.json.removed_item_summaries %}
Removed: {{ trigger.json.removed_item_summaries | join(', ') }}
{% else %}{{ '' }}{% endif %}
price_msg: >
{% if trigger.json.price_change_summaries %}
Price: {{ trigger.json.price_change_summaries | join('; ') }}
{% else %}{{ '' }}{% endif %}
stock_msg: >
{% if trigger.json.stock_change_summaries %}
Stock: {{ trigger.json.stock_change_summaries | join('; ') }}
{% else %}{{ '' }}{% endif %}
restock_msg: >
{% if trigger.json.restock_change_summaries %}
Restock: {{ trigger.json.restock_change_summaries | join('; ') }}
{% else %}{{ '' }}{% endif %}
parts: >
{{ [new_msg, removed_msg, price_msg, stock_msg, restock_msg]
| reject('equalto','')
| reject('equalto', None)
| list }}
combined: >
{% if parts|length > 0 %}
{{ parts | join(' | ') }}
{% else %}
Payload: {{ trigger.json | tojson }}
{% endif %}
action:
- service: notify.mobile_app_pixel_9_pro_xl
data:
title: "FlowerTrack Update"
message: "{{ combined }}"- Enable "Send Windows desktop notifications" in scraper settings.
- Uses
win10toast-clickwhen available (falls back towin10toast).
All user data and configs are stored under:
%APPDATA%\FlowerTrack
Key files:
flowertrack_config.json(unified tracker + scraper settings)data\tracker_data.jsonanddata\library_data.jsonExports\(latest export HTML +changes_latest.json)logs\changes.ndjson(change history)dumps\(optional API dumps when enabled)
Credentials and tokens are stored encrypted (DPAPI on Windows).
- Windows 10/11
- Python 3.12 (dev only)
- Playwright browsers (used for authenticated scraping; auto-installed on first run or via
playwright install) - certifi (dev/runtime dependency for HTTPS validation on fresh PCs)
py .\flowertracker.py- Download the latest
FlowerTrack.exefrom Releases. - Run
FlowerTrack.exe(first run may take a little longer).
Use the one-liner in buildline.txt, or:
Remove-Item -Recurse -Force dist, build, FlowerTrack.spec -ErrorAction SilentlyContinue; $env:PYTHONWARNINGS="ignore"; pyinstaller --onefile --windowed --icon assets/icon.ico --add-data "assets;assets" --add-data "flowerlibrary.py;." --add-data "mixcalc.py;." --add-data "mix_utils.py;." --splash assets/BannerRound.png --exclude-module setuptools.msvc --name FlowerTrack flowertracker.pypy -m pytest- If Playwright browsers are missing, run:
playwright install
- If the scraper logs "No products parsed", increase wait time or retries.
- If you see SSL/certificate errors on a fresh PC (CERTIFICATE_VERIFY_FAILED), install/update certifi and restart:
The app uses certifi for API/HA HTTPS validation; missing roots on Windows can cause fetch failures.
py -m pip install -U certifi
- If scraper settings look blank or defaults are missing, delete
%APPDATA%\FlowerTrack\flowertrack_config.jsonand relaunch to re-seed defaults. - Use the console log in-app for detailed scrape output.
- In
-clientmode:- Confirm host IP/ports and Access key in settings (host and client must match).
- Ensure the host is reachable on the LAN (host blocks public/global client IPs by default).
- If you see HTTP
429, raise the host rate limit in settings (Data settings, host mode) or reduce client polling frequency.
flowertracker.pyentry pointui_*.pyUI modulescapture.pyscraper workerparser.pyAPI payload parser and dedupe logicexports.py+export_template.pyFlower Browser HTML generationexport_server.pylocal HTTP server for/flowerbrowserand live export eventsconfig.pyconfig persistence and migrationstests/unit tests







