fin-infra 0.1.71__py3-none-any.whl → 0.1.72__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -251,8 +251,7 @@ class CategorizationEngine:
251
251
  )
252
252
 
253
253
  except Exception as e:
254
- # Log error and return None (will fallback to uncategorized)
255
- print(f"ML prediction error: {e}")
254
+ logger.error("ML prediction error: %s", e)
256
255
  return None
257
256
 
258
257
  def _load_ml_model(self) -> None:
@@ -273,8 +272,10 @@ class CategorizationEngine:
273
272
  vectorizer_file = self.model_path / "vectorizer.joblib"
274
273
 
275
274
  if not model_file.exists() or not vectorizer_file.exists():
276
- print(f"ML model not found at {self.model_path}")
277
- print("Run training script to generate model files")
275
+ logger.warning(
276
+ "ML model not found at %s. Run training script to generate model files.",
277
+ self.model_path,
278
+ )
278
279
  return
279
280
 
280
281
  try:
@@ -282,12 +283,14 @@ class CategorizationEngine:
282
283
 
283
284
  self._ml_model = joblib.load(model_file)
284
285
  self._ml_vectorizer = joblib.load(vectorizer_file)
285
- print(f"Loaded ML model from {self.model_path}")
286
+ logger.info("Loaded ML model from %s", self.model_path)
286
287
  except ImportError:
287
- print("scikit-learn not installed. ML predictions disabled.")
288
- print("Install with: pip install scikit-learn")
288
+ logger.warning(
289
+ "scikit-learn not installed. ML predictions disabled. "
290
+ "Install with: pip install scikit-learn"
291
+ )
289
292
  except Exception as e:
290
- print(f"Error loading ML model: {e}")
293
+ logger.error("Error loading ML model: %s", e)
291
294
 
292
295
  def add_rule(
293
296
  self,
@@ -8,6 +8,7 @@ CRITICAL: Uses ai-infra.llm.LLM (NEVER custom LLM clients).
8
8
 
9
9
  from __future__ import annotations
10
10
 
11
+ import logging
11
12
  from datetime import datetime
12
13
  from decimal import Decimal
13
14
  from typing import TYPE_CHECKING
@@ -17,6 +18,8 @@ from pydantic import BaseModel, Field
17
18
  if TYPE_CHECKING:
18
19
  from ai_infra.llm import LLM
19
20
 
21
+ logger = logging.getLogger(__name__)
22
+
20
23
 
21
24
  class CryptoInsight(BaseModel):
22
25
  """Personalized cryptocurrency insight.
@@ -284,8 +287,6 @@ Provide your insight:"""
284
287
  )
285
288
  )
286
289
  except Exception as e:
287
- # Graceful degradation - log error but don't fail
288
- # In production, use svc-infra logging
289
- print(f"Warning: LLM insight generation failed: {e}")
290
+ logger.warning("LLM insight generation failed: %s", e)
290
291
 
291
292
  return insights
@@ -10,6 +10,7 @@ Aggregates insights from multiple sources:
10
10
  - Cash flow projections
11
11
  """
12
12
 
13
+ import logging
13
14
  from typing import TYPE_CHECKING
14
15
 
15
16
  if TYPE_CHECKING:
@@ -18,6 +19,8 @@ if TYPE_CHECKING:
18
19
  from .models import Insight, InsightFeed, InsightPriority, InsightCategory
19
20
  from .aggregator import aggregate_insights, get_user_insights
20
21
 
22
+ logger = logging.getLogger(__name__)
23
+
21
24
  __all__ = [
22
25
  "Insight",
23
26
  "InsightFeed",
@@ -125,4 +128,4 @@ def add_insights(
125
128
  # Mount router
126
129
  app.include_router(router, include_in_schema=True)
127
130
 
128
- print("Insights feed enabled (unified financial insights)")
131
+ logger.info("Insights feed enabled")
@@ -30,6 +30,7 @@ print(f"Net Worth: ${snapshot.total_net_worth:,.2f}")
30
30
  """
31
31
 
32
32
  import asyncio
33
+ import logging
33
34
  import uuid
34
35
  from datetime import datetime
35
36
  from typing import Any
@@ -47,6 +48,8 @@ from fin_infra.net_worth.models import (
47
48
  NetWorthSnapshot,
48
49
  )
49
50
 
51
+ logger = logging.getLogger(__name__)
52
+
50
53
 
51
54
  class NetWorthAggregator:
52
55
  """
@@ -219,8 +222,7 @@ class NetWorthAggregator:
219
222
 
220
223
  for i, result in enumerate(results):
221
224
  if isinstance(result, BaseException):
222
- # Log error but continue (graceful degradation)
223
- print(f"Provider {providers_used[i]} failed: {result}")
225
+ logger.warning("Provider %s failed: %s", providers_used[i], result)
224
226
  continue
225
227
 
226
228
  # result is now tuple[list[AssetDetail], list[LiabilityDetail]]
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: fin-infra
3
- Version: 0.1.71
3
+ Version: 0.1.72
4
4
  Summary: Financial infrastructure toolkit: banking connections, market data, credit, cashflows, and brokerage integrations
5
5
  License: MIT
6
6
  Keywords: finance,banking,plaid,brokerage,markets,credit,tax,cashflow,fintech,infra
@@ -32,7 +32,7 @@ fin_infra/cashflows/core.py,sha256=Or0hPqCvY_ypV0YiMXh-mle6xWK0tE8WuPPAqHGUp8E,5
32
32
  fin_infra/categorization/__init__.py,sha256=efLje12AW-ec9Vs5ynb41r4XCIWx5a-Z9WoGb3kQdIE,2030
33
33
  fin_infra/categorization/add.py,sha256=JDOvxngh-7oWHTddOyP4GAse9vLuxSTfoIhrDKUHOKg,6278
34
34
  fin_infra/categorization/ease.py,sha256=bomEtJAgwk9uiemNt1rk-IsTjJIhyJn0GJ_c58YEmJs,5836
35
- fin_infra/categorization/engine.py,sha256=Qk14HQQB6rBwEZ0cSz47l_jD4eFpWlSJzHg8kjC0KK8,12107
35
+ fin_infra/categorization/engine.py,sha256=vpwxtQGEbjCMyvzB5EQV2etjHHNOu1R05o99mHP_WZY,12132
36
36
  fin_infra/categorization/llm_layer.py,sha256=KbX7o2c-BqWDbPdQXD6qxk98gHRNtEDvf3-Q3kniT9k,12699
37
37
  fin_infra/categorization/models.py,sha256=-rGXR0RW2EU_FQ7ZfDWBIXxx8QGJDxeBF9zKGYyVgqY,5931
38
38
  fin_infra/categorization/rules.py,sha256=m3OogJY0hJe5BrmZqOvOKS2-HRdW4Y5jvvtlPDn9Pn8,12884
@@ -56,7 +56,7 @@ fin_infra/credit/experian/parser.py,sha256=7ptdLyTWWqHWqCo1CXn6L7XaIn9ZRRuOaATbF
56
56
  fin_infra/credit/experian/provider.py,sha256=QqnxFN0WIKyxV5y5jzIB_gv2djNpR-rTUiIhMtTWq8k,13701
57
57
  fin_infra/credit/mock.py,sha256=xKWZk3fhuIYRfiZkNc9fbHUNViNKjmOLSj0MTI1f4ik,5356
58
58
  fin_infra/crypto/__init__.py,sha256=p-gEoF59XzyV1RouubW4onl5mE62XvXSAw9isMc48qc,8314
59
- fin_infra/crypto/insights.py,sha256=BBC7SSxD6FJAXKPvOkC8KK4HNy7Gtzfn0egUx_wzVJM,11444
59
+ fin_infra/crypto/insights.py,sha256=cgMsjdrR7vOTKvEDbFCXpS7O7I8dMs1oz6cIbtrJWZI,11393
60
60
  fin_infra/documents/__init__.py,sha256=Ub1hbX3PTrBSsBdcbL8PFf6oq8jSH4pYxW45-qOYPqs,1909
61
61
  fin_infra/documents/add.py,sha256=dxzhdCsDcVVyTYKrgM30j-Wr0BAG797p4xa4j9UXST8,8118
62
62
  fin_infra/documents/analysis.py,sha256=zY5OQEIlq3JLNND_cg2KheFdryUmIecPOR2lR6oKhPw,13992
@@ -76,7 +76,7 @@ fin_infra/goals/scaffold_templates/__init__.py,sha256=rLFam-mRsj8LvJu5kRBEIJtw9r
76
76
  fin_infra/goals/scaffold_templates/models.py.tmpl,sha256=b23Nlwm05MFMQE4qkrylTPXqulsN6cuFzNev2liY7DI,5714
77
77
  fin_infra/goals/scaffold_templates/repository.py.tmpl,sha256=4BFy-fPBR412p8wb8VzsekxM3uGno-odqZP_BuMAXBU,11046
78
78
  fin_infra/goals/scaffold_templates/schemas.py.tmpl,sha256=M1hS1pK9UDXcNqPW-NGu9804hTFe4FPdUDVgDSMcQl4,5331
79
- fin_infra/insights/__init__.py,sha256=JTzc7uV53eLI2Z8seomRvea-m4uAHHX0UjTNe-WP_z0,3954
79
+ fin_infra/insights/__init__.py,sha256=ptVdG3_GJdpab8Ktn97sq6lk3ruReqeXjuLjB79e1Us,3984
80
80
  fin_infra/insights/aggregator.py,sha256=XG32mN5w5Nc4AZllmfl1esL4q44mFAf0Fvj9mWev_zk,10249
81
81
  fin_infra/insights/models.py,sha256=xov_YV8oBLJt3YdyVjbryRfcXqmGeGiPvZsZHSbvtl8,3202
82
82
  fin_infra/investments/__init__.py,sha256=o4p_8slq-CzIK0ditVhNfcyoWsDdyFaxRl-IMBHtLNE,6732
@@ -104,7 +104,7 @@ fin_infra/models/tax.py,sha256=lhNVIW650CdtpfgmSyMMJdojV7QnpHOUFQKiwMLTT4A,15656
104
104
  fin_infra/models/transactions.py,sha256=NtIHk3RDM58wYHQiHNOsvU5K6lgpfZodrL7scDRKP6E,865
105
105
  fin_infra/net_worth/__init__.py,sha256=EjEuHNg8gEfFwbfko1-o5j-gSUZ2FcO9h7l05C-zAJM,3101
106
106
  fin_infra/net_worth/add.py,sha256=QWfHIHJs2CV99WRBqjQ2OteiOrn5cR9nurmxTF9v5rg,23191
107
- fin_infra/net_worth/aggregator.py,sha256=3iZGPE3AlS2Za90Mnw9XfKa2-BmCWLKkTUmDLztP9EQ,12779
107
+ fin_infra/net_worth/aggregator.py,sha256=9Kx2vUR71QwqYZdGaCfmYrJ1hNxzd1EEuAdWJoNjqTI,12780
108
108
  fin_infra/net_worth/calculator.py,sha256=SQJGJDok5HgvoAhKBxeeqt8vhGMchABU3zPmNRpqNy4,13139
109
109
  fin_infra/net_worth/ease.py,sha256=ERdFrUjjb5l5BRp_c2tEfE1obTpRc_-FA9LnV7BTiEw,15883
110
110
  fin_infra/net_worth/goals.py,sha256=BJGxdsMjvgQDELFEJo-ai3DvsAzUNXvzMXkwovHr8yQ,1238
@@ -173,8 +173,8 @@ fin_infra/utils/__init__.py,sha256=gKacLSWMAis--pasd8AuVN7ap0e9Z1TjRGur0J23EDo,6
173
173
  fin_infra/utils/http.py,sha256=pvcxbNQ9oisoGPkNe3xX9aAgWzEN6mmdtr1w-L02Xj8,629
174
174
  fin_infra/utils/retry.py,sha256=ISBrup5XCuXqHZh9kjTGvGQYcuyYyqZE4u26wW7r3CM,1030
175
175
  fin_infra/version.py,sha256=4t_crzhrLum--oyowUMxtjBTzUtWp7oRTF22ewEvJG4,49
176
- fin_infra-0.1.71.dist-info/LICENSE,sha256=wK-Ya7Ylxa38dSIZRhvNj1ZVLIrHC-BAI8v38PNADiA,1061
177
- fin_infra-0.1.71.dist-info/METADATA,sha256=01WFDBQqjW22UMaCdMSTzTyjO0JY4hFXYIgq4sZheNo,10183
178
- fin_infra-0.1.71.dist-info/WHEEL,sha256=IYZQI976HJqqOpQU6PHkJ8fb3tMNBFjg-Cn-pwAbaFM,88
179
- fin_infra-0.1.71.dist-info/entry_points.txt,sha256=Sr1uikvALZMeKm-DIkeKG4L9c4SNqysXGO_IRF8_9eU,53
180
- fin_infra-0.1.71.dist-info/RECORD,,
176
+ fin_infra-0.1.72.dist-info/LICENSE,sha256=wK-Ya7Ylxa38dSIZRhvNj1ZVLIrHC-BAI8v38PNADiA,1061
177
+ fin_infra-0.1.72.dist-info/METADATA,sha256=CcRFsufDQgd2Bj6f7L6odXY1AOGCIagChN8bkV97tzQ,10183
178
+ fin_infra-0.1.72.dist-info/WHEEL,sha256=IYZQI976HJqqOpQU6PHkJ8fb3tMNBFjg-Cn-pwAbaFM,88
179
+ fin_infra-0.1.72.dist-info/entry_points.txt,sha256=Sr1uikvALZMeKm-DIkeKG4L9c4SNqysXGO_IRF8_9eU,53
180
+ fin_infra-0.1.72.dist-info/RECORD,,