Automate Metrc with T3 Scripts

#!/usr/bin/env python3
# /// script
# requires-python = ">=3.8"
# dependencies = [
#     "t3api_utils",
# ]
# ///


from t3api_utils.api.parallel import load_all_data_sync
from t3api_utils.main.utils import (get_authenticated_client_or_error,
                                    interactive_collection_handler,
                                    pick_license)


api_client = get_authenticated_client_or_error()

license = pick_license(api_client=api_client)

all_packages = load_all_data_sync(
    client=api_client,
    path="/v2/packages/active",
    license_number=license["licenseNumber"],
)

interactive_collection_handler(data=all_packages)

Simple Python scripts powered by the T3 API

Automate Metrc workflows with powerful Python scripts. Easy-to-use libraries make reading and writing Metrc data effortless. Perfect for custom reports, data analysis, and automation.