Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ docs/_build/

# PyBuilder
.pybuilder/
target/
/target/

# Jupyter Notebook
.ipynb_checkpoints
Expand Down
5 changes: 5 additions & 0 deletions src/scrapebadger/aliexpress/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
"""aliexpress API client."""

from scrapebadger.aliexpress.client import AliexpressClient

__all__ = ["AliexpressClient"]
158 changes: 158 additions & 0 deletions src/scrapebadger/aliexpress/client.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,158 @@
"""Aliexpress API client. # --- BEGIN generated by sdk/codegen/facade — do not edit ---"""

from __future__ import annotations

from typing import TYPE_CHECKING, Any

if TYPE_CHECKING:
from scrapebadger._internal.client import BaseClient


class AliexpressClient:
"""Client for all Aliexpress API operations. (Generated from the OpenAPI spec.)"""

def __init__(self, client: BaseClient) -> None:
self._client = client

async def get_search_suggestions(
self, *, query: str, country: str = "US", language: str = "en"
) -> dict[str, Any]:
"""Get search suggestions.

Generated from the OpenAPI spec; returns the raw response dict.
"""
params = {
k: v
for k, v in {"query": query, "country": country, "language": language}.items()
if v is not None
}
return await self._client.get("/v1/aliexpress/autocomplete", params=params)

async def get_category_navigation(self) -> dict[str, Any]:
"""Get category navigation.

Generated from the OpenAPI spec; returns the raw response dict.
"""
return await self._client.get("/v1/aliexpress/categories")

async def get_product_detail(
self,
product_id: str,
*,
country: str = "US",
currency: str = "USD",
language: str = "en_US",
) -> dict[str, Any]:
"""Get product detail.

Generated from the OpenAPI spec; returns the raw response dict.
"""
params = {
k: v
for k, v in {"country": country, "currency": currency, "language": language}.items()
if v is not None
}
return await self._client.get(f"/v1/aliexpress/products/{product_id}", params=params)

async def get_product_reviews(
self, product_id: str, *, page: int = 1, page_size: int = 10, sort: str = "complex_default"
) -> dict[str, Any]:
"""Get product reviews.

Generated from the OpenAPI spec; returns the raw response dict.
"""
params = {
k: v
for k, v in {"page": page, "page_size": page_size, "sort": sort}.items()
if v is not None
}
return await self._client.get(
f"/v1/aliexpress/products/{product_id}/reviews", params=params
)

async def search_products(
self,
*,
query: str,
page: int = 1,
country: str = "US",
currency: str = "USD",
language: str = "en",
sort: str = "default",
min_price: str | None = None,
max_price: str | None = None,
) -> dict[str, Any]:
"""Search products.

Generated from the OpenAPI spec; returns the raw response dict.
"""
params = {
k: v
for k, v in {
"query": query,
"page": page,
"country": country,
"currency": currency,
"language": language,
"sort": sort,
"min_price": min_price,
"max_price": max_price,
}.items()
if v is not None
}
return await self._client.get("/v1/aliexpress/search", params=params)

async def get_store_profile(
self, store_id: str, *, country: str = "US", currency: str = "USD", language: str = "en"
) -> dict[str, Any]:
"""Get store profile.

Generated from the OpenAPI spec; returns the raw response dict.
"""
params = {
k: v
for k, v in {"country": country, "currency": currency, "language": language}.items()
if v is not None
}
return await self._client.get(f"/v1/aliexpress/stores/{store_id}", params=params)

async def get_store_product_categories(
self, store_id: str, *, country: str = "US"
) -> dict[str, Any]:
"""Get store product categories.

Generated from the OpenAPI spec; returns the raw response dict.
"""
params = {k: v for k, v in {"country": country}.items() if v is not None}
return await self._client.get(f"/v1/aliexpress/stores/{store_id}/categories", params=params)

async def get_store_products(
self,
store_id: str,
*,
page: int = 1,
page_size: int = 24,
country: str = "US",
currency: str = "USD",
language: str = "en",
query: str = "",
sort: str = "bestmatch_sort",
) -> dict[str, Any]:
"""Get store products.

Generated from the OpenAPI spec; returns the raw response dict.
"""
params = {
k: v
for k, v in {
"page": page,
"page_size": page_size,
"country": country,
"currency": currency,
"language": language,
"query": query,
"sort": sort,
}.items()
if v is not None
}
return await self._client.get(f"/v1/aliexpress/stores/{store_id}/products", params=params)
5 changes: 5 additions & 0 deletions src/scrapebadger/asos/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
"""asos API client."""

from scrapebadger.asos.client import AsosClient

__all__ = ["AsosClient"]
209 changes: 209 additions & 0 deletions src/scrapebadger/asos/client.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,209 @@
"""Asos API client. # --- BEGIN generated by sdk/codegen/facade — do not edit ---"""

from __future__ import annotations

from typing import TYPE_CHECKING, Any

if TYPE_CHECKING:
from scrapebadger._internal.client import BaseClient


class AsosClient:
"""Client for all Asos API operations. (Generated from the OpenAPI spec.)"""

def __init__(self, client: BaseClient) -> None:
self._client = client

async def search_suggestions(
self,
*,
query: str,
market: str = "uk",
store: str | None = None,
country: str | None = None,
currency: str | None = None,
language: str | None = None,
) -> dict[str, Any]:
"""Search suggestions.

Generated from the OpenAPI spec; returns the raw response dict.
"""
params = {
k: v
for k, v in {
"query": query,
"market": market,
"store": store,
"country": country,
"currency": currency,
"language": language,
}.items()
if v is not None
}
return await self._client.get("/v1/asos/autocomplete", params=params)

async def list_categories(
self,
*,
gender: str = "men",
market: str = "uk",
store: str | None = None,
country: str | None = None,
currency: str | None = None,
language: str | None = None,
) -> dict[str, Any]:
"""List categories.

Generated from the OpenAPI spec; returns the raw response dict.
"""
params = {
k: v
for k, v in {
"gender": gender,
"market": market,
"store": store,
"country": country,
"currency": currency,
"language": language,
}.items()
if v is not None
}
return await self._client.get("/v1/asos/categories", params=params)

async def list_search_filters(
self,
*,
query: str | None = None,
category_id: str | None = None,
market: str = "uk",
store: str | None = None,
country: str | None = None,
currency: str | None = None,
language: str | None = None,
) -> dict[str, Any]:
"""List search filters.

Generated from the OpenAPI spec; returns the raw response dict.
"""
params = {
k: v
for k, v in {
"query": query,
"category_id": category_id,
"market": market,
"store": store,
"country": country,
"currency": currency,
"language": language,
}.items()
if v is not None
}
return await self._client.get("/v1/asos/filters", params=params)

async def list_markets(self) -> dict[str, Any]:
"""List markets.

Generated from the OpenAPI spec; returns the raw response dict.
"""
return await self._client.get("/v1/asos/markets")

async def get_product_detail(
self,
product_id: str,
*,
market: str = "uk",
store: str | None = None,
country: str | None = None,
currency: str | None = None,
language: str | None = None,
) -> dict[str, Any]:
"""Get product detail.

Generated from the OpenAPI spec; returns the raw response dict.
"""
params = {
k: v
for k, v in {
"market": market,
"store": store,
"country": country,
"currency": currency,
"language": language,
}.items()
if v is not None
}
return await self._client.get(f"/v1/asos/products/{product_id}", params=params)

async def search_products(
self,
*,
query: str | None = None,
category_id: str | None = None,
offset: int = 0,
limit: int = 48,
sort: str = "recommended",
brand: str | None = None,
colour: str | None = None,
size: str | None = None,
min_price: str | None = None,
max_price: str | None = None,
market: str = "uk",
store: str | None = None,
country: str | None = None,
currency: str | None = None,
language: str | None = None,
) -> dict[str, Any]:
"""Search products.

Generated from the OpenAPI spec; returns the raw response dict.
"""
params = {
k: v
for k, v in {
"query": query,
"category_id": category_id,
"offset": offset,
"limit": limit,
"sort": sort,
"brand": brand,
"colour": colour,
"size": size,
"min_price": min_price,
"max_price": max_price,
"market": market,
"store": store,
"country": country,
"currency": currency,
"language": language,
}.items()
if v is not None
}
return await self._client.get("/v1/asos/search", params=params)

async def get_stock_and_prices(
self,
*,
product_ids: str,
market: str = "uk",
store: str | None = None,
country: str | None = None,
currency: str | None = None,
language: str | None = None,
) -> dict[str, Any]:
"""Get stock and prices.

Generated from the OpenAPI spec; returns the raw response dict.
"""
params = {
k: v
for k, v in {
"product_ids": product_ids,
"market": market,
"store": store,
"country": country,
"currency": currency,
"language": language,
}.items()
if v is not None
}
return await self._client.get("/v1/asos/stock-price", params=params)
5 changes: 5 additions & 0 deletions src/scrapebadger/bestbuy/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
"""bestbuy API client."""

from scrapebadger.bestbuy.client import BestbuyClient

__all__ = ["BestbuyClient"]
Loading
Loading