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.
- 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
go install github.com/riceriley59/goanywhere/cmd/goanywhere@latestOr build from source:
git clone https://github.com/riceriley59/goanywhere.git
cd goanywhere
make build# 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- Usage Guide - Detailed usage instructions and examples
| Plugin | Description | Output |
|---|---|---|
cgo |
CGO/C bindings via shared library | main.go (build with -buildmode=c-shared) |
python |
Python ctypes bindings | <package>.py |
# Install dependencies
make install-deps
# Run tests
make test
# Run linter
make lint
# Run all CI checks
make ci