Skip to main content

Billing service library for API usage tracking and Stripe integration.

Project description

augint-billing-lib (full library bundle)

One package (augint_billing_lib) + one CLI (augint). All runtime logic lives here; IaC should be thin shims.

What it contains

  • Core: BillingService with Stripe/DynamoDB/API Gateway usage orchestration
  • Adapters: Stripe, DynamoDB repo, API Gateway usage, API Gateway plan admin
  • Bootstrap: env + Secrets Manager wiring, CFN output discovery, plan move dispatcher
  • CLI: augint with env-dump, handle-event, sync-usage, promote, demote, and optional deploy/delete helpers

Env (uses your names; no new required keys)

Required: STACK_NAME, AWS_REGION, STRIPE_SECRET_KEY
Optional: API_USAGE_PRODUCT_ID, STRIPE_SECRET_ARN, TABLE_NAME, FREE_USAGE_PLAN_ID, METERED_USAGE_PLAN_ID

Typical local flows

# 0) Install deps in your Poetry project: click, python-dotenv, boto3, stripe
# 1) Show env the CLI sees
poetry run augint env-dump

# 2) Simulate a Stripe event (and move keys between FREE_10K/METERED inside AWS)
poetry run augint handle-event --file ./fixtures/setup_intent.succeeded.json

# 3) Report last hour usage to Stripe (test mode)
poetry run augint sync-usage

# 4) Promote/demote a key (Stripe side)
poetry run augint promote --api-key ABC123
poetry run augint demote --api-key ABC123

Deploy helpers (optional)

poetry run augint deploy --infra ../augint-billing-infra --params template-params.sample.json
poetry run augint delete

Wire the CLI

Add to your pyproject.toml:

[project.scripts]
augint = "augint_billing_lib.cli:cli"

Install: poetry install

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

augint_billing_lib-1.8.0.tar.gz (36.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

augint_billing_lib-1.8.0-py3-none-any.whl (38.1 kB view details)

Uploaded Python 3

File details

Details for the file augint_billing_lib-1.8.0.tar.gz.

File metadata

  • Download URL: augint_billing_lib-1.8.0.tar.gz
  • Upload date:
  • Size: 36.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for augint_billing_lib-1.8.0.tar.gz
Algorithm Hash digest
SHA256 2ed521c82d76be1ba2de30c1e55adc248d25f01c3650657b000f602332bc1a6e
MD5 8d7baba488b4678722344f1303954b18
BLAKE2b-256 b48a7935d63bbaa2b0009305815337b3de5753ca5e8ebee1be9868a03a5ce1a9

See more details on using hashes here.

Provenance

The following attestation bundles were made for augint_billing_lib-1.8.0.tar.gz:

Publisher: pipeline.yaml on svange/augint-billing-lib

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file augint_billing_lib-1.8.0-py3-none-any.whl.

File metadata

File hashes

Hashes for augint_billing_lib-1.8.0-py3-none-any.whl
Algorithm Hash digest
SHA256 040602f15429eb29ed8b22045d3e905b4a0cd2c68cc48e753dec844d63376375
MD5 fb05af39f1af0c3698e4de5ed45ead91
BLAKE2b-256 d4a23650914d1112004f595a3b67a834568ceba248f7fcf974d4fc39fde75c6d

See more details on using hashes here.

Provenance

The following attestation bundles were made for augint_billing_lib-1.8.0-py3-none-any.whl:

Publisher: pipeline.yaml on svange/augint-billing-lib

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page