{ "info": { "author": "Juan Carlos", "author_email": "juancarlospaco@gmail.com", "bugtrack_url": null, "classifiers": [ "Environment :: Console", "Environment :: No Input/Output (Daemon)", "Environment :: Other Environment", "Intended Audience :: Developers", "Intended Audience :: Other Audience", "Intended Audience :: System Administrators", "Natural Language :: English", "Operating System :: MacOS :: MacOS X", "Operating System :: OS Independent", "Operating System :: POSIX :: Linux", "Programming Language :: Python", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3 :: Only", "Programming Language :: Python :: Implementation :: CPython", "Topic :: Software Development", "Topic :: Software Development :: Libraries", "Topic :: Software Development :: Libraries :: Python Modules" ], "description": "# Gothon\n\nPython 3 modules written on pure Go. No CFFI, no CTypes, no CGo, no PyBindGen, just import `*.go` files from Python.\n\nIt works using IPC RPC. Inspired by [Cythons `pyximport`](http://cython.readthedocs.io/en/latest/src/tutorial/cython_tutorial.html?highlight=pyximport#pyximport-cython-compilation-for-developers) and [CPPImport](https://github.com/tbenthompson/cppimport#import-c-or-c-files-directly-from-python). Designed to speed up Python using Go.\n\nOpen Repo access to anyone who want to contribute, just contact me. **This is a Work In Progress.**\n\n![screenshot](https://source.unsplash.com/FqkBXo2Nkq0/850x420 \"Illustrative Photo by https://unsplash.com/@stickermule\")\n\n\n# Use\n\n```python\n$ ls\ngothon.py python_module.go\n\n$ python\nPython 3.6.4 (default, Jan 5 2018, 02:35:40)\n\n>>> import gothon # Import & enable Gothon.\n>>> gothon.import_hook()\n>>> import python_module # Import *.go files.\n>>> repr(python_module)\n''\n>>> python_module.__doc__\n'Gothon runs GO Code from Python using IPC RPC JSON.'\n>>> worker = python_module.start()\n>>> worker.call(\"Echo.Echo\", \"Hello from Python to Go\")\n'Hello from Python to Go'\n>>>\n```\n\n\n# Install\n\n```\npip install gothon\n```\n- Uninstall `pip uninstall gothon`\n\n\n# Documentation\n\n
\n gothon.py\n\n**Description:**\nGothon runs GO Code from Python using IPC RPC JSON.\n\nUnix Socket are used because from benchmarks it performs 3x faster than TCP/UDP Sockets.\n\nThis does not connect to the network, nor internet, nor use HTTP.\n\nDelegates the Parse, Compile, Build and Cache to Go itself.\n\nThis project is oriented to Developers, NOT end-users.\n\nThis project can be used with Fades, FireJails, Docker, RKT.\n\nThis project assumes at least very basic knowledge of the Go programming language.\n\nFeel free to contact us if you need help integrating it on your project.\n\n**Arguments:**\n- `go_file` A GO file to compile and run as a python module, string type, defaults to `python_module.go`, required.\n- `startup_delay` A startup delay, after building the go file but before returning the IPC RPC to Python, float type, defaults to `0.1`, optional.\n\n**Keyword Arguments:** None.\n\n**Returns:** `gothon.RPCJSONClient()` an custom IPC RPC.\n\n**Base Class:** `object`.\n\n**Type:** `object`.\n\n**Source Code file:** https://github.com/juancarlospaco/gothon/blob/master/gothon.py\n\n| State | OS | Description |\n| ------------------ |:-----------:| -----------:|\n| :white_check_mark: | **Linux** | Works Ok |\n| :white_check_mark: | **Os X** | Works Ok |\n\n**Usage Example:**\n\n```python\n>>> from gothon import Gothon\n>>> unemployed = Gothon()\n>>> worker = unemployed.start()\n>>> worker.call(\"Echo.Echo\", \"Hello from Python to Go\")\n'Hello from Python to Go'\n>>> worker.stop()\n>>>\n```\n\n
\n\n\n# Requisites\n\n- [Python 3.6+](https://python.org)\n- [Go 1.10+](https://golang.org)\n\n\n##### Troubleshoot\n\n
\n Not working\n\n- Delete all `__pycache__` and `*.pyc`.\n- Execute `go clean -x -cache` (Usually Go takes care of cleaning Cache automatically).\n- Update your Go to the latest version.\n
\n\n\n# Why\n\nThings that Ive tried and didnt work (2018, Linux):\n\n- https://blog.filippo.io/building-python-modules-with-go-1-5/ (Go 1.5 only)\n- https://github.com/go-python/gopy/issues/83 (Python 2 only)\n- https://github.com/go-python/gopy/blob/master/gen.go#L81 (Python 2 only)\n- https://github.com/sbinet/go-python (Python 2 only)\n- https://dustymabe.com/2016/09/13/sharing-a-go-library-to-python-using-cffi/ (Compiler Errors on embebed obfuscated C)\n- http://pybindgen.readthedocs.io/en/latest/tutorial/#supported-python-versions (Compiler Errors on obfuscated C)\n- https://hackernoon.com/extending-python-3-in-go-78f3a69552ac (All of the above)\n- Other solutions call Python from Go, the reverse of Gothon.\n- Others I dont remember the links.\n\n\n### Contributors\n\n- **Please Star this Repo on Github !**, it helps to show up faster on searchs.\n- [Help](https://help.github.com/articles/using-pull-requests) and more [Help](https://help.github.com/articles/fork-a-repo) and Interactive Quick [Git Tutorial](https://try.github.io).\n- English is the primary default spoken language, unless explicitly stated otherwise *(eg. Dont send Translation Pull Request)*\n- Pull Requests for working passing unittests welcomed.\n\n\n### Licence\n\n- BSD.\n\n\n### Ethics and Humanism Policy\n\n- Religions is not allowed. Contributing means you agree with the COC.\n", "description_content_type": "", "docs_url": null, "download_url": "https://github.com/juancarlospaco/gothon#gothon", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/juancarlospaco/gothon#gothon", "keywords": "minimalism", "license": "BSD", "maintainer": "", "maintainer_email": "", "name": "gothon", "package_url": "https://pypi.org/project/gothon/", "platform": "Linux", "project_url": "https://pypi.org/project/gothon/", "project_urls": { "Download": "https://github.com/juancarlospaco/gothon#gothon", "Homepage": "https://github.com/juancarlospaco/gothon#gothon" }, "release_url": "https://pypi.org/project/gothon/0.5.0/", "requires_dist": null, "requires_python": "", "summary": "Gothon runs GO Code from Python, just import *.go files from Python.", "version": "0.5.0" }, "last_serial": 3771196, "releases": { "0.5.0": [ { "comment_text": "", "digests": { "md5": "1a0743653166ac85216688a9178cc462", "sha256": "c3e3273052de0f7eecc6139e2ad8b15521b1fdb27f28141d2d3dbae67f6028a8" }, "downloads": -1, "filename": "gothon-0.5.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "1a0743653166ac85216688a9178cc462", "packagetype": "bdist_wheel", "python_version": "3.6", "requires_python": null, "size": 9984, "upload_time": "2018-04-17T00:44:30", "url": "https://files.pythonhosted.org/packages/cc/0f/23c9511b671ab63cb8bdfcfe1fa747039dcfe4207971133de6a5e7e9e00b/gothon-0.5.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "69152367a7b699e425c467637c14c133", "sha256": "f04126f31d46ebb742394b0e67e0ddf6ed6478cb430bccbad0f0bf0d6c62c18a" }, "downloads": -1, "filename": "gothon-0.5.0-py3.6.egg", "has_sig": false, "md5_digest": "69152367a7b699e425c467637c14c133", "packagetype": "bdist_egg", "python_version": "3.6", "requires_python": null, "size": 7132, "upload_time": "2018-04-17T00:44:27", "url": "https://files.pythonhosted.org/packages/9a/c0/0969cc4e66c349075dfe3910a65657b408040ed4a0be9e73af218be53acc/gothon-0.5.0-py3.6.egg" }, { "comment_text": "", "digests": { "md5": "308beb7ea99dd3aa994d67129a6edff9", "sha256": "f0059c4d669f518822fa4497de1aa742c81ed60c08e8a4ef3f7efaf2ebd92618" }, "downloads": -1, "filename": "gothon-0.5.0.zip", "has_sig": false, "md5_digest": "308beb7ea99dd3aa994d67129a6edff9", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 13148, "upload_time": "2018-04-17T00:44:32", "url": "https://files.pythonhosted.org/packages/d7/df/1ed663351fe29a15cf7a7f6b44a80510677c27196dd2fc95c85cbfa3bfd2/gothon-0.5.0.zip" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "1a0743653166ac85216688a9178cc462", "sha256": "c3e3273052de0f7eecc6139e2ad8b15521b1fdb27f28141d2d3dbae67f6028a8" }, "downloads": -1, "filename": "gothon-0.5.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "1a0743653166ac85216688a9178cc462", "packagetype": "bdist_wheel", "python_version": "3.6", "requires_python": null, "size": 9984, "upload_time": "2018-04-17T00:44:30", "url": "https://files.pythonhosted.org/packages/cc/0f/23c9511b671ab63cb8bdfcfe1fa747039dcfe4207971133de6a5e7e9e00b/gothon-0.5.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "69152367a7b699e425c467637c14c133", "sha256": "f04126f31d46ebb742394b0e67e0ddf6ed6478cb430bccbad0f0bf0d6c62c18a" }, "downloads": -1, "filename": "gothon-0.5.0-py3.6.egg", "has_sig": false, "md5_digest": "69152367a7b699e425c467637c14c133", "packagetype": "bdist_egg", "python_version": "3.6", "requires_python": null, "size": 7132, "upload_time": "2018-04-17T00:44:27", "url": "https://files.pythonhosted.org/packages/9a/c0/0969cc4e66c349075dfe3910a65657b408040ed4a0be9e73af218be53acc/gothon-0.5.0-py3.6.egg" }, { "comment_text": "", "digests": { "md5": "308beb7ea99dd3aa994d67129a6edff9", "sha256": "f0059c4d669f518822fa4497de1aa742c81ed60c08e8a4ef3f7efaf2ebd92618" }, "downloads": -1, "filename": "gothon-0.5.0.zip", "has_sig": false, "md5_digest": "308beb7ea99dd3aa994d67129a6edff9", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 13148, "upload_time": "2018-04-17T00:44:32", "url": "https://files.pythonhosted.org/packages/d7/df/1ed663351fe29a15cf7a7f6b44a80510677c27196dd2fc95c85cbfa3bfd2/gothon-0.5.0.zip" } ] }