File size: 615 Bytes
bab4aa8
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
29
30
import sys
from pathlib import Path

sys.path.insert(0, str(Path(__file__).resolve().parent.parent))

import asyncio
import os
from dotenv import load_dotenv

load_dotenv()

print("USDA_API_KEY =", os.getenv("USDA_API_KEY"))

from app.services.quantity_normalizer_service import QuantityNormalizerService


async def main():
    async with QuantityNormalizerService(
        api_key=os.getenv("USDA_API_KEY")
    ) as q:

        result = await q.normalize_ingredient({
            "name": "Basmati Rice",
            "quantity": "1",
            "unit": "cup"
        })

        print(result)

asyncio.run(main())