AutoTransform


NameAutoTransform JSON
Version 1.1.1 PyPI version JSON
download
home_pagehttps://github.com/nathro/AutoTransform
SummaryA component based framework for designing automated code modification
upload_time2024-04-22 21:37:06
maintainerNone
docs_urlNone
authorNathan Rockenbach
requires_python>=3.9
licenseNone
keywords codemod automation code change codeshift transformation maintain
VCS
bugtrack_url
requirements GitPython ghapi typing-extensions colorama pytz pydantic libcst codeowners requests openai anthropic black mypy types-colorama types-mock types-pytz types-requests pylint pytest mock build twine
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # **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/f4/8d/fca0a48919a7e6022fc3bb680fa5b0b2e1ada1aa3f5f444e602f065a5f12/autotransform-1.1.1.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",
    "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": "76b63bceac6fa80977ac27eee8dd03348939f53489b50bcd841c404c3c1ea6d9",
                "md5": "0beb310f95d59c9652380469a28ad1a6",
                "sha256": "7606ff1f3d68b5a302077ba6d753b596d68c60f3ca501443625817a2c7dbb5c9"
            },
            "downloads": -1,
            "filename": "AutoTransform-1.1.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "0beb310f95d59c9652380469a28ad1a6",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.9",
            "size": 201939,
            "upload_time": "2024-04-22T21:37:04",
            "upload_time_iso_8601": "2024-04-22T21:37:04.103471Z",
            "url": "https://files.pythonhosted.org/packages/76/b6/3bceac6fa80977ac27eee8dd03348939f53489b50bcd841c404c3c1ea6d9/AutoTransform-1.1.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "f48dfca0a48919a7e6022fc3bb680fa5b0b2e1ada1aa3f5f444e602f065a5f12",
                "md5": "a7da44763f7f6bfa4aa211818be45135",
                "sha256": "3be05e488e0aa0f8349f71c824627c289d98265ad22d1e8b588466292684a942"
            },
            "downloads": -1,
            "filename": "autotransform-1.1.1.tar.gz",
            "has_sig": false,
            "md5_digest": "a7da44763f7f6bfa4aa211818be45135",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.9",
            "size": 109815,
            "upload_time": "2024-04-22T21:37:06",
            "upload_time_iso_8601": "2024-04-22T21:37:06.499593Z",
            "url": "https://files.pythonhosted.org/packages/f4/8d/fca0a48919a7e6022fc3bb680fa5b0b2e1ada1aa3f5f444e602f065a5f12/autotransform-1.1.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-04-22 21:37:06",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "nathro",
    "github_project": "AutoTransform",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "requirements": [
        {
            "name": "GitPython",
            "specs": [
                [
                    "==",
                    "3.1.43"
                ]
            ]
        },
        {
            "name": "ghapi",
            "specs": [
                [
                    "==",
                    "1.0.3"
                ]
            ]
        },
        {
            "name": "typing-extensions",
            "specs": [
                [
                    "==",
                    "4.5.0"
                ]
            ]
        },
        {
            "name": "colorama",
            "specs": [
                [
                    "==",
                    "0.4.6"
                ]
            ]
        },
        {
            "name": "pytz",
            "specs": [
                [
                    "==",
                    "2022.7.1"
                ]
            ]
        },
        {
            "name": "pydantic",
            "specs": [
                [
                    "==",
                    "1.10.4"
                ]
            ]
        },
        {
            "name": "libcst",
            "specs": [
                [
                    "==",
                    "0.4.9"
                ]
            ]
        },
        {
            "name": "codeowners",
            "specs": [
                [
                    "==",
                    "0.6.0"
                ]
            ]
        },
        {
            "name": "requests",
            "specs": [
                [
                    "==",
                    "2.31.0"
                ]
            ]
        },
        {
            "name": "openai",
            "specs": [
                [
                    "==",
                    "0.27.8"
                ]
            ]
        },
        {
            "name": "anthropic",
            "specs": [
                [
                    "==",
                    "0.5.0"
                ]
            ]
        },
        {
            "name": "black",
            "specs": [
                [
                    "==",
                    "23.1.0"
                ]
            ]
        },
        {
            "name": "mypy",
            "specs": [
                [
                    "==",
                    "0.991"
                ]
            ]
        },
        {
            "name": "types-colorama",
            "specs": [
                [
                    "==",
                    "0.4.15.5"
                ]
            ]
        },
        {
            "name": "types-mock",
            "specs": [
                [
                    "==",
                    "5.0.0.2"
                ]
            ]
        },
        {
            "name": "types-pytz",
            "specs": [
                [
                    "==",
                    "2022.7.1.0"
                ]
            ]
        },
        {
            "name": "types-requests",
            "specs": [
                [
                    "==",
                    "2.28.11.8"
                ]
            ]
        },
        {
            "name": "pylint",
            "specs": [
                [
                    "==",
                    "2.16.0"
                ]
            ]
        },
        {
            "name": "pytest",
            "specs": [
                [
                    "==",
                    "7.2.1"
                ]
            ]
        },
        {
            "name": "mock",
            "specs": [
                [
                    "==",
                    "5.0.1"
                ]
            ]
        },
        {
            "name": "build",
            "specs": [
                [
                    "==",
                    "0.10.0"
                ]
            ]
        },
        {
            "name": "twine",
            "specs": [
                [
                    "==",
                    "4.0.2"
                ]
            ]
        }
    ],
    "lcname": "autotransform"
}
        
Elapsed time: 0.24918s