Code Monkey home page Code Monkey logo

goastpy's Introduction

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!

goastpy's People

Contributors

itayg25 avatar

Stargazers

โšก๏ธ avatar Roy O'Young avatar  avatar Nir Shtein avatar

Watchers

 avatar

Forkers

akohjesse

goastpy's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.