import time import pandas as pd import logging logging.basicConfig(level=logging.INFO) logger = logging.getLogger(__name__) class GSTGatewayMock: """ Mocks a real-time fetching from live GST sites. In a real scenario, this would use requests to hit a government API endpoint. """ def __init__(self): self.api_url = "https://mock-gst-api.gov.in/v1/returns" def fetch_gst_data(self, start_date, end_date, gstin="27AADCB2230M1Z2"): logger.info(f"Simulating fetch from {self.api_url} for GSTIN {gstin}") # Simulate network latency time.sleep(2) # Generate an empty DataFrame to represent no live data without credentials # (This prevents injecting fake/dummy data into the user's analysis) logger.info("Live GST API requires production credentials. Returning empty dataset.") return pd.DataFrame(columns=['InvoiceID', 'VendorName', 'Amount', 'InvoiceDate', 'GSTIN']) def validate_gstin(self, gstin): """Mock GSTIN validation""" time.sleep(0.5) return len(gstin) == 15