This commit is contained in:
Luís Murta 2026-01-14 19:49:33 +00:00
commit aba3c446ec
Signed by: satprog
GPG Key ID: 169EF1BBD7049F94
7 changed files with 1690 additions and 0 deletions

5
.env Normal file
View File

@ -0,0 +1,5 @@
SECRET_ID = "d0516709-c471-4d06-9f3b-011c40ae5466"
SECRET_KEY = "4518303803c3ea7ba9fd2ff66b46b65bb03bb22f2be5d60f8cdd9a39589b7d1427bf71b44b8c20a68659db2084870abbc5909c8743b38a8a6c71ff8c8b04e268"
TOKEN = "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ0b2tlbl90eXBlIjoiYWNjZXNzIiwiZXhwIjoxNjgxNjQ5NTAzLCJqdGkiOiIwY2UzNzQxZDJmNzQ0NDE3YjM1ODc3MzE4OTEwZmQ1MiIsImlkIjoxNDI5Nywic2VjcmV0X2lkIjoiZDA1MTY3MDktYzQ3MS00ZDA2LTlmM2ItMDExYzQwYWU1NDY2IiwiYWxsb3dlZF9jaWRycyI6WyIwLjAuMC4wLzAiLCI6Oi8wIl19.TH7pwJZtCSFeboe2VW_vTERVUe4IDQvlYCrfBVKLdcg"
REQ_ID = "141b4499-8449-4c6f-b78a-3fa973194753"
DEFAULT_DB = "postgresql://pf-budget:muster-neutron-omega@192.168.1.132:5432/pf-budget"

0
README.md Normal file
View File

71
notebook#1.ipynb Normal file
View File

@ -0,0 +1,71 @@
{
"cells": [
{
"cell_type": "code",
"execution_count": 1,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"op=Operation.Transactions, params=None\n",
"[]\n"
]
}
],
"source": [
"import difflib\n",
"import dotenv\n",
"import os\n",
"\n",
"from pfbudget.common.types import Operation\n",
"from pfbudget.core.manager import Manager\n",
"\n",
"dotenv.load_dotenv()\n",
"\n",
"manager = Manager(os.environ.get(\"DEFAULT_DB\", \"\"), 2)\n",
"transactions = manager.action(Operation.Transactions)\n",
"if transactions is None:\n",
" transactions = []\n",
"\n",
"matches = []\n",
"\n",
"for t in transactions:\n",
" found = False\n",
" for m in matches:\n",
" if difflib.get_close_matches(t[\"description\"], [m[0]], cutoff=0.6):\n",
" m[1] += 1\n",
" found = True\n",
" break\n",
" if not found:\n",
" matches.append([t[\"description\"], 1])\n",
"\n",
"# matches = []\n",
"print(sorted(matches, key=lambda m: m[1], reverse=True))\n"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "pf-notebooks-34EKrqJg-py3.10",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.10.10"
},
"orig_nbformat": 4
},
"nbformat": 4,
"nbformat_minor": 2
}

0
pf_notebooks/__init__.py Normal file
View File

1594
poetry.lock generated Normal file

File diff suppressed because it is too large Load Diff

20
pyproject.toml Normal file
View File

@ -0,0 +1,20 @@
[tool.poetry]
name = "pf-notebooks"
version = "0.1.0"
description = ""
authors = ["Luís Murta <luis@murta.dev>"]
readme = "README.md"
packages = [{include = "pf_notebooks"}]
[tool.poetry.dependencies]
python = "^3.10"
pf-budget = {path = "../pf-budget", develop = false}
python-dotenv = "^1.0.0"
[tool.poetry.group.dev.dependencies]
ipykernel = "^6.22.0"
[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"

0
tests/__init__.py Normal file
View File