-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathexample.py
More file actions
28 lines (24 loc) · 800 Bytes
/
example.py
File metadata and controls
28 lines (24 loc) · 800 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
import asyncio
from ozon_api.manager import OzonAPI
from ozon_api.abstraction import OzonPage
from pprint import pprint
async def main():
async with OzonAPI() as api:
resp = await api.Catalog.feed()
model = OzonPage.model_validate(resp.json())
products = model.extract_products()
for product in products:
print(product.sku)
print(product.title)
print(product.url)
print(product.image_url)
print(product.price)
print(product.original_price)
print(product.discount)
print(product.rating)
print(product.reviews)
print(product.badges)
print(product.labels)
print("---")
if __name__ == "__main__":
asyncio.run(main())