Skip to main content

a python wrapper for the built-in go parser using c-types

Project description

gopyast

python wrapper for the built-in go ast parser

installation

pip install goastpy

usage:

import goastpy


if __name__ == '__main__':
    code = '''
    package main

    import "fmt"

    func main() {
        fmt.Println("Hello, World!")
    }
    '''
    parsed_code = goastpy.GoAst(code)
    print(parsed_code.ast)

building the c-shared golang files:

cd ./goastpy

go build -o goastparser.so -buildmode=c-shared main.go goastparser_export.go

Project details


Download files

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

Source Distribution

goastpy-0.1.7.tar.gz (1.6 MB view hashes)

Uploaded Source

Built Distribution

goastpy-0.1.7-py3-none-any.whl (3.2 MB 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