Home

Awesome

py2star

Converts python files to starlark files

Get started quickly

Setup

python -m venv venv
source venv/bin/activate
python setup.py install

Run

cd src/py2star
python cli.py larkify ~/src/pycryptodome/lib/Crypto/SelfTest/PublicKey/test_RSA.py > test_RSA.star
python cli.py tests test_RSA.star >> test_RSA.star

Differences with Python

The list of differences between Starlark and Python are documented at https://bazel.build site:

Some High-level Differences

The following Python features are attempted to be automatically converted:

Automatic Conversion

So, it goes from:

class Foo(object):
    def bar(self):
        return "baz"

To:

def bar(self):
    return "baz"