{ "info": { "author": "Graham Bell", "author_email": "graham.s.bell@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "Intended Audience :: Developers", "License :: OSI Approved :: GNU General Public License v3 (GPLv3)", "Topic :: Software Development :: Libraries :: Python Modules" ], "description": "Taco Module for Python\r\n======================\r\n\r\nIntroduction\r\n------------\r\n\r\n.. starttacointro\r\n\r\nTaco is a system for bridging between scripting languages.\r\nIts goal is to allow you to call routines written for one language from\r\nanother.\r\nIt does this by running the second language interpreter in a sub-process,\r\nand passing messages about actions to be performed inside that interpreter.\r\n\r\nIn principle, to interface scripting languages it might be preferable\r\nto embed the interpreter for one as an extension of the other.\r\nHowever this might not be convenient or possible,\r\nand would need to be repeated for each combination of languages.\r\nInstead Taco only requires a \"client\" module and \"server\" script\r\nfor each language, which should be straightforward to install,\r\nand its messages are designed to be generic so that they\r\ncan be used between any combination of languages.\r\n\r\nFor more information about Taco, please see the\r\n`Taco Homepage`_.\r\n\r\n.. _`Taco Homepage`: http://grahambell.github.io/taco/\r\n\r\n.. endtacointro\r\n\r\nExamples\r\n~~~~~~~~\r\n\r\nHere are examples of the different types of responses\r\nwhich may result from a Taco call:\r\n\r\n.. starttacoreturn\r\n\r\n* Function Results\r\n\r\n If you find that you need the weighted ``roll_dice()``\r\n function from the `Acme::Dice`_ Perl module,\r\n you can import it and call the function as follows:\r\n\r\n >>> from taco import Taco\r\n >>> taco = Taco(lang='perl')\r\n >>> taco.import_module('Acme::Dice', 'roll_dice')\r\n >>> taco.call_function('roll_dice', dice=1, sides=6, favor=6, bias=100)\r\n 6\r\n\r\n In this example, instantiating a ``Taco`` object starts a\r\n sub-process running a Perl script.\r\n This \"server\" script then handles the instructions to\r\n import a module and call one of its functions,\r\n returning the value 6.\r\n\r\n* Object References\r\n\r\n To allow the use of object-oriented modules such as\r\n `Acme::PricelessMethods`_,\r\n references to objects are returned\r\n as instances of the ``TacoObject`` class.\r\n\r\n >>> taco.import_module('Acme::PricelessMethods')\r\n >>> pm = taco.construct_object('Acme::PricelessMethods')\r\n >>> type(pm)\r\n \r\n\r\n These objects can be used to invoke further actions:\r\n\r\n >>> pm.call_method('is_machine_on')\r\n 1\r\n\r\n* Exceptions\r\n\r\n ``roll_dice()`` raises an exception if we try to roll more than 100 dice.\r\n The exception is caught and re-raised on the \"client\" side:\r\n\r\n >>> taco.call_function('roll_dice', dice=1000)\r\n Traceback (most recent call last):\r\n ...\r\n taco.error.TacoReceivedError: ... Really? Roll 1000 dice? ...\r\n\r\n.. _Acme::Dice: http://search.cpan.org/perldoc?Acme::Dice\r\n\r\n.. _Acme::PricelessMethods: http://search.cpan.org/perldoc?Acme::PricelessMethods\r\n\r\n.. endtacoreturn\r\n\r\n.. starttacoinstall\r\n\r\nInstallation\r\n------------\r\n\r\nThe module can be installed using the ``setup.py`` script::\r\n\r\n python setup.py install\r\n\r\nBefore doing that, you might like to run the unit tests::\r\n\r\n PYTHONPATH=lib python -m unittest -v\r\n\r\nFor Python 2, it might be necessary to include the command ``discover``\r\nafter the ``unittest`` module name.\r\nIf successful you should see a number of test cases being run.\r\n\r\nIntegration Tests\r\n~~~~~~~~~~~~~~~~~\r\n\r\nThis package also includes further integration tests which test\r\nthe complete system.\r\nThese tests are stored in files named ``ti_*.py`` to avoid them\r\nbeing found by ``unittest`` discovery with its default\r\nparameters.\r\nThey all use the Python \"client\" module but a variety\r\nof \"server\" scripts.\r\n\r\n* Python\r\n\r\n The tests using a Python \"server\" script can be run directly from this\r\n package::\r\n\r\n PYTHONPATH=lib python -m unittest discover -v -s 'ti-python' -p 'ti_*.py'\r\n\r\n* Other Languages\r\n\r\n The following tests all require a Taco \"server\" script for the\r\n corresponding language to be installed in your search path.\r\n\r\n * Perl ::\r\n\r\n PYTHONPATH=lib python -m unittest discover -v -s 'ti-perl' -p 'ti_*.py'\r\n\r\n.. endtacoinstall\r\n\r\nLicense\r\n-------\r\n\r\nThis program is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nThis program is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with this program. If not, see .\r\n\r\nAdditional Links\r\n----------------\r\n\r\n* `Documentation at Read the Docs `_\r\n* `Repository at GitHub `_\r\n* `Taco Homepage`_", "description_content_type": null, "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "http://github.com/grahambell/taco-python", "keywords": "", "license": "UNKNOWN", "maintainer": "", "maintainer_email": "", "name": "taco", "package_url": "https://pypi.org/project/taco/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/taco/", "project_urls": { "Homepage": "http://github.com/grahambell/taco-python" }, "release_url": "https://pypi.org/project/taco/0.1.0/", "requires_dist": null, "requires_python": null, "summary": "Taco module for Python", "version": "0.1.0" }, "last_serial": 1931415, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "8a0e7df9b4a7f8b17a198dfccd53efcc", "sha256": "9425d76aa419d716600cb3b912fb871cbee1eca5d5c9d2ee49d0ad8223b3e0d0" }, "downloads": -1, "filename": "taco-0.1.0.tar.gz", "has_sig": false, "md5_digest": "8a0e7df9b4a7f8b17a198dfccd53efcc", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 23109, "upload_time": "2014-03-24T06:53:17", "url": "https://files.pythonhosted.org/packages/e0/5f/1604e0c4beef9e597464dbbc02c2e035c9a5ecc07bf8df4b0b7d72e4615c/taco-0.1.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "8a0e7df9b4a7f8b17a198dfccd53efcc", "sha256": "9425d76aa419d716600cb3b912fb871cbee1eca5d5c9d2ee49d0ad8223b3e0d0" }, "downloads": -1, "filename": "taco-0.1.0.tar.gz", "has_sig": false, "md5_digest": "8a0e7df9b4a7f8b17a198dfccd53efcc", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 23109, "upload_time": "2014-03-24T06:53:17", "url": "https://files.pythonhosted.org/packages/e0/5f/1604e0c4beef9e597464dbbc02c2e035c9a5ecc07bf8df4b0b7d72e4615c/taco-0.1.0.tar.gz" } ] }