{ "info": { "author": "Michael Medin", "author_email": "michael@medin.name", "bugtrack_url": null, "classifiers": [ "License :: OSI Approved :: Apache Software License", "Operating System :: OS Independent", "Programming Language :: Python :: 3" ], "description": "lua-protobuf provides a Lua interface to Google's [Protocol Buffers](http://code.google.com/apis/protocolbuffers/).\n\n# Producing Code\n\nlua-protobuf provides a plugin for the _protoc_ protocol buffer compiler (it ships with protocol buffers). This plugin tells _protoc_ to produce a set of C++ output files, which define the Lua interface to protocol buffers using the Lua C API.\n\nFirst, obtain a copy of lua-protobuf:\n\n $ git clone git@github.com:indygreg/lua-protobuf.git\n $ cd lua-protobuf\n\nNext, install lua-protobuf:\n\n $ python setup.py install\n\nYes, lua-protobuf is written in Python (for now at least).\n\nFinally, launch protoc and tell it to produce Lua output:\n\n $ protoc -I/path/to/your/proto/files --lua_out=/output/path file1.proto file2.proto\n\nYou simply need to add _--lua_out_ to the arguments to _protoc_ to get it to produce the Lua output files.\n\nUnder the hood, _protoc_ is looking for the program _protoc-gen-lua_ somewhere in your $PATH. You can modify $PATH in lieux of installing the package, if you desire.\n\n## Missing plugin_pb2 Python Module\n\nThe protocol buffers Python installer does not install a file required by protoc-gen-lua at this time. The missing file is the Python interface to the compiler plugin *plugin.proto*. The protoc-gen-lua Python script may fail when importing the *google.protobuf.compiler.plugin_pb2* module.\n\nA thread on the protocol buffers mailing list [discusses the issue](http://groups.google.com/group/protobuf/browse_thread/thread/e58c33f20c27f4a9).\n\nAt this time, the issue can be worked around by manually installing the missing file.\n\nAssuming you have a working protoc compiler on your system and have the existing Python protocol buffers package installed, from the protocol buffers source code directory, run the following:\n\n $ protoc -Isrc --python_out=/path/to/output/directory src/google/protobuf/compiler/plugin.proto\n\nThe command should produce no output if successful. Additionally, the file */path/to/output/directory/google/protobuf/compiler/plugin_pb2.py* should have been created.\n\nNext, find the location of the installed protocol buffer Python package. If you have *locate*, try finding it via *`locate descriptor_pb2.py`*. A common location is something like */usr/lib/python2.6/site-packages/protobuf-2.3.0-py2.6.egg/google/protobuf/*. Navigate to this directory and:\n\n $ mkdir compiler\n $ touch compiler/__init__.py\n $ cp /path/to/plugin_pb2.py compiler/plugin_pb2.py\n\nIn common English:\n\n1. Create a new directory, from the install root, *google/protobuf/compiler*\n2. Create an empty file, *\\_\\_init\\_\\_.py* in this directory. This tells Python that the directory contains Python modules.\n3. Copy the *plugin_pb2.py* file produced by protoc to this new directory.\n\nDepending on the installed location of protocol buffers, these actions may require superuser or administrator privileges.\n\n# Compiling Produced Files\n\nYou should be able to compile the produced .h and .cc files like you would for protocol buffer output files. If you have an existing Makefile, project, etc, just add the produced .h and .cc files to it.\n\nFor linking, you'll need to include whatever library contains Lua. On *NIX toolchains, this typically corresponds to the linker flag _-llua_ or _-llua5.1_.\n\nThe produced C++ code contains _extern \"C\" { }_ blocks around all code that utilizes Lua API function calls to avoid C++ name mangling.\n\n## Windows\n\nWindows requires an identifier for symbols to be exported from shared libraries. If compiling the lua-protobuf output to a shared library, you'll need to use a preprocessor define:\n\n #define LUA_PROTOBUF_EXPORT __declspec(dllexport)\n\n\n\n", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "http://github.com/mickem/lua-protobuf", "keywords": "", "license": "", "maintainer": "", "maintainer_email": "", "name": "lua-protobuf", "package_url": "https://pypi.org/project/lua-protobuf/", "platform": "", "project_url": "https://pypi.org/project/lua-protobuf/", "project_urls": { "Homepage": "http://github.com/mickem/lua-protobuf" }, "release_url": "https://pypi.org/project/lua-protobuf/1.0.1/", "requires_dist": [ "protobuf (>=3.0.0)" ], "requires_python": ">=3.6", "summary": "Lua protocol buffer code generator", "version": "1.0.1" }, "last_serial": 5937304, "releases": { "1.0.1": [ { "comment_text": "", "digests": { "md5": "76c30ed8c172fbb4659251fdc47842e3", "sha256": "a07f0bba3ff280740d84cfd59d96514fd0ef04c591a7f0658d998f05cdd96b69" }, "downloads": -1, "filename": "lua_protobuf-1.0.1-py3-none-any.whl", "has_sig": false, "md5_digest": "76c30ed8c172fbb4659251fdc47842e3", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.6", "size": 18297, "upload_time": "2019-10-07T06:45:33", "url": "https://files.pythonhosted.org/packages/33/c0/40772ce74baa5b484ccc9c7ed4ca6ad0bba90b6f95350be9887e08d8973f/lua_protobuf-1.0.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "339af793964f8e9a2095d4542bbb023b", "sha256": "b4cf42348f631db46088748aaf6ebf2f4c664cdb7f17bf97b8ddd75af044e046" }, "downloads": -1, "filename": "lua-protobuf-1.0.1.tar.gz", "has_sig": false, "md5_digest": "339af793964f8e9a2095d4542bbb023b", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6", "size": 14538, "upload_time": "2019-10-07T06:45:35", "url": "https://files.pythonhosted.org/packages/51/c5/9400bf4aa01b7ee35bf54e1e837070a3119e68cea97c8bc12c16d1d5028b/lua-protobuf-1.0.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "76c30ed8c172fbb4659251fdc47842e3", "sha256": "a07f0bba3ff280740d84cfd59d96514fd0ef04c591a7f0658d998f05cdd96b69" }, "downloads": -1, "filename": "lua_protobuf-1.0.1-py3-none-any.whl", "has_sig": false, "md5_digest": "76c30ed8c172fbb4659251fdc47842e3", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.6", "size": 18297, "upload_time": "2019-10-07T06:45:33", "url": "https://files.pythonhosted.org/packages/33/c0/40772ce74baa5b484ccc9c7ed4ca6ad0bba90b6f95350be9887e08d8973f/lua_protobuf-1.0.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "339af793964f8e9a2095d4542bbb023b", "sha256": "b4cf42348f631db46088748aaf6ebf2f4c664cdb7f17bf97b8ddd75af044e046" }, "downloads": -1, "filename": "lua-protobuf-1.0.1.tar.gz", "has_sig": false, "md5_digest": "339af793964f8e9a2095d4542bbb023b", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6", "size": 14538, "upload_time": "2019-10-07T06:45:35", "url": "https://files.pythonhosted.org/packages/51/c5/9400bf4aa01b7ee35bf54e1e837070a3119e68cea97c8bc12c16d1d5028b/lua-protobuf-1.0.1.tar.gz" } ] }