Skip to main content

beangulp importer for Stripe balance transactions, with a thin API client: idempotent drafts via balance-transaction ids, minor-unit conversion, fee splitting, balance-snapshot assertions

Project description

beangulp-stripe

beangulp importer for Stripe balance transactions, plus a thin API client. Entity-agnostic: account names, the fee account, and payee rules are all constructor arguments.

Input

A JSON file of /v1/balance_transactions data — the raw Stripe list response, a bare array, or a wrapper:

{
  "account": {"id": "acct_..."},
  "balance": {"as_of": "2026-07-10", "available": [...], "pending": [...]},
  "data": [{"object": "balance_transaction", "id": "txn_...", ...}]
}

Behaviour

  • stripe_id: metadata (the txn_... id) is the idempotency key — re-imports skip ids already in the ledger.
  • Minor units are converted per currency (zero- and three-decimal currencies included).
  • Cash leg books the net; a per-transaction fee is split out to the fees account so the counter leg is the gross.
  • stripe_fee transactions (monthly-billed fees debited from the balance) go straight to the fees account, review-flagged: the monthly tax invoice drives the VAT split at review.
  • payee_rules (regex, account, flag) draft other counter legs; unmatched drafts stay !-flagged with the cash leg only.
  • A balance snapshot becomes per-currency balance assertions dated the day after as_of.

Client

from beangulp_stripe import StripeClient

client = StripeClient("rk_live_...")   # restricted key, read-only scopes
txns = client.balance_transactions(created_gte, created_lte)
snapshot = client.balance()

Use a restricted API key with Balance transaction sources: Read and Charges: Read (for expand[]=data.source payee names). No write scopes.

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

beangulp_stripe-0.1.1.tar.gz (16.1 kB view details)

Uploaded Source

Built Distribution

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

beangulp_stripe-0.1.1-py3-none-any.whl (14.5 kB view details)

Uploaded Python 3

File details

Details for the file beangulp_stripe-0.1.1.tar.gz.

File metadata

  • Download URL: beangulp_stripe-0.1.1.tar.gz
  • Upload date:
  • Size: 16.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.14

File hashes

Hashes for beangulp_stripe-0.1.1.tar.gz
Algorithm Hash digest
SHA256 2365f1ee62f3dd80ccabc7193a3c1e38ac74ef58c8851a32fe39c4e657ea6235
MD5 b70170d5140c1425bbb25b1761a65f65
BLAKE2b-256 24418fed48f13de17743097fffbae774bfeeb4e647234f50de13fa33bdba36a4

See more details on using hashes here.

Provenance

The following attestation bundles were made for beangulp_stripe-0.1.1.tar.gz:

Publisher: publish.yaml on sealambda/quints

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

File details

Details for the file beangulp_stripe-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: beangulp_stripe-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 14.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.14

File hashes

Hashes for beangulp_stripe-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 aee3bff3da9550979b2006f14098afb0e4d9a4ab46c324903739b5f2a3c09050
MD5 daef9ca81553c0a74c935855582da7f6
BLAKE2b-256 ca8fe263e642378d5e73a73316bf1da563d9999b2f1af45f12a76f67bcbd5b05

See more details on using hashes here.

Provenance

The following attestation bundles were made for beangulp_stripe-0.1.1-py3-none-any.whl:

Publisher: publish.yaml on sealambda/quints

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