{ "info": { "author": "Kevin Feveck", "author_email": "", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "License :: OSI Approved :: GNU General Public License v2 (GPLv2)", "Operating System :: OS Independent", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6" ], "description": "# AutomanPy\nPython bindings for AutoMan. See [AutoMan](https://automan-lang.github.io/). \nThis package is currently in development.\n\n### System Requirements\nTo use this package you must be running Python 2.7.15 or 3.2+,Java 8, and Scala 2.11.7+. This package relies on [ScalaPB](https://scalapb.github.io/) and [gRPC](https://grpc.io/). If you use SBT to build this project, all Scala dependencies will be downloaded. To install gRPC for Python (needed for the Python client), follow these [instructions](https://grpc.io/docs/quickstart/python.html).\n\n\n### How to Install\nUse pip to install AutoManPy. \n```\npip install automanpy\n```\nThis software package is currently in development, and will be updated regularly for bug fixes, etc. \nIf you want to upgrade, or force the installation of the latest version, use '--no-cache-dir' and '--upgrade'\n```\npip install --no-cache-dir automanpy --upgrade\n```\n\n### How to Build Source\nThe easiest way to build this project is by using [SBT](https://www.scala-sbt.org/).To build the source automatically, you can run `./buildproject.sh` located in the root directory. This relies on sbt being installed. \nTo build this project manually, from the /AutomanPy directory, run\n```\nsbt clean compile pack\n```\nSBT will also compile the necessary .proto into Scala classes automatically. To generate the the python files needed, `grpcio-tools` and `googleapis-common-protos` need to be installed. These python dependencies are automatically installed by pip if this package is installed from the provided tarball (). To install the necessary packages manually, run the following two commands:\n```\npip install grpcio-tools\npip install googleapis-common-protos\n```\nTo use gRPC generate the python files needed for interacting with the RPC service, from the /AutomanPy directory, run the following command:\n\n```\npython -m grpc_tools.protoc -I src/main/protobuf/ --python_out=src/main/automanpy/automanpy/core/grpc_gen_classes/ --grpc_python_out=src/main/automanpy/automanpy/core/grpc_gen_classes src/main/protobuf/core/grpc_gen_classes/automanlib_rpc.proto src/main/protobuf/core/grpc_gen_classes/automanlib_classes.proto src/main/protobuf/core/grpc_gen_classes/automanlib_wrappers.proto\n```\n\nMove the files compiled by sbt into the correct directory by copying them:\n```\ncp -r target/pack/ src/main/automanpy/automanpy/core/rpc/server/\n```\n\nThen change to the directory containing setup.py and run it from there:\n```\ncd src/main/automanpy/\npython setup.py clean sdist\n```\n\n### How to Use\nTo run tasks, first create an Automan object. The constructor for Automan objects requires an adapter, and take optional parameters for the RPC server address and port number (default is 'localhost' and 50051). The adapter we pass to the constructor is simply a dictionary with the following required fields:\n* access_id - the login id for the crowdsource backend\n* access_key - the login access key for the crowdsource backend\n* type - the type of crowdsource backend. currently only \"mturk\" is an accepted type\n* any optional arguments for the adapter (currently only \"sandbox_mode\" for MTurk adapter)\n\nFirst, import the Automan and EstimateOutcome classes from automanpy.automan, then create an adapter\n\n```python\nPython 2.7.15 |Anaconda, Inc.| (default, May 1 2018, 18:37:05) \n[GCC 4.2.1 Compatible Clang 4.0.1 (tags/RELEASE_401/final)] on darwin\nType \"help\", \"copyright\", \"credits\" or \"license\" for more information.\n>>> from automanpy.automan import Automan, EstimateOutcome\n>>> adapter = {\n... \"access_id\" : \"access id here\",\n... \"access_key\" : \"access key here\",\n... \"sandbox_mode\" : \"true\",\n... \"type\" : \"MTurk\"\n... }\n\n```\n\nWhen an Automan object is being initialized, if the server_addr is 'localhost' it will start a local AutoMan RPC server as a new process, configured to listen on the provided port number. Future functionality will allow users to connect to remote RPC servers. We can now use the Automan object to submit tasks to the crowdsource back-end. Currently, only the `estimate` function of Automan is available. See example code for usage.\n\n```python\n>>> a = Automan(adapter, server_addr='localhost',port=50051)\npython client is starting server...\nServer Started on port 50051 ...\n>>> photo_url = \"https://docs.google.com/uc?id=1ZQ-oL8qFt2tx_T_-thev2O4dsugVbKI2\"\n>>> estim = a.estimate(text = \"How many cars are in this parking lot?\",budget = 6.00, title = \"Car Counting\",image_url = photo_url)\n```\n\nEach type of task has fields that are required. All tasks require `text` (a text description of the task), and `budget` (desired upper limit of cost of task). We specify the tasks we would like AutoMan to carry out, and either when the question has timed out and budget is exceeded (resulting in a low confidence or overbudget outcome respectively) or the desired confidence level has been met. \n\nThe outcome can be either:\n* Confident estimate\n* Low Confidence estimate\n* Overbudget \n\nIf the task went overbudget, the `need` and `have` fields of the returned EstimateOutcome are initialized, otherwise `high`, `low`, `est`, `cost`, and `conf` are initialized. AutomanPy uses gRPC's implementation of Futures. To ensure the future is resolved before values are accessed, only try to access respective values within code blocks that ensure those values are set. See methods `isConfident()`, `isLowConfidence()`, and `isOverBudget()` below. To see more example code, and an example for posting multiple tasks, see AutomanPy/examples\n\n\nTo simply print the result of the task, use `printOutcome()`.\n```python\nestim.printOutcome()\n>>> estim.printOutcome()\nOutcome: Low Confidence Estimate\nEstimate low: 62.000000 high:62.000000 est:62.000000\n```\n\n### Example Code \nSee example usage for submitting single and multiple estimate tasks in [`examples/`](https://github.com/kevfev/AutomanPy/tree/master/examples)\n\n### API\nSee the API under [`examples/`](https://github.com/kevfev/AutomanPy/tree/master/examples)", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/kevfev/AutomanPy/", "keywords": "automan crowdsource quality-assurance", "license": "GNU GPLv2", "maintainer": "", "maintainer_email": "", "name": "automanpy", "package_url": "https://pypi.org/project/automanpy/", "platform": "", "project_url": "https://pypi.org/project/automanpy/", "project_urls": { "Homepage": "https://github.com/kevfev/AutomanPy/" }, "release_url": "https://pypi.org/project/automanpy/0.4.2b3/", "requires_dist": null, "requires_python": ">=2.7.15, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*", "summary": "Python bindings for AutoMan Runtime. Software is current in development, and not properly tested.", "version": "0.4.2b3" }, "last_serial": 4452579, "releases": { "0.4.2a0": [ { "comment_text": "", "digests": { "md5": "fa059c8b08dec2fa3c17513072bf2fe0", "sha256": "30b1d29092a61cdc5bd7510081945de34ed976fa84fdc97302d248d8838d26cc" }, "downloads": -1, "filename": "automanpy-0.4.2a0.tar.gz", "has_sig": false, "md5_digest": "fa059c8b08dec2fa3c17513072bf2fe0", "packagetype": "sdist", "python_version": "source", "requires_python": ">=2.7.15, !=3.0.*, !=3.1.*, <3.5.*", "size": 40429912, "upload_time": "2018-10-15T20:34:50", "url": "https://files.pythonhosted.org/packages/81/a4/b826ac1e77ad3bb4dde9316e12fa9f1f48330eeac1486b80d702164efff4/automanpy-0.4.2a0.tar.gz" } ], "0.4.2b3": [ { "comment_text": "", "digests": { "md5": "9fc950c12ddce417b434c93559b65355", "sha256": "e24797e7f57511f21b11c23ee1135792a10562408b91f20ebe3ca4f5e4dad24e" }, "downloads": -1, "filename": "automanpy-0.4.2b3.tar.gz", "has_sig": false, "md5_digest": "9fc950c12ddce417b434c93559b65355", "packagetype": "sdist", "python_version": "source", "requires_python": ">=2.7.15, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*", "size": 40420945, "upload_time": "2018-11-05T11:35:51", "url": "https://files.pythonhosted.org/packages/a5/ca/d61e54f57b2f60d89593c3bcf1fb9dca099573badd3a8c4120d4981c7983/automanpy-0.4.2b3.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "9fc950c12ddce417b434c93559b65355", "sha256": "e24797e7f57511f21b11c23ee1135792a10562408b91f20ebe3ca4f5e4dad24e" }, "downloads": -1, "filename": "automanpy-0.4.2b3.tar.gz", "has_sig": false, "md5_digest": "9fc950c12ddce417b434c93559b65355", "packagetype": "sdist", "python_version": "source", "requires_python": ">=2.7.15, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*", "size": 40420945, "upload_time": "2018-11-05T11:35:51", "url": "https://files.pythonhosted.org/packages/a5/ca/d61e54f57b2f60d89593c3bcf1fb9dca099573badd3a8c4120d4981c7983/automanpy-0.4.2b3.tar.gz" } ] }