# go-python/gopy

gopy generates a CPython extension module from a go package.

Repository: https://github.com/go-python/gopy
Canonical: https://ross.abutalabs.com/products/gopy
Language: Go
License: BSD-3-Clause
License Family: permissive
Topics: go, golang, python, python-2, python-3, pypy, cffi, ctypes
Last push: 2026-08-25T01:11:29+00:00

## Health v2 (maintenance only)
Score: 88/100 (v2, computed 2026-09-03T02:20:16.233290+00:00)
- activity 99, release rhythm 67, longevity 100
- inputs: {"age_days": 4233, "days_push": 9, "days_rel": 9, "gap_med": null, "n_releases_24m": 1}
- flags: none
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 2327, forks 136 (observed 2026-08-28T04:06:37.516783+00:00)

## What it is
gopy is a command-line tool that generates and compiles CPython extension modules from Go packages, letting Python code call Go code directly. It uses int64 handles for safe garbage-collector interop and supports callbacks from Go into Python and struct-based class inheritance in the generated wrappers.

## Use cases
- call a Go library from Python
- generate Python bindings for a Go package
- use Go code in a Python project
- wrap a Go SDK for Python users
- expose Go functions as a CPython extension module
- run Go GUI libraries from Python scripts

## When to choose
- you have an existing Go package and want to use it from CPython
- you need tight, compiled bindings rather than a subprocess or HTTP bridge
- you need Go-to-Python callbacks and Go struct inheritance mapped to Python classes

## When to avoid
- you need PyPy support without extra work (cffi path is not the default)
- you want pure-Python packages with no compilation step
- your Go package relies on features gopy cannot wrap

## Facets
- artifact type: cli-tool
- maturity: active
- function: compiler, developer-tools, sdk
- domain: developer-tools, programming-languages, cross-platform
- platform: windows, go, python, cli
- tags: go-bindings, cpython-extension, python-bindings, interop, cgo, pybindgen, linux, macos

## Member repositories
- go-python/gopy (main) score 88

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:06:37.516783+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-30T02:38:13.902197+00:00, confidence not recorded.
  - readme: https://github.com/go-python/gopy (fetched 2026-08-28T04:06:37.516783+00:00, sha 97423d72fda7)
- Data as of 2026-08-30T08:39:29.467469+00:00.
