Transformative
Use AI to write code to convert a type into another type.
Installation
pip install transformative
Then you can use it like this:
from transformative import init, create
init(generated_code_dir="my/path/for/generated/code/")
circle_to_square = create(Circle, Square)
square = circle_to_square(Circle(radius=1))
When the create function is called the first time, the project will use an LLM to generate a converter. First, it will
write tests, then it will attempt to write code to pass those tests. If the code passes the tests, it will be saved to
the generated_code_dir. Subsequent calls to the create function will use the generated code to convert the types.
Dependencies
This package requires aider-chat to be installed and available on the command line:
pip install aider-chat
# or
python -m pip install aider-install
Aider
The tool uses aider to write the code, calling out to an LLM server based on what API keys are found in your local
environment. More information about configuring aider can be found here: https://aider.chat/docs/config/dotenv.html
Quick Start
See src/examples/generate_new_code.py for an example of how to use the tool.
See notes/master_plan.md for plans about future development.
License
This project is licensed under the MIT License. See the LICENSE file for details.
Metadata
Release files for transformative 0.0.4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| transformative-0.0.4.tar.gz | 18.0 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| transformative-0.0.4-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 40.1 kB
Release files / transformative-0.0.4.tar.gz
| Download URL | transformative-0.0.4.tar.gz |
|---|---|
| Size | 18.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
d55482026c954943e178ccbb711ea10858f2525b4d24a654a2e99de700220bda
|
|
BLAKE2b-256 checksum How to use checksums |
66834cef33540a32dd3d02d81c11ba0def1c4548a34fa6c06a5cd5cf77b38004
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.12.3
|
Release files / transformative-0.0.4-py3-none-any.whl
| Download URL | transformative-0.0.4-py3-none-any.whl |
|---|---|
| Size | 22.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
91063bf4cacc39309a1a6ebf0522ca95f3b323e7c3b32042c7c3e3d3e7513b1d
|
|
BLAKE2b-256 checksum How to use checksums |
4c951005de48e7c60280e28ae9770ca515f690b23fd6d695e82c1b05c4f55741
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.12.3
|
Security for transformative 0.0.4
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.