{"id":13694400,"url":"https://github.com/go-python/gpython","last_synced_at":"2025-05-14T02:00:16.017Z","repository":{"id":37276259,"uuid":"143203535","full_name":"go-python/gpython","owner":"go-python","description":"gpython is a python interpreter written in go \"batteries not included\"","archived":false,"fork":false,"pushed_at":"2025-03-07T10:17:56.000Z","size":1009,"stargazers_count":923,"open_issues_count":51,"forks_count":95,"subscribers_count":25,"default_branch":"main","last_synced_at":"2025-04-13T23:52:21.819Z","etag":null,"topics":["golang","interpreter","python","python3"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/go-python.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,"publiccode":null,"codemeta":null}},"created_at":"2018-08-01T20:08:19.000Z","updated_at":"2025-04-13T13:21:33.000Z","dependencies_parsed_at":"2023-02-10T17:15:34.821Z","dependency_job_id":"41cfc413-3c1b-4940-8db4-01b0d1b3484b","html_url":"https://github.com/go-python/gpython","commit_stats":{"total_commits":566,"total_committers":19,"mean_commits":"29.789473684210527","dds":0.2544169611307421,"last_synced_commit":"acd458b80be6badfefd1922d4a189f696f7be65e"},"previous_names":["ncw/gpython"],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/go-python%2Fgpython","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/go-python%2Fgpython/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/go-python%2Fgpython/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/go-python%2Fgpython/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/go-python","download_url":"https://codeload.github.com/go-python/gpython/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254052658,"owners_count":22006716,"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","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":["golang","interpreter","python","python3"],"created_at":"2024-08-02T17:01:31.014Z","updated_at":"2025-05-14T02:00:15.923Z","avatar_url":"https://github.com/go-python.png","language":"Go","readme":"# gpython\n\n[![Build Status](https://github.com/go-python/gpython/workflows/CI/badge.svg)](https://github.com/go-python/gpython/actions)\n[![codecov](https://codecov.io/gh/go-python/gpython/branch/main/graph/badge.svg)](https://codecov.io/gh/go-python/gpython)\n[![GoDoc](https://godoc.org/github.com/go-python/gpython?status.svg)](https://godoc.org/github.com/go-python/gpython)\n[![License](https://img.shields.io/badge/License-BSD--3-blue.svg)](https://github.com/go-python/gpython/blob/main/LICENSE)\n\ngpython is a part re-implementation, part port of the Python 3.4\ninterpreter in Go.  Although there are many areas of improvement,\nit stands as an noteworthy achievement in capability and potential.\n \ngpython includes:\n\n  * lexer, parser, and compiler\n  * runtime and high-level convenience functions\n  * multi-context interpreter instancing\n  * easy embedding into your Go application\n  * interactive mode (REPL) ([try online!](https://gpython.org))\n\n\ngpython does not include many python modules as many of the core\nmodules are written in C not python.  The converted modules are:\n\n  * builtins\n  * marshal\n  * math\n  * time\n  * sys\n\n## Install\n\nDownload directly from the [releases page](https://github.com/go-python/gpython/releases) \n\nOr if you have Go installed:\n\n    go install github.com/go-python/gpython\n\n## Objectives\n\ngpython started as an experiment to investigate how hard\nporting Python to Go might be.  It turns out that all those C modules\nare a significant barrier to making gpython a complete replacement\nto CPython.  \n\nHowever, to those who want to embed a highly popular and known language\ninto their Go application, gpython could be a great choice over less\ncapable (or lesser known) alternatives.\n\n## Status\n\ngpython currently:\n - Parses all the code in the Python 3.4 distribution\n - Runs Python 3 for the modules that are currently supported\n - Supports concurrent multi-interpreter (\"multi-context\") execution\n\nSpeed hasn't been a goal of the conversions however it runs pystone at\nabout 20% of the speed of CPython.  A [π computation test](https://github.com/go-python/gpython/tree/main/examples/pi_chudnovsky_bs.py) runs quicker under\ngpython as the Go long integer primitives are likely faster than the\nPython ones.\n\n@ncw started gpython in 2013 and work on is sporadic. If you or someone\nyou know would be interested to take it futher, it would be much appreciated.\n\n## Getting Started\n\nThe [embedding example](https://github.com/go-python/gpython/tree/main/examples/embedding) demonstrates how to\neasily embed and invoke gpython from any Go application.\n\nOf interest, gpython is able to run multiple interpreter instances simultaneously,\nallowing you to embed gpython naturally into your Go application.  This makes it\npossible to use gpython in a server situation where complete interpreter \nindependence is paramount.  See this in action in the [multi-context example](https://github.com/go-python/gpython/tree/main/examples/multi-context).\n \nIf you are looking to get involved, a light and easy place to start is adding more convenience functions to [py/util.go](https://github.com/go-python/gpython/tree/main/py/util.go).  See [notes.txt](https://github.com/go-python/gpython/blob/main/notes.txt) for bigger ideas.\n\n\n## Other Projects of Interest\n\n  * [grumpy](https://github.com/grumpyhome/grumpy) - a python to go transpiler\n\n## Community\n\nYou can chat with the go-python community (or which gpython is part)\nat [go-python@googlegroups.com](https://groups.google.com/forum/#!forum/go-python)\nor on the [Gophers Slack](https://gophers.slack.com/) in the `#go-python` channel.\n\n## License\n\nThis is licensed under the MIT licence, however it contains code which\nwas ported fairly directly directly from the CPython source code under\nthe [PSF LICENSE](https://github.com/python/cpython/blob/main/LICENSE).\n","funding_links":[],"categories":["开源类库","Open source library","Python Implemented in Other Languages","Go","HarmonyOS","Interpreters"],"sub_categories":["解释器","Interpreter","Windows Manager"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgo-python%2Fgpython","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgo-python%2Fgpython","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgo-python%2Fgpython/lists"}