fmtr.tools 1.0.42__py3-none-any.whl → 1.0.44__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.

Potentially problematic release.


This version of fmtr.tools might be problematic. Click here for more details.

@@ -9,3 +9,6 @@ class Agent(pydantic_ai.Agent):
9
9
  TODO base class is marked `@final`, so is it safe to subclass?
10
10
 
11
11
  """
12
+
13
+
14
+ Agent.instrument_all()
@@ -1,14 +1,22 @@
1
1
  from pydantic import BaseModel, RootModel
2
2
 
3
3
 
4
- def to_df(*objs):
4
+ def to_df(*objs, name_value='value'):
5
5
  """
6
6
 
7
7
  DataFrame representation of Data Models as rows.
8
8
 
9
9
  """
10
10
  from fmtr.tools import tabular
11
- rows = [obj.model_dump() for obj in objs]
11
+
12
+ rows = []
13
+ for obj in objs:
14
+ if isinstance(obj, BaseModel):
15
+ row = obj.model_dump()
16
+ else:
17
+ row = {name_value: obj}
18
+ rows.append(row)
19
+
12
20
  df = tabular.DataFrame(rows)
13
21
  return df
14
22
 
@@ -40,7 +48,7 @@ class Base(BaseModel, MixinFromJson):
40
48
 
41
49
  """
42
50
 
43
- def to_df(self):
51
+ def to_df(self, name_value='value'):
44
52
  """
45
53
 
46
54
  DataFrame representation with Fields as rows.
@@ -52,7 +60,7 @@ class Base(BaseModel, MixinFromJson):
52
60
  val = getattr(self, name)
53
61
  objs.append(val)
54
62
 
55
- df = to_df(*objs)
63
+ df = to_df(*objs, name_value=name_value)
56
64
  df['id'] = list(self.model_fields.keys())
57
65
  return df
58
66
 
fmtr/tools/version CHANGED
@@ -1 +1 @@
1
- 1.0.42
1
+ 1.0.44
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: fmtr.tools
3
- Version: 1.0.42
3
+ Version: 1.0.44
4
4
  Summary: Collection of high-level tools to simplify everyday development tasks, with a focus on AI/ML
5
5
  Home-page: https://github.com/fmtr/fmtr.tools
6
6
  Author: Frontmatter
@@ -6,7 +6,7 @@ fmtr/tools/caching_tools.py,sha256=UOCYUNvLQ-NofR_dhqBmZF96-HRPf4At5MmxVk3gAIk,2
6
6
  fmtr/tools/config.py,sha256=5XllwShglvSqEl7Jt0EyObWHW4p-5QahkZjTAXdIXxc,715
7
7
  fmtr/tools/config_tools.py,sha256=27PbPYj90ClIW4QcRoUoiFM3SbWeMIIZsZR32IPU4V8,805
8
8
  fmtr/tools/console_script_tools.py,sha256=T968S6fL--84G5ALaKwcTAzUOFyVhTU7Ts6qbk8oaeE,65
9
- fmtr/tools/data_modelling_tools.py,sha256=w0bnKbEJMFhWRMIof9mYsuSo-Vs8Tehw2_JY3NDL0VM,1242
9
+ fmtr/tools/data_modelling_tools.py,sha256=lCJmioGoTIt5NI6m1BgRrJqG8oD8t-ZtCtS-QX-Y1lc,1445
10
10
  fmtr/tools/dataclass_tools.py,sha256=0Gt6KeLhtPgubo_2tYkIVqB8oQ91Qzag8OAGZDdjvMU,1209
11
11
  fmtr/tools/datatype_tools.py,sha256=3P4AWIFGkJ-UqvXlj0Jc9IvkIIgTOE9jRrOk3NVbpH8,1508
12
12
  fmtr/tools/docker_tools.py,sha256=rdaZje2xhlmnfQqZnR7IHgRdWncTLjrJcViUTt5oEwk,617
@@ -42,11 +42,11 @@ fmtr/tools/tabular_tools.py,sha256=L0yNsU_c8dGTmsUlMFERfTt2a3aZv_pKr2YQc7C9OvA,6
42
42
  fmtr/tools/tokenization_tools.py,sha256=9FP5vgPufWv0XA961eVKObFll0d_2mM0W3ut3rtZyeo,4329
43
43
  fmtr/tools/tools.py,sha256=xnfUrOnrT4OxFYez6vV5tAhydzCICJFiGVnviiZDEQo,796
44
44
  fmtr/tools/unicode_tools.py,sha256=yS_9wpu8ogNoiIL7s1G_8bETFFO_YQlo4LNPv1NLDeY,52
45
- fmtr/tools/version,sha256=YqbU0sZsDgmmNeKnzFVI1oDZwrUn8Iw7CVo10rO5hJQ,6
45
+ fmtr/tools/version,sha256=A_CY3m4ylW4oU2KxrXuON42PZ7Rn6SOnc2SXSINTdL8,6
46
46
  fmtr/tools/version_tools.py,sha256=axzzHBS9V1n6YuSacsDKG3VfAvRqR8qr6aENCibR8vs,1248
47
47
  fmtr/tools/yaml_tools.py,sha256=Ol43ZwbnSXGnn1K98Uxx61KPGSqfC4axE-X2q1LKMwk,349
48
48
  fmtr/tools/ai_tools/__init__.py,sha256=4VO4uyO2ZBzLVB63DYAVsv1qMT9NX39B9P5YCaPrfto,373
49
- fmtr/tools/ai_tools/agentic_tools.py,sha256=Hwd8GuW1979fkgu8Gc_yJH2zS2gmqnYAxtstEDBsOqY,154
49
+ fmtr/tools/ai_tools/agentic_tools.py,sha256=nAMVwk-3UR9B3n0Sgdp1HQVzsEC-5N7m7-sYFOwMLi0,179
50
50
  fmtr/tools/ai_tools/inference_tools.py,sha256=yF8Oxph0L8W2CnK_o-MVztBhWVwBpgOEkx9_m3uqQww,11840
51
51
  fmtr/tools/tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
52
52
  fmtr/tools/tests/conftest.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -56,9 +56,9 @@ fmtr/tools/tests/test_environment.py,sha256=iHaiMQfECYZPkPKwfuIZV9uHuWe3aE-p_dN_
56
56
  fmtr/tools/tests/test_json.py,sha256=IeSP4ziPvRcmS8kq7k9tHonC9rN5YYq9GSNT2ul6Msk,287
57
57
  fmtr/tools/tests/test_path.py,sha256=AkZQa6_8BQ-VaCyL_J-iKmdf2ZaM-xFYR37Kun3k4_g,2188
58
58
  fmtr/tools/tests/test_yaml.py,sha256=jc0TwwKu9eC0LvFGNMERdgBue591xwLxYXFbtsRwXVM,287
59
- fmtr.tools-1.0.42.dist-info/LICENSE,sha256=FW9aa6vVN5IjRQWLT43hs4_koYSmpcbIovlKeAJ0_cI,10757
60
- fmtr.tools-1.0.42.dist-info/METADATA,sha256=QHrueQAoU2QQ-JJM_hsR6MtdU9p6qOBtAST7GiBz3bs,13859
61
- fmtr.tools-1.0.42.dist-info/WHEEL,sha256=oiQVh_5PnQM0E3gPdiz09WCNmwiHDMaGer_elqB3coM,92
62
- fmtr.tools-1.0.42.dist-info/entry_points.txt,sha256=CEStVkwJ1mTFvhN1WV5RdW83SkNW1d5Syj-KZ6A19ng,72
63
- fmtr.tools-1.0.42.dist-info/top_level.txt,sha256=t5341a8ii3n4RFizwTeXGmcq_pf4GqL1h9ylE5LIWRk,12
64
- fmtr.tools-1.0.42.dist-info/RECORD,,
59
+ fmtr.tools-1.0.44.dist-info/LICENSE,sha256=FW9aa6vVN5IjRQWLT43hs4_koYSmpcbIovlKeAJ0_cI,10757
60
+ fmtr.tools-1.0.44.dist-info/METADATA,sha256=zGFKmZfAl4yjspwTRdTxnpvdmRoSOeV4lIPlOIJdMc4,13859
61
+ fmtr.tools-1.0.44.dist-info/WHEEL,sha256=oiQVh_5PnQM0E3gPdiz09WCNmwiHDMaGer_elqB3coM,92
62
+ fmtr.tools-1.0.44.dist-info/entry_points.txt,sha256=CEStVkwJ1mTFvhN1WV5RdW83SkNW1d5Syj-KZ6A19ng,72
63
+ fmtr.tools-1.0.44.dist-info/top_level.txt,sha256=t5341a8ii3n4RFizwTeXGmcq_pf4GqL1h9ylE5LIWRk,12
64
+ fmtr.tools-1.0.44.dist-info/RECORD,,