{"id":13412724,"url":"https://github.com/sbinet/go-python","last_synced_at":"2025-09-29T00:32:44.569Z","repository":{"id":52910039,"uuid":"4960374","full_name":"sbinet/go-python","owner":"sbinet","description":"naive go bindings to the CPython2 C-API","archived":true,"fork":false,"pushed_at":"2023-07-24T07:11:30.000Z","size":193,"stargazers_count":1529,"open_issues_count":27,"forks_count":139,"subscribers_count":48,"default_branch":"master","last_synced_at":"2025-04-03T22:42:02.350Z","etag":null,"topics":["cgo","go","golang","python2"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sbinet.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2012-07-09T15:43:31.000Z","updated_at":"2025-04-02T05:27:36.000Z","dependencies_parsed_at":"2024-01-30T04:55:46.284Z","dependency_job_id":null,"html_url":"https://github.com/sbinet/go-python","commit_stats":{"total_commits":158,"total_committers":18,"mean_commits":8.777777777777779,"dds":0.5759493670886076,"last_synced_commit":"d6ca9f284dab685f42c80cd635ef9169aa5f2afc"},"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/sbinet/go-python","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sbinet%2Fgo-python","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sbinet%2Fgo-python/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sbinet%2Fgo-python/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sbinet%2Fgo-python/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sbinet","download_url":"https://codeload.github.com/sbinet/go-python/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sbinet%2Fgo-python/sbom","scorecard":{"id":802701,"data":{"date":"2025-08-11","repo":{"name":"github.com/sbinet/go-python","commit":"9a5a20a386a7281f0ef1f7af682c54c7f32a30de"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.4,"checks":[{"name":"Code-Review","score":3,"reason":"Found 8/24 approved changesets -- score normalized to 3","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Maintained","score":0,"reason":"project is archived","details":["Warn: Repository is archived."],"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":9,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Warn: project license file does not contain an FSF or OSI license."],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 23 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-23T10:55:47.713Z","repository_id":52910039,"created_at":"2025-08-23T10:55:47.713Z","updated_at":"2025-08-23T10:55:47.713Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":277450939,"owners_count":25819971,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-09-28T02:00:08.834Z","response_time":79,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["cgo","go","golang","python2"],"created_at":"2024-07-30T20:01:28.366Z","updated_at":"2025-09-29T00:32:44.297Z","avatar_url":"https://github.com/sbinet.png","language":"Go","funding_links":[],"categories":["Embeddable Scripting Languages","Go","Repositories","HarmonyOS","可嵌入的脚本语言","Relational Databases","脚本语言与嵌入式编程`在你的go代码中嵌入其他脚本语言`","\u003cspan id=\"嵌入式脚本语言-embeddable-scripting-languages\"\u003e嵌入式脚本语言 Embeddable Scripting Languages\u003c/span\u003e","脚本语言与嵌入式编程"],"sub_categories":["Advanced Console UIs","Search and Analytic Databases","Windows Manager","检索及分析资料库","SQL 查询语句构建库","\u003cspan id=\"高级控制台用户界面-advanced-console-uis\"\u003e高级控制台用户界面 Advanced Console UIs\u003c/span\u003e"],"readme":"go-python\n=========\n\n**`sbinet/go-python` only supports CPython2. CPython2 isn't supported anymore by [python.org](https://python.org). Thus, `sbinet/go-python` is now archived.**\n**A possible alternative may be to use and contribute to [go-python/cpy3](https://github.com/go-python/cpy3) instead.**\n\n[![Build Status](https://travis-ci.org/sbinet/go-python.svg?branch=master)](https://travis-ci.org/sbinet/go-python)\n[![Build status](https://ci.appveyor.com/api/projects/status/n0ujg8no487a89vo/branch/master?svg=true)](https://ci.appveyor.com/project/sbinet/go-python/branch/master)\n[![GoDocs](https://godocs.io/github.com/sbinet/go-python?status.svg)](https://godocs.io/github.com/sbinet/go-python)\n\nNaive `go` bindings towards the C-API of CPython-2.\n\nthis package provides a ``go`` package named \"python\" under which most of the ``PyXYZ`` functions and macros of the public C-API of CPython have been exposed.\n\ntheoretically, you should be able to just look at:\n\n  http://docs.python.org/c-api/index.html\n\nand know what to type in your ``go`` program.\n\n\nthis package also provides an executable \"go-python\" which just loads \"python\" and then call ``python.Py_Main(os.Args)``.\nthe rational being that under such an executable, ``go`` based extensions for C-Python would be easier to implement (as this usually means calling into ``go`` from ``C`` through some rather convoluted functions hops)\n\n\n## Install\n\nWith `Go 1` and the ``go`` tool, ``cgo`` packages can't pass anymore\nadditional ``CGO_CFLAGS`` from external programs (except `pkg-config`)\nto the \"fake\" ``#cgo`` preprocessor directive.\n\n``go-python`` now uses ``pkg-config`` to get the correct location of\nheaders and libraries.\nUnfortunately, the naming convention for the ``pkg-config`` package is\nnot standardised across distributions and OSes, so you may have to\nedit the ``cgoflags.go`` file accordingly.\n\n```sh\n $ go get github.com/sbinet/go-python\n```\n\nIf ``go get`` + ``pkg-config`` failed:\n\n```sh\n $ cd go-python\n $ edit cgoflags.go\n $ make VERBOSE=1\n```\n\n*Note*: you'll need the proper header and `python` development environment. On Debian, you'll need to install the ``python-all-dev`` package\n\nDocumentation\n-------------\n\nIs available on ``godocs``:\n\n https://godocs.io/github.com/sbinet/go-python\n\n\nExample:\n--------\n\n```go\npackage main\n\nimport \"fmt\"\nimport \"github.com/sbinet/go-python\"\n\nfunc init() {\n   err := python.Initialize()\n   if err != nil {\n          panic(err.Error())\n   } \n}\n\nfunc main() {\n \t gostr := \"foo\" \n\t pystr := python.PyString_FromString(gostr)\n\t str := python.PyString_AsString(pystr)\n\t fmt.Println(\"hello [\", str, \"]\")\n}\n```\n\n```sh\n$ go run ./main.go\nhello [ foo ]\n```\n\nTODO:\n-----\n\n - fix handling of integers (I did a poor job at making sure everything was ok)\n\n - add CPython unit-tests\n\n - do not expose ``C.FILE`` pointer and replace it with ``os.File`` in \"go-python\" API\n\n - provide an easy way to extend go-python with ``go`` based extensions\n\n - think about the need (or not) to translate CPython exceptions into go panic/recover mechanism\n\n - use SWIG to automatically wrap the whole CPython api ?\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsbinet%2Fgo-python","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsbinet%2Fgo-python","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsbinet%2Fgo-python/lists"}