Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

Swarmauri Logo

PyPI - Downloads Hits PyPI - Python Version PyPI - License PyPI - swarmauri_billing_mock Discord

Swarmauri Billing Mock

swarmauri_billing_mock provides a deterministic in-memory billing provider for Swarmauri test suites, examples, and provider contract checks. It implements the full Swarmauri billing surface without network calls so applications can exercise products, prices, checkout, payments, subscriptions, invoices, refunds, customers, payment methods, payouts, transfers, reports, webhooks, coupons, and promotions through one predictable provider.

Why Swarmauri Billing Mock?

Use this package when billing code needs repeatable behavior without a real payment processor. It is useful for unit tests, documentation examples, local development, and compatibility checks for code that targets BillingProviderBase and the Swarmauri billing mixins.

FAQ

Q: Does this package call a live billing API?

A: No. The mock provider is intentionally local and deterministic. It returns Swarmauri-shaped billing payloads and never reaches external payment networks.

Q: Which billing capabilities does it advertise?

A: It advertises every Swarmauri billing capability through ALL_CAPABILITIES, including checkout, online payments, subscriptions, invoices, marketplace splits, refunds, customers, payment methods, payouts, balance transfers, reports, webhooks, coupons, and promotions.

Q: When should I use it instead of a real provider?

A: Use it in tests, examples, local workflows, and provider-neutral integration checks. Use Stripe, PayPal, Square, Braintree, Adyen, Authorize.Net, Paystack, or Razorpay packages when code needs a live provider API.

Features

  • Implements all billing mixins with predictable outputs.
  • Provides fast billing feedback without network calls.
  • Supports tests that need all Swarmauri billing capabilities available.
  • Demonstrates how to subclass BillingProviderBase for custom billing flows.
  • Supports Python 3.10, 3.11, 3.12, 3.13, and 3.14.

Installation

Install with uv:

uv add swarmauri_billing_mock

Install with pip:

pip install swarmauri_billing_mock

Usage

from swarmauri_billing_mock import MockBillingProvider
from swarmauri_base.billing import ProductSpec

provider = MockBillingProvider(api_key="mock-key")
product = provider.create_product(
    ProductSpec(payload={"name": "Test"}),
    idempotency_key="mock-prod-1",
)

print(product.raw)

Capability Mapping

The mock provider advertises every Capability and therefore maps to the entire set of tigrbl_billing capabilities when using capabilities_to_tigrbl.

Billing provider packages:

Foundational packages:

  • swarmauri_core defines billing capabilities and interfaces.
  • swarmauri_base provides billing specs, refs, mixins, and BillingProviderBase.
  • swarmauri provides namespace imports and plugin discovery.

License

Apache-2.0

Contributing

Need additional fixtures? Contributions that expand deterministic behavior are encouraged.

Metadata

Release files for swarmauri_billing_mock 0.11.0.dev2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for swarmauri_billing_mock 0.11.0.dev2
File Size Uploaded
swarmauri_billing_mock-0.11.0.dev2.tar.gz 8.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for swarmauri_billing_mock 0.11.0.dev2
File Interpreter ABI Platform
swarmauri_billing_mock-0.11.0.dev2-py3-none-any.whl Python 3 none any Details

Total release size: 18.6 kB

Release files / swarmauri_billing_mock-0.11.0.dev2.tar.gz

Download URL swarmauri_billing_mock-0.11.0.dev2.tar.gz
Size 8.9 kB
Tags Source
SHA-256 checksum
How to use checksums
7d12909d60858698d59aa47e586418d8d12da23c0769d7c96d4039f9f0967cd7
BLAKE2b-256 checksum
How to use checksums
426c6338779c4b824d2f59616226ee91f92eddb4ce7329d5ddd8ead99c58f09f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.11.26 {"installer":{"name":"uv","version":"0.11.26","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / swarmauri_billing_mock-0.11.0.dev2-py3-none-any.whl

Download URL swarmauri_billing_mock-0.11.0.dev2-py3-none-any.whl
Size 9.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
83e30f10908e89435502b6a9eeb6b7cf1959aade9fb28fffaa4efd3a510ca4f2
BLAKE2b-256 checksum
How to use checksums
1d5835fac30f75aa1c7265909b23c39e4f1cc3edd4ba163dcce7ddd2c96b9224
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.11.26 {"installer":{"name":"uv","version":"0.11.26","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release history Release notifications | RSS feed

This release

0.11.0.dev2 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page