Larz › Pricing as code in Python

Your pricing, as one Python object

Stop scattering plan logic across your app. In Larz, pricing is declarative — and it's the single source of truth for the page, the checkout, the entitlements and the meters.

pip install larz
from larz.pricing import Pricing
(Pricing()
 .plan("free", "$0",     limits={"projects": 3})
 .plan("pro",  "$19/mo", trial_days=14, highlight=True,
       features=["API access"], limits={"projects": None, "api": True})
 .usage("api_call", "$0.002/call")
 .coupon("LAUNCH50", percent_off=50)
 .mount(app))

QuickstartGitHubAI course

Gate anything on the plan

if app.feature(req, "api"): ...
if not app.within_limit(req, "projects", count):
    return app.money.require(req, "plan:pro")   # nudge to upgrade

Change a price or a limit in one place and the pricing page, checkout and feature gates all follow. Larz serves a styled /larz/pricing page and per-plan /larz/subscribe/<plan> checkout automatically.

FAQ

What does one Pricing object generate?

The /larz/pricing page, checkout links, plan entitlements, feature flags & limits, and the registered metered prices — all from one declaration.

Can I still use dynamic per-item prices?

Yes — pricing-as-code handles plans and packs, while app.money.require(req, sku, cents=...) covers dynamic catalog prices.