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-2.0.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-2.0.0-py3-none-any.whl (38.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: augint_billing_lib-2.0.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-2.0.0.tar.gz
Algorithm Hash digest
SHA256 9c5a59cce2087ed16b76d7b6e09166f736da173eedcba5e08447cff776f3e182
MD5 8c4106daf338b5ef94637d4427695f2a
BLAKE2b-256 9dfabd396598d4ac473b572530a0ef35b2db52bb59b984ed619089e96366fb8b

See more details on using hashes here.

Provenance

The following attestation bundles were made for augint_billing_lib-2.0.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-2.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for augint_billing_lib-2.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 62f79d80ffeca831adfd3032306d1b051db2e8e4f84f7e4d74c57fb38a216c89
MD5 7b9438668211e321679a8174304ec037
BLAKE2b-256 ad77cb5b628b7c63b5c0716c83ea4bebb234626ce2c03654e0a9ef91d3bd5c61

See more details on using hashes here.

Provenance

The following attestation bundles were made for augint_billing_lib-2.0.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