fancy-stripe 0.1.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,24 @@
1
+ node_modules/
2
+ dist/
3
+ vendor/
4
+ .venv/
5
+ __pycache__/
6
+ *.egg-info/
7
+ .pytest_cache/
8
+ .ruff_cache/
9
+ .mypy_cache/
10
+
11
+ # Lockfiles are NOT source of a generated repo.
12
+ #
13
+ # The generator cannot emit one -- a lockfile is the result of a network
14
+ # resolve -- and "a provider repo must be generated and re-generatable" is the
15
+ # constraint the whole estate rests on. At a few hundred repos, a committed
16
+ # lockfile each is a few hundred files nothing can regenerate and a few hundred
17
+ # Dependabot surfaces.
18
+ #
19
+ # The trade is real and worth stating: CI resolves fresh on every run, so an
20
+ # upstream release inside the declared range can break a build with no change
21
+ # here. That is early warning rather than a surprise at publish time, and the
22
+ # ranges are deliberately narrow (>=X <2.0, never a caret on a 0.x).
23
+ composer.lock
24
+ package-lock.json
@@ -0,0 +1,55 @@
1
+ # Changelog — Stripe
2
+
3
+ All four packages — `@particle-academy/stripe-ui`, `@particle-academy/stripe-js`,
4
+ `particle-academy/stripe-php` and `fancy-stripe` — are released together under
5
+ one version. They are generated from one `provider/` definition, so a change to
6
+ it changes all four, and separate version lines would only record which of the
7
+ four somebody remembered to bump.
8
+
9
+ **Write entries HERE**, in the weaver envelope at `providers/stripe/CHANGELOG.md`,
10
+ then regenerate. This file is the one thing in a provider release that cannot be
11
+ derived from anything — but it is still propagated rather than hand-edited in the
12
+ provider repo, because a copy edited there is destroyed by the next protocol sync.
13
+
14
+ **A release with no entry is refused at tag time.** `publish.yml` checks before
15
+ it builds anything, so the failure costs seconds rather than a half-published
16
+ version across three registries — and once a tarball is on a registry, nobody who
17
+ upgraded into it can learn what changed.
18
+
19
+ ## [Unreleased]
20
+
21
+ ## [0.1.0] — 2026-08-20
22
+
23
+ First release. Ported from the vendored flow-node connector at
24
+ `px-ui-sandbox/resources/flow-nodes/_stripe`, which could not be upgraded once a
25
+ consumer had copied it — that is the whole reason these are packages.
26
+
27
+ ### Added
28
+
29
+ - **Three actions.** `payment_intent_create` (take a payment),
30
+ `refund_create` (refund one, in full or in part) and `customer_create`.
31
+ All three are `unsafe-to-replay` and send an `Idempotency-Key` derived from the
32
+ run and the step, so a retried durable run returns the original result instead
33
+ of charging twice.
34
+ - **A verified webhook trigger.** Stripe packs the timestamp inside the
35
+ signature header (`t=…,v1=…`), signs `{t}.{rawBody}` under HMAC-SHA256, and
36
+ allows a five-minute replay window. The body must be the bytes exactly as
37
+ received: re-serialised JSON fails identically to a wrong secret.
38
+ - **A faker for every action and the trigger**, so a node runs before you have
39
+ an account, a key or a network. The faked values are deterministic and
40
+ obviously synthetic, and `livemode` is always `false` — it is the field a
41
+ downstream branch reads before acting on money.
42
+ - **Four packages from one definition**: `-ui` (the authoring surface, React on
43
+ every host), `-js` (Node), `-php` (8.4+) and `fancy-stripe` (Python 3.11+,
44
+ zero runtime dependencies).
45
+
46
+ ### Notes
47
+
48
+ - **Stripe's test estate is selected by the KEY, not the URL.** `api.stripe.com`
49
+ serves both, so a live key on a node whose mode says "sandbox" reaches the real
50
+ ledger and succeeds. Nothing in the request distinguishes them, which is why
51
+ credentials sit on the connection rather than on each node. The `sandbox` kind
52
+ is `credential` for exactly this reason.
53
+ - **No Stripe SDK.** Plain HTTP: a vendor SDK is third-party code subject to the
54
+ kit's full approval bar, and one per provider is hundreds of dependencies
55
+ nobody is tracking.
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Particle Academy
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,73 @@
1
+ Metadata-Version: 2.5
2
+ Name: fancy-stripe
3
+ Version: 0.1.0
4
+ Summary: Stripe for Python — the service descriptor, its faker, its webhook verification, and one function per operation. Plain HTTP; no vendor SDK.
5
+ Project-URL: Homepage, https://github.com/Fancy-Friends/stripe
6
+ Project-URL: Issues, https://github.com/Fancy-Friends/stripe/issues
7
+ Project-URL: Source, https://github.com/Fancy-Friends/stripe
8
+ Author: Particle Academy
9
+ License-Expression: MIT
10
+ License-File: LICENSE
11
+ Keywords: api,connector,fancy-flow,particle-academy,payments,stripe
12
+ Classifier: Development Status :: 3 - Alpha
13
+ Classifier: Intended Audience :: Developers
14
+ Classifier: Programming Language :: Python :: 3
15
+ Classifier: Programming Language :: Python :: 3.11
16
+ Classifier: Programming Language :: Python :: 3.12
17
+ Classifier: Programming Language :: Python :: 3.13
18
+ Classifier: Topic :: Software Development :: Libraries
19
+ Classifier: Typing :: Typed
20
+ Requires-Python: >=3.11
21
+ Description-Content-Type: text/markdown
22
+
23
+ # Stripe
24
+
25
+ Stripe for [fancy-flow][flow] — as **four imported, versioned packages**, one
26
+ per runtime. Not vendored source: a copy cannot be upgraded, and third-party APIs
27
+ change.
28
+
29
+ [flow]: https://github.com/Particle-Academy/fancy-flow
30
+
31
+ | Runtime | Package | Install |
32
+ |---|---|---|
33
+ | Authoring surface (every host) | `@particle-academy/stripe-ui` | `npm install @particle-academy/stripe-ui` |
34
+ | Node | `@particle-academy/stripe-js` | `npm install @particle-academy/stripe-js` |
35
+ | PHP 8.4+ | `particle-academy/stripe-php` | `composer require particle-academy/stripe-php` |
36
+ | Python 3.11+ | `fancy-stripe` | `pip install fancy-stripe` |
37
+
38
+ The `ui` package is the editor surface and is React on every host — a PHP or
39
+ Python project installs it *and* its own runtime package, and never the `js` one.
40
+
41
+ ## What it costs you
42
+
43
+ One dependency: `@particle-academy/fancy-connector-core` (or
44
+ `particle-academy/fancy-connector-core` on Composer), which the `js` and `php`
45
+ packages pull in themselves. The Python package has **zero** runtime
46
+ dependencies.
47
+
48
+ **No Stripe SDK.** Plain HTTP, deliberately: a vendor SDK is third-party code
49
+ subject to the kit's full approval bar, and one per provider is hundreds of
50
+ dependencies nobody is tracking.
51
+
52
+ ## Run it before you have credentials
53
+
54
+ Every operation ships a **faker**, whether or not Stripe has a sandbox. Set a
55
+ node's mode to `fake` and it returns the shape Stripe actually publishes — the
56
+ same field names, deterministically — so you can wire the downstream nodes before
57
+ touching an account, a key, or a network.
58
+
59
+ ## This repository is generated
60
+
61
+ `provider/` is the source. Everything under `packages/` is emitted from it and
62
+ **must not be hand-edited** — CI regenerates and diffs on every push, and the
63
+ next protocol sync destroys anything it finds. See [`AGENTS.md`](AGENTS.md).
64
+
65
+ ## Two namespaces, which do not match on purpose
66
+
67
+ The repo is `github.com/Fancy-Friends/stripe`; the packages publish under
68
+ `particle-academy`. Nothing derives one from the other — the names come from
69
+ weaver's `friends.json` and nowhere else.
70
+
71
+ ## Licence
72
+
73
+ MIT.
@@ -0,0 +1,51 @@
1
+ # Stripe
2
+
3
+ Stripe for [fancy-flow][flow] — as **four imported, versioned packages**, one
4
+ per runtime. Not vendored source: a copy cannot be upgraded, and third-party APIs
5
+ change.
6
+
7
+ [flow]: https://github.com/Particle-Academy/fancy-flow
8
+
9
+ | Runtime | Package | Install |
10
+ |---|---|---|
11
+ | Authoring surface (every host) | `@particle-academy/stripe-ui` | `npm install @particle-academy/stripe-ui` |
12
+ | Node | `@particle-academy/stripe-js` | `npm install @particle-academy/stripe-js` |
13
+ | PHP 8.4+ | `particle-academy/stripe-php` | `composer require particle-academy/stripe-php` |
14
+ | Python 3.11+ | `fancy-stripe` | `pip install fancy-stripe` |
15
+
16
+ The `ui` package is the editor surface and is React on every host — a PHP or
17
+ Python project installs it *and* its own runtime package, and never the `js` one.
18
+
19
+ ## What it costs you
20
+
21
+ One dependency: `@particle-academy/fancy-connector-core` (or
22
+ `particle-academy/fancy-connector-core` on Composer), which the `js` and `php`
23
+ packages pull in themselves. The Python package has **zero** runtime
24
+ dependencies.
25
+
26
+ **No Stripe SDK.** Plain HTTP, deliberately: a vendor SDK is third-party code
27
+ subject to the kit's full approval bar, and one per provider is hundreds of
28
+ dependencies nobody is tracking.
29
+
30
+ ## Run it before you have credentials
31
+
32
+ Every operation ships a **faker**, whether or not Stripe has a sandbox. Set a
33
+ node's mode to `fake` and it returns the shape Stripe actually publishes — the
34
+ same field names, deterministically — so you can wire the downstream nodes before
35
+ touching an account, a key, or a network.
36
+
37
+ ## This repository is generated
38
+
39
+ `provider/` is the source. Everything under `packages/` is emitted from it and
40
+ **must not be hand-edited** — CI regenerates and diffs on every push, and the
41
+ next protocol sync destroys anything it finds. See [`AGENTS.md`](AGENTS.md).
42
+
43
+ ## Two namespaces, which do not match on purpose
44
+
45
+ The repo is `github.com/Fancy-Friends/stripe`; the packages publish under
46
+ `particle-academy`. Nothing derives one from the other — the names come from
47
+ weaver's `friends.json` and nowhere else.
48
+
49
+ ## Licence
50
+
51
+ MIT.
@@ -0,0 +1,87 @@
1
+ [build-system]
2
+ requires = ["hatchling>=1.27"]
3
+ build-backend = "hatchling.build"
4
+
5
+ [project]
6
+ name = "fancy-stripe"
7
+ version = "0.1.0"
8
+ description = "Stripe for Python — the service descriptor, its faker, its webhook verification, and one function per operation. Plain HTTP; no vendor SDK."
9
+ readme = "README.md"
10
+ # 3.11 matches fancy-flow-py's floor: 3.10 reaches end of life on 2026-10-31,
11
+ # and a floor that dies before the package's second release is not a floor.
12
+ requires-python = ">=3.11"
13
+ license = "MIT"
14
+ license-files = ["LICENSE"]
15
+ authors = [{ name = "Particle Academy" }]
16
+ keywords = ["stripe", "payments", "connector", "api", "fancy-flow", "particle-academy"]
17
+ classifiers = [
18
+ "Development Status :: 3 - Alpha",
19
+ "Intended Audience :: Developers",
20
+ "Programming Language :: Python :: 3",
21
+ "Programming Language :: Python :: 3.11",
22
+ "Programming Language :: Python :: 3.12",
23
+ "Programming Language :: Python :: 3.13",
24
+ "Topic :: Software Development :: Libraries",
25
+ "Typing :: Typed",
26
+ ]
27
+
28
+ # ZERO runtime dependencies, and that is a design constraint rather than an
29
+ # accident. There is no Python twin of fancy-connector-core to depend on, and a
30
+ # vendor SDK is third-party code subject to the kit's full approval bar — one
31
+ # SDK per provider is hundreds of dependencies nobody is tracking. The HTTP is
32
+ # stdlib `urllib`; the HMAC is stdlib `hmac`.
33
+ dependencies = []
34
+
35
+ [project.urls]
36
+ Homepage = "https://github.com/Fancy-Friends/stripe"
37
+ Issues = "https://github.com/Fancy-Friends/stripe/issues"
38
+ Source = "https://github.com/Fancy-Friends/stripe"
39
+
40
+ [dependency-groups]
41
+ # Not optional. A package with no way to run its tests reports green by doing
42
+ # nothing, which is the one defect that hides itself.
43
+ test = ["pytest>=8.0"]
44
+ lint = ["ruff>=0.16"]
45
+ typecheck = ["mypy>=1.11"]
46
+ dev = [{ include-group = "test" }, { include-group = "lint" }, { include-group = "typecheck" }]
47
+
48
+ [tool.hatch.build.targets.wheel]
49
+ packages = ["src/fancy_stripe"]
50
+
51
+ [tool.hatch.build.targets.sdist]
52
+ include = ["/src", "/tests", "/README.md", "/CHANGELOG.md", "/LICENSE"]
53
+
54
+ [tool.pytest.ini_options]
55
+ testpaths = ["tests"]
56
+ # importlib mode pairs with src-layout: the working tree is never on sys.path,
57
+ # so the tests exercise the INSTALLED package. Under the default mode a missing
58
+ # py.typed or an unshipped file passes locally and breaks for every user.
59
+ addopts = "--import-mode=importlib -ra"
60
+
61
+ [tool.ruff]
62
+ line-length = 100
63
+ src = ["src", "tests"]
64
+ target-version = "py311"
65
+
66
+ [tool.ruff.lint]
67
+ # `S` — flake8-bandit — is ON, and it is the one addition worth arguing for: this
68
+ # package handles a credential, builds an HMAC, and opens a URL. Security lint
69
+ # belongs on exactly this code.
70
+ #
71
+ # It also makes the two `# noqa: S310` in _runtime.py MEANINGFUL. Without `S`
72
+ # selected, ruff reports them as unused directives (RUF100) and the obvious fix
73
+ # is to delete them — which quietly removes a security annotation because a
74
+ # linter was not looking for it.
75
+ select = ["E", "F", "I", "UP", "B", "SIM", "RUF", "N", "C4", "PT", "S"]
76
+
77
+ [tool.ruff.lint.per-file-ignores]
78
+ # pytest's whole idiom is bare `assert`. S101 would fail every test file.
79
+ "tests/*" = ["S101"]
80
+
81
+ [tool.mypy]
82
+ python_version = "3.11"
83
+ packages = ["fancy_stripe"]
84
+ mypy_path = "src"
85
+ strict = true
86
+ disallow_any_expr = false
87
+ disallow_any_explicit = false
@@ -0,0 +1,43 @@
1
+ # GENERATED FILE — do not edit.
2
+ #
3
+ # Emitted from provider/manifest.json by weaver's generator.
4
+ # A hand-edit here is destroyed by the next protocol sync, which is worse than
5
+ # being rejected, because it works until it silently does not. Fix
6
+ # provider/manifest.json (or weaver's template/) and regenerate:
7
+ #
8
+ # npm run provider -- stripe
9
+
10
+ """Stripe for Python.
11
+
12
+ The service descriptor, its faker, its delivery contract, and one function
13
+ per operation — plain HTTP on the stdlib, no vendor SDK and no runtime
14
+ dependency.
15
+ """
16
+
17
+ from __future__ import annotations
18
+
19
+ from ._fake import FakeValues
20
+ from .actions.customer_create import customer_create
21
+ from .actions.payment_intent_create import payment_intent_create
22
+ from .actions.refund_create import refund_create
23
+ from .faker import respond
24
+ from .service import BASE_URLS, CONNECTOR_API_VERSION, REQUIRES, SANDBOX, SERVICE, TITLE, descriptor
25
+ from .triggers import webhook
26
+
27
+ __version__ = "0.1.0"
28
+
29
+ __all__ = [
30
+ "BASE_URLS",
31
+ "CONNECTOR_API_VERSION",
32
+ "REQUIRES",
33
+ "SANDBOX",
34
+ "SERVICE",
35
+ "TITLE",
36
+ "FakeValues",
37
+ "customer_create",
38
+ "descriptor",
39
+ "payment_intent_create",
40
+ "refund_create",
41
+ "respond",
42
+ "webhook",
43
+ ]
@@ -0,0 +1,170 @@
1
+ # GENERATED FILE — do not edit.
2
+ #
3
+ # Emitted from provider/manifest.json (via weaver's
4
+ # template/embed/py/_fake.py) by weaver's generator.
5
+ # A hand-edit here is destroyed by the next protocol sync, which is worse than
6
+ # being rejected, because it works until it silently does not. Fix
7
+ # provider/manifest.json (via weaver's template/embed/py/_fake.py) (or
8
+ # weaver's template/) and regenerate:
9
+ #
10
+ # npm run provider -- stripe
11
+
12
+ """Deterministic faker values — bit-for-bit with TypeScript and PHP.
13
+
14
+ PROVENANCE — read before editing.
15
+
16
+ This is the SINGLE SOURCE for the Python faker helpers. It exists because
17
+ ``fancy-connector-core`` has a TypeScript implementation and a PHP twin and
18
+ **no Python twin at all**, so a generated ``fancy-<provider>`` package has no
19
+ shared runtime to import. Every generated package carries a copy emitted from
20
+ this file, and ``new-provider.mjs --check`` fails CI when a copy differs.
21
+
22
+ The permanent fix is a Python ``fancy-connector-core``. When it exists, this
23
+ file becomes a re-export and every provider picks it up on the next protocol
24
+ sync.
25
+
26
+ ## Bit-for-bit identical is the whole point
27
+
28
+ Not "similar": the same FNV-1a seed and the same xorshift32 sequence, so a
29
+ golden fixture asserts the exact faked payload and ALL THREE runtimes have to
30
+ produce it. That turns the faker into a parity test rather than a convenience —
31
+ which matters, because cross-runtime drift does not fail loudly. It completes,
32
+ down one path, with no error.
33
+
34
+ Python integers are unbounded, so every 32-bit operation is masked back into
35
+ range. Dropping one of those masks does not break anything visibly; it just
36
+ makes the runtimes diverge after a few hundred calls, which is the worst
37
+ possible way for this to fail.
38
+
39
+ ## Deterministic, and obviously fake
40
+
41
+ Same inputs, same output — always. A faker returning a fresh uuid every call
42
+ cannot be asserted on, so its fixtures degrade to "it did not throw", which is
43
+ the assertion that catches nothing. And the values are obviously synthetic ON
44
+ PURPOSE — ``fake_``-prefixed ids, ``example.test`` hosts, round numbers. Nobody
45
+ should ever look at a faked result and wonder whether it moved real money.
46
+ """
47
+
48
+ from __future__ import annotations
49
+
50
+ import json
51
+ from datetime import UTC, datetime, timedelta
52
+ from typing import Any
53
+
54
+ MASK = 0xFFFFFFFF
55
+
56
+ # `FakeValues.int` is part of the cross-runtime faker API — `fake.int(min, max)`
57
+ # in TypeScript, PHP and here — so the method keeps that name. Inside the class
58
+ # body it then shadows the builtin, and every LATER annotation reading `int`
59
+ # resolves to the method instead of the type. This alias is what the annotations
60
+ # after it use.
61
+ _Int = int
62
+
63
+ #: The instant every faker counts from. A constant rather than the clock,
64
+ #: because a fixture asserting on ``created`` must not start failing tomorrow.
65
+ FAKE_EPOCH = "2026-01-01T00:00:00.000Z"
66
+
67
+ _FNV_OFFSET = 0x811C9DC5
68
+ _FNV_PRIME = 0x01000193
69
+
70
+
71
+ def _stable_json(value: Any) -> str:
72
+ """Render a value the way ``JSON.stringify`` would, with sorted object keys.
73
+
74
+ Key order must not change a seed. ``json.dumps`` preserves insertion order,
75
+ so ``{a, b}`` and ``{b, a}`` would hash differently and "same inputs, same
76
+ output" would hold only for dicts that happened to be built in the same
77
+ order — the kind of almost-true that survives review and fails in a fixture
78
+ months later.
79
+ """
80
+ if isinstance(value, dict):
81
+ parts = [
82
+ f"{json.dumps(str(key))}:{_stable_json(item)}"
83
+ for key, item in sorted(value.items(), key=lambda pair: str(pair[0]))
84
+ if item is not ...
85
+ ]
86
+ return "{" + ",".join(parts) + "}"
87
+
88
+ if isinstance(value, (list, tuple)):
89
+ return "[" + ",".join(_stable_json(item) for item in value) + "]"
90
+
91
+ # `separators` matters: JavaScript emits no spaces, and a space here would
92
+ # change every seed.
93
+ return json.dumps(value, separators=(",", ":"), ensure_ascii=False)
94
+
95
+
96
+ def seed_from(*parts: Any) -> int:
97
+ """FNV-1a over the stable rendering of the parts. Twin of ``seedFrom``."""
98
+ text = "|".join(part if isinstance(part, str) else _stable_json(part) for part in parts)
99
+
100
+ hash_ = _FNV_OFFSET
101
+ # JavaScript hashes UTF-16 code units, so a character outside the BMP
102
+ # contributes two of them. Encoding to UTF-16-LE and reading pairs is what
103
+ # keeps a provider name with an emoji in it seeding identically.
104
+ for unit in _utf16_units(text):
105
+ hash_ ^= unit
106
+ hash_ = (hash_ * _FNV_PRIME) & MASK
107
+
108
+ return hash_
109
+
110
+
111
+ def _utf16_units(text: str) -> list[int]:
112
+ raw = text.encode("utf-16-le")
113
+
114
+ return [raw[i] | (raw[i + 1] << 8) for i in range(0, len(raw), 2)]
115
+
116
+
117
+ def seed_for_call(service: str, operation: str, config: dict[str, Any] | None) -> int:
118
+ """The seed for one faked call: service, operation, and the caller's config."""
119
+ return seed_from(service, operation, config or {})
120
+
121
+
122
+ class FakeValues:
123
+ """Deterministic value helpers handed to a faker.
124
+
125
+ Small on purpose. A faker's job is to return the SHAPE the provider returns
126
+ — the field names a downstream node will reference — not to simulate the
127
+ provider's business logic.
128
+ """
129
+
130
+ def __init__(self, seed: int) -> None:
131
+ masked = seed & MASK
132
+ self._state = masked if masked != 0 else 0x9E3779B9
133
+
134
+ def _next(self) -> int:
135
+ """xorshift32, matching the JS generator step for step."""
136
+ state = self._state
137
+ state ^= (state << 13) & MASK
138
+ state &= MASK
139
+ state ^= state >> 17
140
+ state ^= (state << 5) & MASK
141
+ state &= MASK
142
+ self._state = state
143
+
144
+ return state
145
+
146
+ def hex(self, length: _Int) -> str:
147
+ """A stable lowercase hex string of ``length`` characters."""
148
+ out = ""
149
+ while len(out) < length:
150
+ out += format(self._next(), "08x")
151
+
152
+ return out[:length]
153
+
154
+ def id(self, prefix: str) -> str:
155
+ """A stable id with the provider's usual prefix: ``id("ch")`` -> ``ch_fake_1a2b3c``."""
156
+ return f"{prefix}_fake_{self.hex(12)}"
157
+
158
+ def int(self, minimum: int, maximum: int) -> int:
159
+ """A stable integer in ``[minimum, maximum]``."""
160
+ return minimum + (self._next() % max(1, maximum - minimum + 1))
161
+
162
+ def pick(self, options: list[Any]) -> Any:
163
+ """Pick a stable element of a list."""
164
+ return options[self._next() % len(options)]
165
+
166
+ def timestamp(self, offset_seconds: _Int = 0) -> str:
167
+ """A fixed ISO-8601 instant, offset by whole seconds. Never ``now()``."""
168
+ base = datetime(2026, 1, 1, tzinfo=UTC) + timedelta(seconds=offset_seconds)
169
+
170
+ return base.strftime("%Y-%m-%dT%H:%M:%S") + ".000Z"