Skip to main content

No project description provided

Project description

Pyalect

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)

Examples:

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 Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page