diff --git a/.env.example b/.env.example new file mode 100644 index 0000000..34d1198 --- /dev/null +++ b/.env.example @@ -0,0 +1,12 @@ +# Telegram +TELEGRAM_BOT_TOKEN= + +# OpenAI +OPENAI_API_KEY= + +# Google Cloud +GOOGLE_APPLICATION_CREDENTIALS= +SPREADSHEET_ID= + +# Environment +ENV=dev diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..df120b4 --- /dev/null +++ b/.gitignore @@ -0,0 +1,114 @@ +# Byte-compiled / optimized / DLL files +__pycache__/ +*.py[cod] +*$py.class + +# C extensions +*.so + +# Distribution / packaging +.Python +build/ +develop-eggs/ +dist/ +downloads/ +eggs/ +.eggs/ +lib/ +lib64/ +parts/ +sdist/ +var/ +wheels/ +*.egg-info/ +.installed.cfg +*.egg +MANIFEST + +# PyInstaller +# Usually these files are written by a python script from a template +# before PyInstaller builds the exe, so as to inject date/other infos into it. +*.manifest +*.spec + +# Installer logs +pip-log.txt +pip-delete-this-directory.txt + +# Unit test / coverage reports +htmlcov/ +.tox/ +.nox/ +.coverage +.coverage.* +.cache +nosetests.xml +coverage.xml +*.cover +.hypothesis/ +.pytest_cache/ + +# Translations +*.mo +*.pot + +# Django stuff: +*.log +local_settings.py +db.sqlite3 + +# Flask stuff: +instance/ +.webassets-cache + +# Scrapy stuff: +.scrapy + +# Sphinx documentation +docs/_build/ + +# PyBuilder +target/ + +# Jupyter Notebook +.ipynb_checkpoints + +# IPython +profile_default/ +ipython_config.py + +# pyenv +.python-version + +# celery beat schedule file +celerybeat-schedule + +# SageMath parsed files +*.sage.py + +# Environments +.env +.venv +env/ +venv/ +ENV/ +env.bak +venv.bak + +# Spyder project settings +.spyderproject +.spyproject + +# Rope project settings +.ropeproject + +# mkdocs documentation +/site + +# mypy +.mypy_cache/ +.dmypy.json +dmypy.json + +# Pyre type checker +.pyre/ diff --git a/config/keywords.csv b/config/keywords.csv new file mode 100644 index 0000000..8045680 --- /dev/null +++ b/config/keywords.csv @@ -0,0 +1,5 @@ +keyword,categoria_principal,subcategoria,tipo_gasto_default +monitor,Tecnología,Equipo de Cómputo,negocio +croquetas,Personal,Mascotas,personal +hosting,Tecnología,Dominios y Hosting,negocio +libro,Educación,Libros y Material,negocio diff --git a/config/providers.csv b/config/providers.csv new file mode 100644 index 0000000..54c4ec8 --- /dev/null +++ b/config/providers.csv @@ -0,0 +1,6 @@ +provider_name,aliases,categoria_principal,subcategoria,tipo_gasto_default +Amazon,"amazon,amzn,amazon mx",Por Determinar,Compras en Línea, +Office Depot,"officedepot,office",Administración,Suministros de oficina,negocio +Uber Eats,"ubereats,uber",Personal,Comida a domicilio,personal +GoDaddy,"godaddy",Tecnología,Dominios y Hosting,negocio +Cinepolis,"cinepolis",Personal,Entretenimiento,personal diff --git a/config/user_config.json b/config/user_config.json new file mode 100644 index 0000000..74503a0 --- /dev/null +++ b/config/user_config.json @@ -0,0 +1,8 @@ +{ + "user_name": "Marco Gallegos", + "rfc": "GAMM910513CW6", + "regimen_fiscal_default": "612 - Persona Física con Actividad Empresarial y Profesional", + "moneda_default": "MXN", + "pais": "MX", + "timezone": "America/Mexico_City" +} diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..cc48610 --- /dev/null +++ b/requirements.txt @@ -0,0 +1,7 @@ +fastapi +python-telegram-bot +openai +google-api-python-client +pydantic +uvicorn +python-dotenv diff --git a/src/__init__.py b/src/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/src/data_models.py b/src/data_models.py new file mode 100644 index 0000000..e69de29 diff --git a/src/main.py b/src/main.py new file mode 100644 index 0000000..dade557 --- /dev/null +++ b/src/main.py @@ -0,0 +1,21 @@ +from fastapi import FastAPI, Request +import logging + +# Configure logging +logging.basicConfig(level=logging.INFO) +logger = logging.getLogger(__name__) + +app = FastAPI() + +@app.get("/") +async def root(): + return {"message": "Expense Tracker API is running."} + +@app.post("/process-expense") +async def process_expense(request: Request): + """ + Receives expense data from n8n, logs it, and returns a confirmation. + """ + payload = await request.json() + logger.info(f"Received expense data: {payload}") + return {"status": "received", "data": payload} diff --git a/src/modules/__init__.py b/src/modules/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/src/modules/ai_agents.py b/src/modules/ai_agents.py new file mode 100644 index 0000000..e69de29 diff --git a/src/modules/config_loader.py b/src/modules/config_loader.py new file mode 100644 index 0000000..e69de29 diff --git a/src/modules/data_manager.py b/src/modules/data_manager.py new file mode 100644 index 0000000..e69de29 diff --git a/src/modules/input_handler.py b/src/modules/input_handler.py new file mode 100644 index 0000000..e69de29 diff --git a/src/prompts/analyst_prompt.txt b/src/prompts/analyst_prompt.txt new file mode 100644 index 0000000..e69de29 diff --git a/src/prompts/auditor_prompt.txt b/src/prompts/auditor_prompt.txt new file mode 100644 index 0000000..e69de29