MCPcopy Create free account
hub / github.com/Roy3838/Observer / sget

Function sget

api/orgs.py:101–114  ·  view source on GitHub ↗

Read a key from a Stripe object. stripe.StripeObject implements __getitem__ but not .get() — calling .get() on one raises AttributeError rather than returning a default. This works for both StripeObject and plain dicts.

(obj, key, default=None)

Source from the content-addressed store, hash-verified

99# --- Helpers ----------------------------------------------------------------
100
101def sget(obj, key, default=None):
102 """
103 Read a key from a Stripe object.
104
105 stripe.StripeObject implements __getitem__ but not .get() — calling .get()
106 on one raises AttributeError rather than returning a default. This works for
107 both StripeObject and plain dicts.
108 """
109 if obj is None:
110 return default
111 try:
112 return obj[key]
113 except (KeyError, TypeError, AttributeError, IndexError):
114 return default
115
116
117def _now_iso() -> str:

Callers 8

_list_personal_customersFunction · 0.90
partner_create_orgFunction · 0.90
_list_partner_dealsFunction · 0.90
_claw_back_partner_shareFunction · 0.90
sync_user_from_stripeFunction · 0.90
stripe_webhookFunction · 0.90
provision_orgFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected