vatly-fluent-python 0.1.0a3__tar.gz → 0.1.0a4__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.
Files changed (33) hide show
  1. {vatly_fluent_python-0.1.0a3 → vatly_fluent_python-0.1.0a4}/CHANGELOG.md +14 -0
  2. {vatly_fluent_python-0.1.0a3 → vatly_fluent_python-0.1.0a4}/PKG-INFO +6 -4
  3. {vatly_fluent_python-0.1.0a3 → vatly_fluent_python-0.1.0a4}/README.md +4 -2
  4. {vatly_fluent_python-0.1.0a3 → vatly_fluent_python-0.1.0a4}/docs/Checkouts.md +5 -0
  5. {vatly_fluent_python-0.1.0a3 → vatly_fluent_python-0.1.0a4}/docs/Customers.md +2 -1
  6. {vatly_fluent_python-0.1.0a3 → vatly_fluent_python-0.1.0a4}/docs/Orders.md +1 -1
  7. {vatly_fluent_python-0.1.0a3 → vatly_fluent_python-0.1.0a4}/docs/README.md +5 -4
  8. {vatly_fluent_python-0.1.0a3 → vatly_fluent_python-0.1.0a4}/pyproject.toml +2 -2
  9. {vatly_fluent_python-0.1.0a3 → vatly_fluent_python-0.1.0a4}/src/vatly_fluent/__init__.py +1 -1
  10. {vatly_fluent_python-0.1.0a3 → vatly_fluent_python-0.1.0a4}/tests/test_fluent.py +19 -1
  11. {vatly_fluent_python-0.1.0a3 → vatly_fluent_python-0.1.0a4}/.gitignore +0 -0
  12. {vatly_fluent_python-0.1.0a3 → vatly_fluent_python-0.1.0a4}/LICENSE +0 -0
  13. {vatly_fluent_python-0.1.0a3 → vatly_fluent_python-0.1.0a4}/PORTING.md +0 -0
  14. {vatly_fluent_python-0.1.0a3 → vatly_fluent_python-0.1.0a4}/docs/Configuration.md +0 -0
  15. {vatly_fluent_python-0.1.0a3 → vatly_fluent_python-0.1.0a4}/docs/CoreConcepts.md +0 -0
  16. {vatly_fluent_python-0.1.0a3 → vatly_fluent_python-0.1.0a4}/docs/CustomerPortal.md +0 -0
  17. {vatly_fluent_python-0.1.0a3 → vatly_fluent_python-0.1.0a4}/docs/Development.md +0 -0
  18. {vatly_fluent_python-0.1.0a3 → vatly_fluent_python-0.1.0a4}/docs/Porting.md +0 -0
  19. {vatly_fluent_python-0.1.0a3 → vatly_fluent_python-0.1.0a4}/docs/Subscriptions.md +0 -0
  20. {vatly_fluent_python-0.1.0a3 → vatly_fluent_python-0.1.0a4}/docs/Testing.md +0 -0
  21. {vatly_fluent_python-0.1.0a3 → vatly_fluent_python-0.1.0a4}/docs/Webhooks.md +0 -0
  22. {vatly_fluent_python-0.1.0a3 → vatly_fluent_python-0.1.0a4}/examples/sqlite_driver.py +0 -0
  23. {vatly_fluent_python-0.1.0a3 → vatly_fluent_python-0.1.0a4}/scripts/check_package.py +0 -0
  24. {vatly_fluent_python-0.1.0a3 → vatly_fluent_python-0.1.0a4}/src/vatly_fluent/builders.py +0 -0
  25. {vatly_fluent_python-0.1.0a3 → vatly_fluent_python-0.1.0a4}/src/vatly_fluent/client.py +0 -0
  26. {vatly_fluent_python-0.1.0a3 → vatly_fluent_python-0.1.0a4}/src/vatly_fluent/contracts.py +0 -0
  27. {vatly_fluent_python-0.1.0a3 → vatly_fluent_python-0.1.0a4}/src/vatly_fluent/customers.py +0 -0
  28. {vatly_fluent_python-0.1.0a3 → vatly_fluent_python-0.1.0a4}/src/vatly_fluent/handles.py +0 -0
  29. {vatly_fluent_python-0.1.0a3 → vatly_fluent_python-0.1.0a4}/src/vatly_fluent/linkage.py +0 -0
  30. {vatly_fluent_python-0.1.0a3 → vatly_fluent_python-0.1.0a4}/src/vatly_fluent/py.typed +0 -0
  31. {vatly_fluent_python-0.1.0a3 → vatly_fluent_python-0.1.0a4}/src/vatly_fluent/webhooks.py +0 -0
  32. {vatly_fluent_python-0.1.0a3 → vatly_fluent_python-0.1.0a4}/tests/fixtures/resources.json +0 -0
  33. {vatly_fluent_python-0.1.0a3 → vatly_fluent_python-0.1.0a4}/tests/test_docs.py +0 -0
@@ -1,5 +1,19 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.1.0a4 — 2026-11-25
4
+
5
+ - Require `vatly-api-python==0.1.0a4`.
6
+ - Stored refunds and refund webhook snapshots carry `Refund.metadata` (None when
7
+ the refund was created without metadata).
8
+ - Checkout builders reject invalid metadata (non-string values, more than 50 keys,
9
+ keys over 40 or values over 500 characters) and `trialDays` below 1 with
10
+ `FluentError("Invalid checkout request")` before calling Vatly, instead of the
11
+ API's `VatlyValidationError`.
12
+ - Behaviour change from the SDK: dictionary bodies passed to customer and
13
+ subscription calls are validated before sending, so invalid input raises Pydantic's
14
+ `ValidationError` instead of `VatlyValidationError`. Fields the API schema does not
15
+ define are dropped, and `None` is sent only on nullable fields.
16
+
3
17
  ## 0.1.0a3 — 2026-11-13
4
18
 
5
19
  - Link initial orders to their subscriptions through
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: vatly-fluent-python
3
- Version: 0.1.0a3
3
+ Version: 0.1.0a4
4
4
  Summary: Framework-independent fluent billing integrations built on the Vatly Python SDK
5
5
  Project-URL: Homepage, https://github.com/vatly/vatly-fluent-python
6
6
  Project-URL: Documentation, https://docs.vatly.com
@@ -12,12 +12,12 @@ Classifier: Development Status :: 3 - Alpha
12
12
  Classifier: Programming Language :: Python :: 3
13
13
  Classifier: Typing :: Typed
14
14
  Requires-Python: >=3.10
15
- Requires-Dist: vatly-api-python==0.1.0a3
15
+ Requires-Dist: vatly-api-python==0.1.0a4
16
16
  Description-Content-Type: text/markdown
17
17
 
18
18
  # Vatly Fluent for Python
19
19
 
20
- > **Alpha — under active development. Every alpha release may include breaking changes. Pin exact versions during alpha.**
20
+ > **Alpha — under active development. Every alpha release may include breaking changes. Lock the version you install and review the release notes before upgrading.**
21
21
 
22
22
  Integrate billing with Vatly, the European Merchant of Record for AI, software and
23
23
  digital products, without tying your application to a framework or database.
@@ -29,9 +29,11 @@ transactions and jobs. Python 3.10+, fully typed, **async-first**.
29
29
  ## Install
30
30
 
31
31
  ```bash
32
- pip install vatly-fluent-python==0.1.0a2 vatly-api-python==0.1.0a2
32
+ pip install --pre vatly-fluent-python
33
33
  ```
34
34
 
35
+ `--pre` installs the latest alpha, including the matching `vatly-api-python` alpha.
36
+
35
37
  For development, run `.agents/setup` or `uv sync --locked`. Both development and
36
38
  package metadata use the exact SDK version from PyPI.
37
39
 
@@ -1,6 +1,6 @@
1
1
  # Vatly Fluent for Python
2
2
 
3
- > **Alpha — under active development. Every alpha release may include breaking changes. Pin exact versions during alpha.**
3
+ > **Alpha — under active development. Every alpha release may include breaking changes. Lock the version you install and review the release notes before upgrading.**
4
4
 
5
5
  Integrate billing with Vatly, the European Merchant of Record for AI, software and
6
6
  digital products, without tying your application to a framework or database.
@@ -12,9 +12,11 @@ transactions and jobs. Python 3.10+, fully typed, **async-first**.
12
12
  ## Install
13
13
 
14
14
  ```bash
15
- pip install vatly-fluent-python==0.1.0a2 vatly-api-python==0.1.0a2
15
+ pip install --pre vatly-fluent-python
16
16
  ```
17
17
 
18
+ `--pre` installs the latest alpha, including the matching `vatly-api-python` alpha.
19
+
18
20
  For development, run `.agents/setup` or `uv sync --locked`. Both development and
19
21
  package metadata use the exact SDK version from PyPI.
20
22
 
@@ -30,6 +30,11 @@ async def example(vatly: Vatly):
30
30
  The customer and entity must already be authorized. Omit the profile for a guest
31
31
  checkout. `.for_entity()` needs the checkout-record driver.
32
32
 
33
+ Metadata values must be strings, with at most 50 keys, keys up to 40 characters
34
+ and values up to 500. `create()` checks the request against the API schema and
35
+ raises `FluentError` before sending when it does not match. Fields the schema
36
+ does not define are dropped.
37
+
33
38
  ## Start a subscription with a trial
34
39
 
35
40
  ```python
@@ -48,7 +48,8 @@ async def example(vatly: Vatly):
48
48
 
49
49
  `model()`, `name()`, `email()` and `identity()` share a cached snapshot. `sync()`
50
50
  and `update()` refresh it. Name/email are not invoice address fields; use the
51
- [portal](CustomerPortal.md) for hosted billing management.
51
+ [portal](CustomerPortal.md) for hosted billing management. The SDK checks customer
52
+ bodies before sending; an invalid one raises Pydantic's `ValidationError`.
52
53
 
53
54
  | Lookup | Return |
54
55
  | --- | --- |
@@ -26,7 +26,7 @@ async def example(vatly: Vatly):
26
26
  | `lines` | OrderLine models |
27
27
  | `reversed_subtotal`, `refundable_subtotal` | `Decimal` in currency units |
28
28
  | `is_reversed`, `is_fully_reversed`, `is_partially_reversed` | Predicates derived from both totals |
29
- | `refunds`, `chargebacks` | Local stored records, or an empty list without repositories |
29
+ | `refunds`, `chargebacks` | Local stored records, or an empty list without repositories; a refund keeps the `metadata` it was created with, or None |
30
30
 
31
31
  `model()` and the derived fields share one lazy read; `sync()` refreshes it. Do not
32
32
  convert financial values to floats. Preserve each amount's currency from the SDK
@@ -4,15 +4,16 @@ Build checkout, customer and subscription flows without tying billing to a web
4
4
  framework. Fluent composes the async SDK and your storage driver. Vatly is the
5
5
  European Merchant of Record for AI, software and digital products.
6
6
 
7
- **Alpha — under active development. Every alpha release may include breaking changes. Pin exact versions during alpha.**
7
+ **Alpha — under active development. Every alpha release may include breaking changes. Lock the version you install and review the release notes before upgrading.**
8
8
 
9
9
  ## Install and create a checkout
10
10
 
11
11
  ```bash
12
- python -m pip install vatly-fluent-python==0.1.0a2
12
+ python -m pip install --pre vatly-fluent-python
13
13
  ```
14
14
 
15
- Python 3.10+ is required. This installs `vatly-api-python==0.1.0a2` too. Set
15
+ Python 3.10+ is required. `--pre` installs the latest alpha, including the
16
+ matching `vatly-api-python` alpha. Set
16
17
  `VATLY_API_KEY` on the server, then run this async function with your event loop.
17
18
 
18
19
  ```python
@@ -66,5 +67,5 @@ lifespan. IDs and billable entities must be authorized by your application.
66
67
  | [Development](Development.md) | Set up, test and build the package |
67
68
 
68
69
  [API reference](https://docs.vatly.com/api-reference) documents the underlying
69
- requests. These examples are executed with published `0.1.0a2` packages and local
70
+ requests. These examples are executed with the published packages and local
70
71
  fixtures; no real payments or account changes occur in documentation tests.
@@ -4,13 +4,13 @@ build-backend = "hatchling.build"
4
4
 
5
5
  [project]
6
6
  name = "vatly-fluent-python"
7
- version = "0.1.0a3"
7
+ version = "0.1.0a4"
8
8
  description = "Framework-independent fluent billing integrations built on the Vatly Python SDK"
9
9
  keywords = ["vatly", "merchant-of-record", "billing", "payments", "subscriptions", "vat", "ai"]
10
10
  requires-python = ">=3.10"
11
11
  readme = "README.md"
12
12
  license = "MIT"
13
- dependencies = ["vatly-api-python==0.1.0a3"]
13
+ dependencies = ["vatly-api-python==0.1.0a4"]
14
14
  classifiers = ["Development Status :: 3 - Alpha", "Typing :: Typed", "Programming Language :: Python :: 3"]
15
15
 
16
16
  [project.urls]
@@ -27,7 +27,7 @@ from .customers import CustomerHandle, CustomerService
27
27
  from .handles import OrderHandle, SubscriptionHandle
28
28
  from .webhooks import WebhookProcessor
29
29
 
30
- __version__ = "0.1.0a3"
30
+ __version__ = "0.1.0a4"
31
31
 
32
32
  __all__ = [
33
33
  "Vatly",
@@ -132,6 +132,18 @@ async def test_validation_fails_before_remote_call(harness):
132
132
  vatly.subscribe().in_live_mode()
133
133
  with pytest.raises(FluentError):
134
134
  await vatly.subscribe().create()
135
+ plan = {"id": "subscription_plan_a"}
136
+ for metadata in [
137
+ {"n": 1},
138
+ {f"k{i}": "v" for i in range(51)},
139
+ {"k" * 41: "v"},
140
+ {"k": "v" * 501},
141
+ ]:
142
+ with pytest.raises(FluentError, match="Invalid checkout request"):
143
+ await vatly.checkout_builder().with_items([plan]).with_metadata(metadata).create()
144
+ for item in [{**plan, "trialDays": 0}, {**plan, "metadata": {"n": 1}}]:
145
+ with pytest.raises(FluentError, match="Invalid checkout request"):
146
+ await vatly.checkout_builder().with_items([item]).create()
135
147
  vatly.wiring.checkouts = None
136
148
  with pytest.raises(FluentError):
137
149
  await vatly.subscribe().to_plan("subscription_plan_a").for_entity(TEAM).create()
@@ -284,12 +296,18 @@ async def test_financial_reversal_snapshots_persist_and_dispatch(harness, name,
284
296
  vatly, db, calls, responses = harness
285
297
  await db.checkouts.record(CheckoutRecord("checkout_a", TEAM, True))
286
298
  await db.checkouts.link("checkout_a", "order", "order_a")
287
- obj = resource(fixture, originalOrderId="order_a")
299
+ extra = {"metadata": {"ticket": "T-1"}} if fixture == "Refund" else {}
300
+ obj = resource(fixture, originalOrderId="order_a", **extra)
288
301
  assert await deliver(vatly, name, obj)
289
302
  repo = db.refunds if fixture == "Refund" else db.chargebacks
290
303
  saved = await repo.find_by_vatly_id(obj["id"])
291
304
  assert saved.entity == TEAM
292
305
  assert saved.resource.tax_summary
306
+ if fixture == "Refund":
307
+ assert saved.resource.metadata.root == {"ticket": "T-1"}
308
+ await deliver(vatly, name, {**obj, "metadata": {"ticket": "T-2"}}, id="event_again")
309
+ [updated] = await repo.list_for_order("order_a")
310
+ assert updated.resource.metadata.root == {"ticket": "T-2"}
293
311
  assert len(await repo.list_for_order("order_a")) == 1
294
312
  assert not calls
295
313