Skip to main content

No project description provided

Project description


Dynamically transpiling Python for Good

Console Usage

pyalect (activate | deactivate)
pyalect register <transpiler> as <dialect> [--force]
pyalect deregister (<dialect> | <transpiler> [as <dialect])
pyalect config (show | path)


pyalect register my_module:MyTranspiler as my_dialect
pyalect activate
pyalect config show

Programatic Usage

import ast
import pyalect

class MyTranspiler:

    def transform_src(self, source: str) -> str:
        # modify src ...
        return new_src

    def transform_ast(self, node: ast.AST) -> ast.AST:
        # modify AST ...
        return node

# this will only be applied within the current interpreter
pyalect.register("my_dialect", MyTranspiler)

Indicating Dialects

# dialect=my_dialect

IPython and Jupyter Support

Dialects are supported in IPython and Jupyter via magics:

%%dialect html

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release. See tutorial on generating distribution archives.

Built Distribution

pyalect-0.1.0.dev0-py3-none-any.whl (8.3 kB view hashes)

Uploaded py3

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page