Skip to content

Commit 5c8f90d

Browse files
v0.1.3
1 parent ff2f452 commit 5c8f90d

7 files changed

Lines changed: 59 additions & 46 deletions

File tree

CHANGELOG.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,23 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## [Unreleased]
99

10+
## [0.1.3] - 2026-01-30
11+
12+
### Fixed
13+
- README example: Use correct field names (`.merchants` not `.results`, `.products` not `.results`)
14+
- Examples: Fixed and uncommented `ucp_search.py` with correct field names
15+
16+
## [0.1.2] - 2026-01-30
17+
18+
### Fixed
19+
- UCP merchant search endpoint: Changed from `/ucp/v1/merchants/search` to `/ucp/v1/merchants` to match API
20+
21+
## [0.1.1] - 2026-01-30
22+
23+
### Fixed
24+
- GitHub workflow: Made Codecov upload optional (no longer fails if token is missing)
25+
- GitHub workflow: Removed Python 3.9 from test matrix (package requires >=3.10)
26+
1027
## [0.1.0] - 2026-01-29
1128

1229
Initial release.

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ async def main():
3333

3434
# Search UCP merchants
3535
merchants = await client.ucp.merchants.search(industry="retail")
36-
for merchant in merchants.results:
36+
for merchant in merchants.merchants:
3737
print(f"{merchant.name}: {merchant.domain}")
3838

3939
asyncio.run(main())

examples/ucp_search.py

Lines changed: 34 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,7 @@
99
import asyncio
1010
import os
1111

12-
# TODO: Uncomment after implementation
13-
# from rencom import AsyncRencomClient
12+
from rencom import AsyncRencomClient
1413

1514

1615
async def main():
@@ -20,42 +19,39 @@ async def main():
2019
print("Error: RENCOM_API_KEY environment variable not set")
2120
return
2221

23-
# TODO: Uncomment after implementation
24-
# async with AsyncRencomClient(api_key=api_key) as client:
25-
# # Search for retail merchants with checkout capability
26-
# print("Searching for retail merchants...")
27-
# merchants = await client.ucp.merchants.search(
28-
# capabilities=["dev.ucp.shopping.checkout"],
29-
# industry="retail",
30-
# limit=5
31-
# )
32-
#
33-
# print(f"\nFound {len(merchants.results)} merchants:")
34-
# for merchant in merchants.results:
35-
# print(f"\n{merchant.name} ({merchant.domain})")
36-
# print(f" Industry: {merchant.industry}")
37-
# print(f" Region: {merchant.region}")
38-
# print(f" Capabilities: {', '.join(merchant.capabilities)}")
39-
#
40-
# # Search for products
41-
# print("\n\nSearching for laptops under $1500...")
42-
# products = await client.ucp.products.search(
43-
# "laptop",
44-
# price_max=150000, # $1500 in cents
45-
# category="electronics",
46-
# condition="new",
47-
# limit=10
48-
# )
49-
#
50-
# print(f"\nFound {len(products.results)} products:")
51-
# for product in products.results:
52-
# price = product.price_cents / 100
53-
# print(f"\n{product.name}")
54-
# print(f" Price: ${price:.2f}")
55-
# print(f" Merchant: {product.merchant_domain}")
56-
# print(f" Brand: {product.brand}")
57-
58-
print("TODO: Implement after client is ready")
22+
async with AsyncRencomClient(api_key=api_key) as client:
23+
# Search for retail merchants with checkout capability
24+
print("Searching for retail merchants...")
25+
merchants = await client.ucp.merchants.search(
26+
capabilities=["dev.ucp.shopping.checkout"], industry="retail", limit=5
27+
)
28+
29+
print(f"\nFound {merchants.total} merchants (showing {len(merchants.merchants)}):")
30+
for merchant in merchants.merchants:
31+
print(f"\n{merchant.name} ({merchant.domain})")
32+
print(f" Industry: {merchant.industry}")
33+
print(f" Region: {merchant.region}")
34+
print(f" Capabilities: {', '.join(merchant.capabilities)}")
35+
36+
# Search for products
37+
print("\n\nSearching for laptops under $1500...")
38+
products = await client.ucp.products.search(
39+
"laptop",
40+
price_max=150000, # $1500 in cents
41+
category="electronics",
42+
condition="new",
43+
limit=10,
44+
)
45+
46+
print(f"\nFound {products.total} products (showing {len(products.products)}):")
47+
for product in products.products:
48+
if product.price:
49+
price = product.price.amount / 100
50+
print(f"\n{product.title}")
51+
print(f" Price: ${price:.2f}")
52+
print(f" Merchant: {product.merchant_domain}")
53+
if product.brand:
54+
print(f" Brand: {product.brand}")
5955

6056

6157
if __name__ == "__main__":

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
44

55
[project]
66
name = "rencom"
7-
version = "0.1.0"
7+
version = "0.1.3"
88
description = "Official Python SDK for the Rencom API - unified search for x402 resources and UCP merchants"
99
readme = "README.md"
1010
requires-python = ">=3.10"

rencom/ucp/merchants.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ async def search(
8484
params["session_id"] = session_id
8585

8686
# Make request
87-
response_data = await self._http.get("/ucp/v1/merchants/search", params=params)
87+
response_data = await self._http.get("/ucp/v1/merchants", params=params)
8888

8989
# Parse response
9090
return MerchantSearchResponse.model_validate(response_data)

tests/unit/test_ucp.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ async def test_search_basic(self):
4949
"search_log_id": 456,
5050
}
5151

52-
respx.get("https://api.test.com/ucp/v1/merchants/search").mock(
52+
respx.get("https://api.test.com/ucp/v1/merchants").mock(
5353
return_value=Response(200, json=response_data)
5454
)
5555

@@ -77,7 +77,7 @@ async def test_search_with_filters(self):
7777
"search_log_id": 456,
7878
}
7979

80-
route = respx.get("https://api.test.com/ucp/v1/merchants/search").mock(
80+
route = respx.get("https://api.test.com/ucp/v1/merchants").mock(
8181
return_value=Response(200, json=response_data)
8282
)
8383

@@ -192,7 +192,7 @@ async def test_search_iter(self):
192192
"search_log_id": 456,
193193
}
194194

195-
route = respx.get("https://api.test.com/ucp/v1/merchants/search")
195+
route = respx.get("https://api.test.com/ucp/v1/merchants")
196196
route.side_effect = [
197197
Response(200, json=page1),
198198
Response(200, json=page2),
@@ -435,7 +435,7 @@ async def test_namespace_via_main_client(self):
435435
"search_log_id": 456,
436436
}
437437

438-
respx.get("https://api.test.com/ucp/v1/merchants/search").mock(
438+
respx.get("https://api.test.com/ucp/v1/merchants").mock(
439439
return_value=Response(200, json=response_data)
440440
)
441441

uv.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)