AI tool for migrating code
Project description
AIMigrate
AIMigrate helps migrate code to maintain compatability when one of your dependency packackages changes
Installation
pip install aimigrate
Configure LLM Provider
AIMigrate is compatabile with openai, gemini, and anthropic models. To use these tools you will need an API key.
- For Gemini, get your API key from: https://aistudio.google.com/apikey
- For OpenAI, get your API key from: https://platform.openai.com/settings/organization/api-keys
- For Anthropic, get your API key from: https://www.anthropic.com/api
Once you have these keys, we recommend using python-dotenv for managing your keys. Store them as environment variables GEMINI_API_KEY, OPENAI_API_KEY, or ANTHROPIC_API_KEY respective.
Running open weight (i.e., local) models:
You can also use ollama to run models locally. To start open a terminal run ollama serve. If it is your first time running the model you'll need to pull it first (e.g., ollama run llama3). You will likely need to increase the context window.
DO NOT UNDER ANY CIRCUMSTANCE SHARE OR UPLOAD TO GITHUB YOUR API KEY!
Usage
Let's say we have a project Zombiesim that we want to migrate from Starsim v1 (v1.0.3) to v2 (v2.2.0). Typical usage is to migrate all the files in a folder to a new folder:
import starsim as ss
import aimigrate as aim
aim.migrate(
starsim = ss, # can also be the path to the folder, which must be the cloned repo (not from pypi)
from_version = 'v1.0.3', # can be any valid git tag or hash
to_version = 'v2.2.0', # can be any valid git tag or hash
model = 'openai:gpt-4o', # use aisuite provider:model syntax
source = '/path/to/your/code/folder', # folder with the code to migrate
dest = '/path/to/migrated/folder', # folder to output migrated code into
)
Tests
uv run --group dev pytest -v test_*.py
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
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
File details
Details for the file aimigrate-0.2.2.tar.gz.
File metadata
- Download URL: aimigrate-0.2.2.tar.gz
- Upload date:
- Size: 13.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d303ae92e7101b9486f07e8a4c6558c48592ae00d3eff398d00bf018096b340e
|
|
| MD5 |
4f7f70eaef65a5dcafdec5e62e30c089
|
|
| BLAKE2b-256 |
a9b808b10289429b7558af99eb46563d2c7290eecef23ec6de9dcae7a49ab8db
|
Provenance
The following attestation bundles were made for aimigrate-0.2.2.tar.gz:
Publisher:
publish_pypi.yml on starsimhub/aimigrate
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
aimigrate-0.2.2.tar.gz -
Subject digest:
d303ae92e7101b9486f07e8a4c6558c48592ae00d3eff398d00bf018096b340e - Sigstore transparency entry: 175745463
- Sigstore integration time:
-
Permalink:
starsimhub/aimigrate@39de8fd355cd7d7ed562ef370cbd4c1570930f6d -
Branch / Tag:
refs/heads/main - Owner: https://github.com/starsimhub
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish_pypi.yml@39de8fd355cd7d7ed562ef370cbd4c1570930f6d -
Trigger Event:
workflow_run
-
Statement type:
File details
Details for the file aimigrate-0.2.2-py3-none-any.whl.
File metadata
- Download URL: aimigrate-0.2.2-py3-none-any.whl
- Upload date:
- Size: 18.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f8323b02ea1730eaa24f5e6db5efdbd875ec0e4783c8a608ed6515c286340f26
|
|
| MD5 |
e93afeeb2506c417b024daa87a2f41f0
|
|
| BLAKE2b-256 |
ab9d2fab21cc894dbdff994f6202e7ecadb00e643f15ba28d941c20c9ac5a589
|
Provenance
The following attestation bundles were made for aimigrate-0.2.2-py3-none-any.whl:
Publisher:
publish_pypi.yml on starsimhub/aimigrate
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
aimigrate-0.2.2-py3-none-any.whl -
Subject digest:
f8323b02ea1730eaa24f5e6db5efdbd875ec0e4783c8a608ed6515c286340f26 - Sigstore transparency entry: 175745464
- Sigstore integration time:
-
Permalink:
starsimhub/aimigrate@39de8fd355cd7d7ed562ef370cbd4c1570930f6d -
Branch / Tag:
refs/heads/main - Owner: https://github.com/starsimhub
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish_pypi.yml@39de8fd355cd7d7ed562ef370cbd4c1570930f6d -
Trigger Event:
workflow_run
-
Statement type: