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
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 Distributions
No source distribution files available for this release.See tutorial on generating distribution archives.
Built Distribution
Close
Hashes for pyalect-0.1.0.dev0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 27673c9859d572744a89c0b0e089b7a201d8a96ec38fe1e26d23552e4cb13b3a |
|
MD5 | 17909d9b6039aa0c2c4ee3dc6fc237c8 |
|
BLAKE2b-256 | d0bf189f878c8f45665c75f8a99b30675fb960e3228adfd999d0511e5e491db6 |