Skip to main content

Python Wrapper for Go AST Parser

Project description

GoAstPy - Python Wrapper for Go AST Parser

GitHub license GitHub issues GitHub forks GitHub stars PyPI version Downloads

GoAstPy is a Python wrapper for the built-in Go Abstract Syntax Tree (AST) parser. It allows you to parse and manipulate Go source code from within your Python applications. This package is perfect for developers working with Go code analysis, code generation, or automated refactoring tools in Python.

🚀 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)

With GoAstPy, you can quickly and easily parse Go source code, extract information about its structure, and work with it in your Python projects.

🛠️ Building the Go Shared Library

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

This command generates a shared library file (goastparser.so) that is used by the Python wrapper to interface with the Go AST parser.

🔖 GitHub Tags

  • golang
  • python
  • ast
  • go-ast-parser
  • code-analysis
  • code-generation
  • refactoring

📖 License

This project is licensed under the MIT License.

🌟 Contributing

We welcome contributions from the community! If you find a bug or have a feature request, please open an issue or submit a pull request. Let's make GoAstPy even better together!

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.10.tar.gz (4.7 MB view details)

Uploaded Source

Built Distribution

goastpy-0.1.10-py3-none-any.whl (4.7 MB view details)

Uploaded Python 3

File details

Details for the file goastpy-0.1.10.tar.gz.

File metadata

  • Download URL: goastpy-0.1.10.tar.gz
  • Upload date:
  • Size: 4.7 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.16

File hashes

Hashes for goastpy-0.1.10.tar.gz
Algorithm Hash digest
SHA256 82a689936f1f0e25f717e1336834a47718561d59b93fbbffb132adfd1e66ace8
MD5 940ad80676bc717b689047e0e7c1449f
BLAKE2b-256 d8777a790a61c70d572cd01b5c9a549fff557472b414a9715b9a792019ed7639

See more details on using hashes here.

File details

Details for the file goastpy-0.1.10-py3-none-any.whl.

File metadata

  • Download URL: goastpy-0.1.10-py3-none-any.whl
  • Upload date:
  • Size: 4.7 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.16

File hashes

Hashes for goastpy-0.1.10-py3-none-any.whl
Algorithm Hash digest
SHA256 dfaadc0aafd851feb5c72655881be022112a4798d9637dcb48b259469fce4469
MD5 350c5d8ee4ac4731f5d2bc461fce98d2
BLAKE2b-256 88e9921e8eb6a4cd3ec2d361957862003915de2f0edb3a15fa1a1d0707d2bc9f

See more details on using hashes here.

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