ai_giga_tcg/app/services/file_processing_service.py
2025-04-19 13:56:58 -04:00

22 lines
713 B
Python

from typing import Optional, List, Dict
import csv
import io
import os
import json
from datetime import datetime
from sqlalchemy.orm import Session
from app.db.database import transaction
from app.models.tcgplayer_inventory import TCGPlayerInventory
from app.models.tcgplayer_product import TCGPlayerProduct
from app.services.inventory_service import InventoryService
class FileProcessingService:
def __init__(self, cache_dir: str = "app/data/cache/tcgplayer"):
self.cache_dir = cache_dir
self.inventory_service = InventoryService()
os.makedirs(cache_dir, exist_ok=True)
def _get_cache_path(self, filename: str) -> str:
return os.path.join(self.cache_dir, filename)