toolslm 0.3.4


pip install toolslm

  Latest version

Released: Sep 23, 2025

Project Links

Meta
Author: Jeremy Howard
Requires Python: >=3.9

Classifiers

Development Status
  • 4 - Beta

Intended Audience
  • Developers

Natural Language
  • English

Programming Language
  • Python :: 3.9
  • Python :: 3.10

License
  • OSI Approved :: Apache Software License

toolslm

This is a work in progress…

Install

pip install toolslm

How to use

Context creation

toolslm has some helpers to make it easier to generate XML context from files, for instance folder2ctx:

print(folder2ctx('samples', prefix=False, file_glob='*.py'))
<documents><document index="1"><src>
samples/sample_core.py
</src><document-content>
import inspect
empty = inspect.Parameter.empty
models = 'claude-3-opus-20240229','claude-3-sonnet-20240229','claude-3-haiku-20240307'
</document-content></document></documents>

JSON doesn’t map as nicely to XML as the ft data structure from fastcore.xml, but for simple XML trees it can be convenient. The json_to_xml function handles that conversion:

a = dict(surname='Howard', firstnames=['Jeremy','Peter'],
         address=dict(state='Queensland',country='Australia'))
print(json_to_xml(a, 'person'))
<person>
  <surname>Howard</surname>
  <firstnames>
    <item>Jeremy</item>
    <item>Peter</item>
  </firstnames>
  <address>
    <state>Queensland</state>
    <country>Australia</country>
  </address>
</person>

Wheel compatibility matrix

Platform Python 3
any

Files in release

Extras: None
Dependencies:
fastcore (>=1.8.11)
httpx