Skip to content

Generate language bindings for your Go libraries to use them from Python, C, and other languages.

License

Notifications You must be signed in to change notification settings

riceriley59/goanywhere

Repository files navigation

GoAnywhere

CI Go Report Card Coverage Status License: Apache 2.0

Generate language bindings for your Go libraries to use them from Python, C, and other languages.

GoAnywhere parses your Go packages and generates wrapper code that exposes your functions and structs to other languages through CGO shared libraries or Python ctypes bindings.

Features

  • Parse Go packages and extract exported functions, structs, and methods
  • Generate CGO bindings for C-compatible shared libraries
  • Generate Python ctypes bindings for direct Python integration
  • Automatic type mapping between Go and target languages
  • Handle complex types: slices, maps, pointers, and custom structs

Installation

go install github.com/riceriley59/goanywhere/cmd/goanywhere@latest

Or build from source:

git clone https://github.com/riceriley59/goanywhere.git
cd goanywhere
make build

Quick Start

# Generate CGO bindings (default)
goanywhere generate ./mypackage

# Generate Python bindings
goanywhere generate ./mypackage --plugin python

# Build CGO shared library directly
goanywhere build ./mypackage --plugin cgo

# Build Python package with shared library
goanywhere build ./mypackage --plugin python

Documentation

  • Usage Guide - Detailed usage instructions and examples

Supported Plugins

Plugin Description Output
cgo CGO/C bindings via shared library main.go (build with -buildmode=c-shared)
python Python ctypes bindings <package>.py

Development

# Install dependencies
make install-deps

# Run tests
make test

# Run linter
make lint

# Run all CI checks
make ci

About

Generate language bindings for your Go libraries to use them from Python, C, and other languages.

Resources

License

Contributing

Stars

Watchers

Forks

Packages

No packages published