s3dol.recipes¶
Layer C — the one-liner factory and codec facades. Composition ONLY.
If a recipe cannot be expressed as Layer B + dol wrappers, that is evidence
the capability belongs in Layer B as a parameter — this module never grows a
class statement (ADR-0001; the rule that keeps per-vendor classes from
reappearing).
The one-liner:
s = s3dol.s3_store('my-bucket') # zero ceremony
s = s3dol.s3_store('my-bucket', prefix='logs/') # scoped
s = s3dol.s3_store('pub-bucket', anon=True) # public data
With on_missing_bucket='assume' (the default; no probe, ever — ADR-0010)
the two-line quickstart raises on a bucket that does not exist yet; start from
nothing with on_missing_bucket='create'.
Functions
|
One bucket as a |
- s3dol.recipes.s3_store(bucket, *, prefix='', preset=None, connection=None, endpoint_url=None, region_name=None, profile=None, credentials=None, anon=False, on_missing_bucket='assume', readonly=False, value_codec=None, reads=None, writes=None)[source]¶
One bucket as a
MutableMapping[str, bytes](aMappingwhenreadonly=True).Annotated (deliberately) as the abstract Mapping, not
-> BucketStore: withvalue_codecthe concrete type is a generateddolwrapper class that is not aBucketStoresubclass. (v0 annotated its factory-> Storeand returned something that was not one; inverting that lie is not an improvement — architecture.md.)Connection axes (
preset/endpoint_url/region_name/profile/credentials/anon) are conveniences that build anS3Connection; passconnection=instead for full control (they are mutually exclusive with it).