# **Overview**
Full documentation available [here](https://autotransform.readthedocs.io)
Check out our [tutorial videos](https://www.youtube.com/watch?v=JGtzxWqa6s0&list=PLw32rS7srmZYUV3VfE114ZLYqHzQc9wY9)
## **Installing**
> **⚠ WARNING:** AutoTransform requires Python 3.10
- **Latest Release** `pip install AutoTransform`
- **Bleeding Edge** `pip install git+git://github.com/nathro/AutoTransform.git`
- Windows users may need to replace `git://` with `https://`
After installing via pip, AutoTransform can be initialized using `autotransform init`. If called within a git repo, this script will also initialize the repo to use AutoTransform. For a simple setup experience, run `autotransform init --simple --github` or `autotransform init --simple --no-github`
## **Summary**
AutoTransform is an opensource framework for large-scale code modification. It enables a schema-based system of defining codemods that can then be run using AutoTransform, with options for automatic scheduling as well as change management. AutoTransform leverages a component-based model that allows adopters to quickly and easily get whatever behavior they need through the creation of new, custom components. Additionally, custom components can readily be added to the component library of AutoTransform to be shared more widely with others using the framework.
## **Goal**
The goal of AutoTransform is to make codebase modification simple, easy, and automatic. By providing a clear structure for definition, all types of modifications can be automated. Some examples include:
* Library upgrades
* API changes
* Performance improvements
* Lint or style fixes
* Unused code
* One-off refactors
* Any other programmatically definable modification
## **Philosophies**
There are a core set of philosphies that guide AutoTransform's development. These drive decisions around functionality, implementation details, and best practies.
### **Components Are Best**
AutoTransform heavily uses a component based model for functionality. This allows easy customization through the creation of new plug-and-play components. Core logic is about funneling information between components, while the components themselves contain business logic. While AutoTransform provides an ever-growing library of components for ease of adoption, bespoke components will always be needed for some use cases.
### **Support All Languages**
AutoTransform, though written in Python, is a language agnostic framework. Our component model allows AutoTransform to treat each component as a black-box that can leverage whatever tooling or language makes sense for the goal of the component. This is most heavily needed for the components which actually make code changes where leveraging tools for Abstract(or Concrete) Syntax Trees(AST/CST) is often done in the language being modified.
### **Value Developer Time**
Managing large scale changes can be extremely time consuming, AutoTransform puts automation first with the goal of automating as much of the process as possible. Developer time is incredibly valuable and should be saved for things that actually require it. If a computer can do it, a computer should do it.
## **Example - Typing**
As an example of how AutoTransform might be used, let’s go through the case of typing a legacy codebase. This is a notoriously difficult and time consuming process.
### **Static Inference**
A codemod can be written that statically infers types from the types around whatever needs typing. Hooking this up to scheduled runs would mean that as people type your code, other types can later be inferred. Additionally, as the codemod types code, that can reveal further types that can be statically inferred. This would allow typing to slowly build up over time automatically as the codemod runs and developers introduce more types themselves, significantly speeding up the process of typing a legacy codebase.
### **Run Time Logging**
In addition to static typing, a codemod could instrument untyped functions or other code to log types at run time. These logs could then be fed into the codemod to add types to code that can’t be inferred but can be determined at run time. This codemod could additionally be written to only instrument a small part of the codebase at a given time, preventing excessive resource utilization.
### **The Whole Versus the Sum of the Parts**
Each codemod that can change code can benefit from all other codemods. As run time logging adds types, static inference can make better changes. Dead code removal can clean up untyped code. The layered passes, and building on top of the changes of each codemod, can produce significantly greater wins.
Raw data
{
"_id": null,
"home_page": "https://github.com/nathro/AutoTransform",
"name": "AutoTransform",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.9",
"maintainer_email": null,
"keywords": "codemod, automation, code change, codeshift, transformation, maintain",
"author": "Nathan Rockenbach",
"author_email": "nathro.software@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/9d/f8/9143126ec584c3ce055153c6e967f1c8dacbe656bbfc321acd0a03f571ee/autotransform-1.1.1.post3.tar.gz",
"platform": null,
"description": "# **Overview**\n\nFull documentation available [here](https://autotransform.readthedocs.io)\nCheck out our [tutorial videos](https://www.youtube.com/watch?v=JGtzxWqa6s0&list=PLw32rS7srmZYUV3VfE114ZLYqHzQc9wY9)\n\n## **Installing**\n\n> **\u26a0 WARNING:** AutoTransform requires Python 3.10\n\n - **Latest Release** `pip install AutoTransform`\n - **Bleeding Edge** `pip install git+git://github.com/nathro/AutoTransform.git`\n - Windows users may need to replace `git://` with `https://`\n\nAfter installing via pip, AutoTransform can be initialized using `autotransform init`. If called within a git repo, this script will also initialize the repo to use AutoTransform. For a simple setup experience, run `autotransform init --simple --github` or `autotransform init --simple --no-github`\n## **Summary**\n\nAutoTransform is an opensource framework for large-scale code modification. It enables a schema-based system of defining codemods that can then be run using AutoTransform, with options for automatic scheduling as well as change management. AutoTransform leverages a component-based model that allows adopters to quickly and easily get whatever behavior they need through the creation of new, custom components. Additionally, custom components can readily be added to the component library of AutoTransform to be shared more widely with others using the framework.\n\n## **Goal**\n\nThe goal of AutoTransform is to make codebase modification simple, easy, and automatic. By providing a clear structure for definition, all types of modifications can be automated. Some examples include:\n\n* Library upgrades\n* API changes\n* Performance improvements\n* Lint or style fixes\n* Unused code\n* One-off refactors\n* Any other programmatically definable modification\n\n## **Philosophies**\n\nThere are a core set of philosphies that guide AutoTransform's development. These drive decisions around functionality, implementation details, and best practies.\n\n### **Components Are Best**\n\nAutoTransform heavily uses a component based model for functionality. This allows easy customization through the creation of new plug-and-play components. Core logic is about funneling information between components, while the components themselves contain business logic. While AutoTransform provides an ever-growing library of components for ease of adoption, bespoke components will always be needed for some use cases.\n\n### **Support All Languages**\n\nAutoTransform, though written in Python, is a language agnostic framework. Our component model allows AutoTransform to treat each component as a black-box that can leverage whatever tooling or language makes sense for the goal of the component. This is most heavily needed for the components which actually make code changes where leveraging tools for Abstract(or Concrete) Syntax Trees(AST/CST) is often done in the language being modified.\n\n### **Value Developer Time**\n\nManaging large scale changes can be extremely time consuming, AutoTransform puts automation first with the goal of automating as much of the process as possible. Developer time is incredibly valuable and should be saved for things that actually require it. If a computer can do it, a computer should do it.\n\n## **Example - Typing**\n\nAs an example of how AutoTransform might be used, let\u2019s go through the case of typing a legacy codebase. This is a notoriously difficult and time consuming process.\n\n### **Static Inference**\n\nA codemod can be written that statically infers types from the types around whatever needs typing. Hooking this up to scheduled runs would mean that as people type your code, other types can later be inferred. Additionally, as the codemod types code, that can reveal further types that can be statically inferred. This would allow typing to slowly build up over time automatically as the codemod runs and developers introduce more types themselves, significantly speeding up the process of typing a legacy codebase.\n\n### **Run Time Logging**\n\nIn addition to static typing, a codemod could instrument untyped functions or other code to log types at run time. These logs could then be fed into the codemod to add types to code that can\u2019t be inferred but can be determined at run time. This codemod could additionally be written to only instrument a small part of the codebase at a given time, preventing excessive resource utilization.\n\n### **The Whole Versus the Sum of the Parts**\n\nEach codemod that can change code can benefit from all other codemods. As run time logging adds types, static inference can make better changes. Dead code removal can clean up untyped code. The layered passes, and building on top of the changes of each codemod, can produce significantly greater wins.\n",
"bugtrack_url": null,
"license": null,
"summary": "A component based framework for designing automated code modification",
"version": "1.1.1.post3",
"project_urls": {
"Bug Tracker": "https://github.com/nathro/AutoTransform/issues",
"Homepage": "https://github.com/nathro/AutoTransform",
"Source": "https://github.com/nathro/AutoTransform/"
},
"split_keywords": [
"codemod",
" automation",
" code change",
" codeshift",
" transformation",
" maintain"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "a76aa865599a805d1e559e943f18476ae76518ee64a0993214bf404a26a9f8fd",
"md5": "05ee024d3df0852accff63f8ec4f8dff",
"sha256": "87b3b9238361d1eb82e6b21b3e8d96fc45ecddf841ee4290b724be55855a4f27"
},
"downloads": -1,
"filename": "AutoTransform-1.1.1.post3-py3-none-any.whl",
"has_sig": false,
"md5_digest": "05ee024d3df0852accff63f8ec4f8dff",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.9",
"size": 202863,
"upload_time": "2024-06-28T20:10:49",
"upload_time_iso_8601": "2024-06-28T20:10:49.958011Z",
"url": "https://files.pythonhosted.org/packages/a7/6a/a865599a805d1e559e943f18476ae76518ee64a0993214bf404a26a9f8fd/AutoTransform-1.1.1.post3-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "9df89143126ec584c3ce055153c6e967f1c8dacbe656bbfc321acd0a03f571ee",
"md5": "24cb63517e9647fd2eb1f8fac30ffeda",
"sha256": "967c8e660bf74115e3e92cc6952e63be9e4768f1f54edef47fbfea1c0789d21a"
},
"downloads": -1,
"filename": "autotransform-1.1.1.post3.tar.gz",
"has_sig": false,
"md5_digest": "24cb63517e9647fd2eb1f8fac30ffeda",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.9",
"size": 110512,
"upload_time": "2024-06-28T20:10:52",
"upload_time_iso_8601": "2024-06-28T20:10:52.610476Z",
"url": "https://files.pythonhosted.org/packages/9d/f8/9143126ec584c3ce055153c6e967f1c8dacbe656bbfc321acd0a03f571ee/autotransform-1.1.1.post3.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-06-28 20:10:52",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "nathro",
"github_project": "AutoTransform",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"requirements": [],
"lcname": "autotransform"
}