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>
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
toolslm-0.3.45.tar.gz
(28.3 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
toolslm-0.3.45-py3-none-any.whl
(30.5 kB
view details)
File details
Details for the file toolslm-0.3.45.tar.gz.
File metadata
- Download URL: toolslm-0.3.45.tar.gz
- Upload date:
- Size: 28.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/6.2.0 CPython/3.13.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e03cee37a6c79737ca748dac69bf5151e8eaeac106ae0ae2878dad2bc7dbc728
|
|
| MD5 |
b9340932f64896b8fd6522e71f74b68a
|
|
| BLAKE2b-256 |
d902775af83a82ab88bd7586766f7eb1ed4b0b93c21193a0683c17d60a93ad15
|
File details
Details for the file toolslm-0.3.45-py3-none-any.whl.
File metadata
- Download URL: toolslm-0.3.45-py3-none-any.whl
- Upload date:
- Size: 30.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/6.2.0 CPython/3.13.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2fe07602278142c9c18c6800fb29b521a8a7e3c52c095fee263327a201164cf9
|
|
| MD5 |
8e2a6be7267d8185b9912854f6879de9
|
|
| BLAKE2b-256 |
e06323e20250e8e432f0acc89708c9e7a6deb4c03038026f406d3f3d99d7aed1
|