{"id":37177865,"url":"https://github.com/debevv/go-python3","last_synced_at":"2026-01-14T20:44:14.308Z","repository":{"id":57567588,"uuid":"341348068","full_name":"debevv/go-python3","owner":"debevv","description":"Go bindings to the CPython-3 API","archived":false,"fork":true,"pushed_at":"2021-02-24T23:24:08.000Z","size":77,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-12-17T14:55:52.094Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"DataDog/go-python3","license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/debevv.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-02-22T21:54:11.000Z","updated_at":"2021-02-24T23:24:10.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/debevv/go-python3","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/debevv/go-python3","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/debevv%2Fgo-python3","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/debevv%2Fgo-python3/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/debevv%2Fgo-python3/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/debevv%2Fgo-python3/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/debevv","download_url":"https://codeload.github.com/debevv/go-python3/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/debevv%2Fgo-python3/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28434497,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T18:57:19.464Z","status":"ssl_error","status_checked_at":"2026-01-14T18:52:48.501Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-01-14T20:44:13.554Z","updated_at":"2026-01-14T20:44:14.295Z","avatar_url":"https://github.com/debevv.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# go-python3\n\n**Currently supports python-3.7 only.**\n\nGolang bindings for the C-API of CPython-3.\n\nThis package provides a ``go`` package named \"python\" under which most of the\n``PyXYZ`` functions and macros of the public C-API of CPython have been\nexposed. Theoretically, you should be able use https://docs.python.org/3/c-api\nand know what to type in your ``go`` program.\n\n\nThis project was inspired by https://github.com/sbinet/go-python. Go and take a look if we need something for python-2.7!\n\n# Install\n\n## Deps\n\nWe will need `pkg-config` and a working `python3.7` environment to build these\nbindings. Make sure you have Python libraries and header files installed as\nwell (`python3.7-dev` on Debian or `python3-devel` on Centos for example)..\n\nBy default `pkg-config` will look at the `python3` library so if you want to\nchoose a specific version just symlink `python-X.Y.pc` to `python3.pc` or use\nthe `PKG_CONFIG_PATH` environment variable.\n\n## Go get\n\nThen simply `go get github.com/DataDog/go-python3`\n\n# API\n\nSome functions mix go code and call to Python function. Those functions will\nreturn and `int` and `error` type. The `int` represent the Python result code\nand the `error` represent any issue from the Go layer.\n\nExample:\n\n`func PyRun_AnyFile(filename string)` open `filename` and then call CPython API\nfunction `int PyRun_AnyFile(FILE *fp, const char *filename)`.\n\nTherefore its signature is `func PyRun_AnyFile(filename string) (int, error)`,\nthe `int` represent the error code from the CPython `PyRun_AnyFile` function\nand error will be set if we failed to open `filename`.\n\nIf an error is raise before calling th CPython function `int` default to `-1`.\n\nTake a look at some [examples](examples)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdebevv%2Fgo-python3","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdebevv%2Fgo-python3","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdebevv%2Fgo-python3/lists"}