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.48.tar.gz
(18.8 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.48-py3-none-any.whl
(19.9 kB
view details)
File details
Details for the file toolslm-0.3.48.tar.gz.
File metadata
- Download URL: toolslm-0.3.48.tar.gz
- Upload date:
- Size: 18.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/7.0.0 CPython/3.13.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9bef3d3b570b45c5859688632df08613e68638c2c5b237735d4efcccf714cef3
|
|
| MD5 |
8513ce781677e79845df3f8d7ef83377
|
|
| BLAKE2b-256 |
092cba2cbafdbe70ba65ea0dd7e9c6a1efa32d00ed4a8723e039776d405b4a21
|
File details
Details for the file toolslm-0.3.48-py3-none-any.whl.
File metadata
- Download URL: toolslm-0.3.48-py3-none-any.whl
- Upload date:
- Size: 19.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/7.0.0 CPython/3.13.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5e291dca2518d638844ef519205ad6ec9262111c436df639c7f5c51432f7d67c
|
|
| MD5 |
dedb4252fe20a87659be2391e8314b69
|
|
| BLAKE2b-256 |
68d48484898918988a07c4f47d27b3c339a9ba4efe1d21f382f9e31a4ed1c12a
|