Skip to main content

Billing service library for API usage tracking and Stripe integration.

Project description

Augint Billing Library

Billing service library for API usage tracking, tiered pricing calculations, and Stripe integration.

Overview

This library provides the core business logic for:

  • Tracking API usage per customer
  • Calculating charges with tiered pricing models
  • Managing Stripe customers and payments
  • Processing webhooks from Stripe
  • Generating usage and billing reports

CI Pipeline PyPI Python

Poetry Code style: black Linting: Ruff pre-commit Renovate

pytest GitHub Actions Semantic Release AWS SAM License: AGPL v3

📊 Live Dashboards

📖 Documentation 🧪 Unit Tests 🔬 Integration Tests 📊 Coverage Benchmarks 🔒 Security ⚖️ Compliance

🔑 Key Development Characteristics

Characteristic Details
Merge Strategy Configurable (see .env)
Deployment Model Tag-based to PyPI
Environments Local → PyPI
Preview Environments N/A (library)
Pipeline Features Semantic release, Auto-publish to PyPI
Special Considerations 90% coverage requirement, Mutation testing

Project Structure

augint-billing-lib-library/
├── src/
│   └── augint_billing_lib/      # Core library code (to be implemented)
├── tests/                   # Test suite (to be implemented)
├── examples/                # Original template code for reference
├── pyproject.toml          # Project dependencies and configuration
├── Makefile                # Development commands
└── README.md               # This file

Development Setup

# Install dependencies
make install

# Run tests
make test

# Check code quality
make lint
make type-check

# Generate documentation
make docs

Implementation Status

This is a minimal template ready for implementation. The following components need to be built:

Library Exports (from planning spec)

  • BillingService - Main service class
  • UsageCollector - Track API usage
  • PricingCalculator - Apply tiered pricing
  • StripeManager - Stripe operations
  • WebhookProcessor - Process Stripe webhooks
  • ReportGenerator - Generate reports
  • Data models (Customer, UsageRecord, BillingPeriod, etc.)

Key Features Removed (Minimal Version)

  • ✅ Feature flags removed
  • ✅ Telemetry/Sentry removed
  • ✅ Mutation testing removed
  • ✅ Complex CLI structures removed

Dependencies

Core dependencies:

  • click - CLI framework
  • boto3 - AWS SDK (to be added)
  • stripe - Stripe SDK (to be added)
  • pydantic - Data validation (to be added)

Testing

The project uses pytest with pragmatic coverage targets:

  • Library code: 70% coverage target
  • Focus on core business logic
  • Integration tests for AWS/Stripe interactions

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.1.4.tar.gz (78.2 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.1.4-py3-none-any.whl (83.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: augint_billing_lib-1.1.4.tar.gz
  • Upload date:
  • Size: 78.2 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.1.4.tar.gz
Algorithm Hash digest
SHA256 a7f0434075293bbc43a45869bfeb5e24ae340ea37a8c64f66c7156220b58137a
MD5 96a6acf602fa6186368950b07c385e04
BLAKE2b-256 f3f3748569bd5674b02426e1cb64931d248c5749a3ff6b6c5acf3a1111e3f22e

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for augint_billing_lib-1.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 9dfbf0c66986912f2588b7bce28a104e9c734740e41046e68f63dc7b21f63c82
MD5 57e627f4ee0cfc5eb6b80e22e3ef7055
BLAKE2b-256 7e4e6a412da6aa9d55826984a6b491de3c0625e6fd8e19493d9476a6aaec2ed5

See more details on using hashes here.

Provenance

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