{ "info": { "author": "Oisin Mulvihill", "author_email": "oisin.mulvihilli@gmail.com", "bugtrack_url": null, "classifiers": [ "Intended Audience :: Developers", "License :: OSI Approved :: BSD License", "Operating System :: OS Independent", "Programming Language :: Python :: 3" ], "description": "nozama-cloudsearch\n------------------\n\n.. contents::\n\nA light weight implementation of Amazon's CloudSearch service for local testing\npurposes. This is meant for use in functional / acceptance testing of service\nwhich use cloud search.\n\nThe Nozama Service also implements its own REST API to allow you to get at the\ndata in a way you wouldn't normally be able to on Amazon CloudSearch.\n\nOne handy benefit of using Nozama is it provides a way to migrate from Amazon\nCloudSearch to ElasticSearch.\n\nThe \"offical\" docker container:\n\n - https://hub.docker.com/r/oisinmulvihill/nozama-cloudsearch\n\nThe Github repository:\n\n - https://hub.docker.com/r/oisinmulvihill/nozama-cloudsearch\n\nWhy?\n----\n\nI wanted to test a platform that was hardcoded to use only Cloudsearch. There\nwas no way I could change the code in question. I was also unable to get other\ninstances due to budget constraints. I looked around for alternatives and found\nnone I could get working on CentOS.\n\n\nQuickstart\n----------\n\nDocker\n~~~~~~\n\nIf you have docker and docker-compose on your system already then you can do:\n\n.. code-block:: sh\n\n # download the docker compose configuration:\n curl -O https://raw.githubusercontent.com/oisinmulvihill/nozama-cloudsearch/master/nozama-cloudsearch.yaml\n\n # Run in the background:\n docker-compose -f nozama-cloudsearch.yaml up -d\n\n # Check everything is up and running\n docker-compose -f nozama-cloudsearch.yaml ps\n\n curl http://localhost:15808/ping\n {\"status\": \"ok\", \"name\": \"nozama-cloudsearch\", \"version\": \"2.0.2\"}\n\n # To shutdown and stop all parts:\n docker-compose -f nozama-cloudsearch.yaml down\n\nThis will download the Mongo and ElasticSearch containers which it depends on. Once all services have been downloaded you can then start using the REST API.\n\nPypi.org\n~~~~~~~~\n\nMongo and ElasticSearch need to be installed and running on the system. The default set up will use a database called 'nozama-cloudsearch'. See the development.ini configuration file for more details.\n\n.. code-block:: sh\n\n # create a quick environment to install into:\n mkvirtualenv -p python 3 nozama\n\n # activate en\n workon nozama\n\n # Install from pypi:\n pip install nozama-cloudsearch\n\n # download the development configuration:\n curl -O https://raw.githubusercontent.com/oisinmulvihill/nozama-cloudsearch/master/development.ini\n\n # Run the service:\n pserve development.ini\n\n Starting server in PID 6845.\n serving on 0.0.0.0:15808 view at http://127.0.0.1:15808\n\nSuccess!\n\n\nQuick API Usage Example\n-----------------------\n\nIf you have a running service you can try the following using curl from the\ncommand line.\n\n.. code-block:: sh\n\n # Assumes: serving on 0.0.0.0:15808 view at http://127.0.0.1:15808\n\n # A quick check of the version and that the service is running:\n curl http://localhost:15808/ping\n {\"status\": \"ok\", \"name\": \"nozama-cloudsearch\", \"version\": \"2.0.2\"}\n\n # Now check what documents are present / removed:\n curl http://localhost:15808/dev/documents\n {\"documents_removed\": [], \"documents\": []}\n\n # Add a document using the batch upload SDF:\n curl -X POST -H \"Content-Type: application/json\" http://localhost:15808/2013-08-22/documents/batch -d '[{\"lang\": \"en\", \"fields\": {\"name\": \"bob\"}, \"version\": 1376497963, \"type\": \"add\", \"id\": 1246}]'\n {\"status\": \"ok\", \"adds\": 1, \"deletes\": 0, \"error\": \"\", \"warning\": \"\"}\n\n # Check the document is there:\n curl http://localhost:15808/dev/documents\n {\"documents\": [{\"_id\": \"1246\", \"lang\": \"en\", \"fields\": {\"name\": \"bob\"}, \"version\": \"1376497963\", \"id\": \"1246\"}], \"documents_removed\": []}\n\n # Try searching for the document:\n curl http://localhost:15808/2013-08-22/search?q=bob\n {\"rank\": \"-text_relevance\", \"match-expr\": \"(label 'bob')\", \"hits\": {\"found\": 1, \"start\": 0, \"hit\": [{\"id\": \"1246\", \"fields\": {\"name\": \"bob\"}}]}, \"info\": {\"rid\": \"47e87151546d5a349d7bf9b60eee0ebdf74783422a2e08cad0b9348e3ee3ef04eb198715bbe4e353\", \"time-ms\": 5, \"cpu-time-ms\": 0}}\n\n curl http://localhost:15808/2013-08-22/search?q=somethingnotpresent\n {\"rank\": \"-text_relevance\", \"match-expr\": \"(label 'somethingnotpresent')\", \"hits\": {\"found\": 0, \"start\": 0, \"hit\": []}, \"info\": {\"rid\": \"869d2b07c1e47a55ab1cb4cd615953333e52d886112e916ed7fa447355f5a518b1c16bbcbf40cb7e\", \"time-ms\": 5, \"cpu-time-ms\": 0}}\n\n # Remove the document in another batch update:\n curl -X POST -H \"Content-Type: application/json\" http://localhost:15808/2013-08-22/documents/batch -d '[{\"version\": 1376497963, \"type\": \"delete\", \"id\": 1246}]'\n {\"status\": \"ok\", \"adds\": 0, \"deletes\": 1, \"error\": \"\", \"warning\": \"\"}\n\n # Check what was removed:\n curl http://localhost:15808/dev/documents\n {\"documents\": [], \"documents_removed\": [{\"_id\": \"1246\", \"lang\": \"en\", \"fields\": {\"name\": \"bob\"}, \"version\": \"1376497963\", \"id\": \"1246\"}]}\n\n # Empty out all stored content:\n curl -X DELETE http://localhost:15808/dev/documents\n {\"status\": \"ok\", \"message\": \"Documents Removed OK.\", \"error\": \"\", \"traceback\": \"\"}\n\n # Check there should now be nothing there:\n curl http://localhost:15808/dev/documents\n {\"documents\": [], \"documents_removed\": []}\n\n\nDevelopment\n-----------\n\nI develop and maintain project on Mac OSX. I have install docker-composer, docker, virtualenvwrappers and Python3 using brew. I use \"make\" to aid development.\n\n.. code-block:: sh\n\n # create a quick environment to install into:\n mkvirtualenv --clear -p python3 nozama\n\n # (activate if needed)\n workon nozama\n\n # Install the project dependancies\n make install\n\n # Start the project dependancies ElasticSearch and Mongo\n make up\n\n # Run the API locally:\n make up\n\n\nContributing\n------------\n\nSubmit a pull request with tests if possible. I'll review, test and usually approve. All tests must pass. I run against Python3 nowadays. I will then increment the version, add attribute and then release to https://hub.docker.com/r/oisinmulvihill/nozama-elasticsearch and pypi.org if all is good.\n\nRelease Process\n---------------\n\nHelp Oisin remember the release process:\n\n.. code-block:: sh\n\n # clean env for release:\n mkvirtualenv --clear -p python3.7 nozama\n\n # setup and run all tests:\n #\n # make sure mongo and elasticsearch are running:\n make up\n\n # run all unit and acceptance tests in a completely isolated environment.\n make docker_test\n\n # Build and release to test.pypi.org first:\n make test_pypi_release\n\n # If all is good time to release to pypi.org\n make release_to_pypi\n\n # Now release the new docker container\n make docker_release\n\nTry pip install and docker pull for the new package and container.\n\nVersions\n--------\n\n2.0.3\n~~~~~\n\nBugfix to add in __init__.py files. I had forgotten to do this after I ditched the namespace packaging.\n\n2.0.2\n~~~~~\n\nStripped out the old sphinx docs from the API. http://localhost:15808/docs/ now just shows a link to Github REST API examples. Strip out unused code in the client side code and other unused files.\n\n2.0.0 -> 2.0.1\n~~~~~~~~~~~~~~\n\nUpdated the project after noticing lots of people still appear to use it. I've updated it to reflect my current thinking on building REST APIs and how they are packaged, developed and released.\n\nChanges:\n\n- REST API remains the same however searching now works.\n- Migrated to Python 3.\n- Refactor the project into a single python package making it easier to work on and contribute to.\n- Development is now assisted using docker compose to manage Mongo and ElasticSearch dependancies.\n- I now produce the \"offical\" nozama-cloudsearch container as part of my release process.\n- Unpinned the python dependancies and moved to using requirements files for production and testing requirements.\n\n1.2.0\n~~~~~\nAdd support for multibyte characters.\n\n * https://github.com/oisinmulvihill/nozama-cloudsearch/pull/9\n\nReturn field values and support `sdk` format.\n\n * https://github.com/oisinmulvihill/nozama-cloudsearch/pull/8\n\nRemove unnecessary validations.\n\n * https://github.com/oisinmulvihill/nozama-cloudsearch/pull/7\n\nUpsert a document.\n\n * https://github.com/oisinmulvihill/nozama-cloudsearch/pull/6\n\nContributed by hokuma(https://github.com/hokuma)\n\n1.1.3\n~~~~~\n\nThis is a minor fix to the LICENSE file as spotted by Alex (https://github.com/ALyman).\n\n * https://github.com/oisinmulvihill/nozama-cloudsearch/issues/1\n\n\n", "description_content_type": "text/x-rst", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/oisinmulvihill/nozama-cloudsearch", "keywords": "", "license": "BSD", "maintainer": "", "maintainer_email": "", "name": "nozama-cloudsearch", "package_url": "https://pypi.org/project/nozama-cloudsearch/", "platform": "", "project_url": "https://pypi.org/project/nozama-cloudsearch/", "project_urls": { "Homepage": "https://github.com/oisinmulvihill/nozama-cloudsearch" }, "release_url": "https://pypi.org/project/nozama-cloudsearch/2.0.3/", "requires_dist": [ "pymongo", "elasticsearch", "decorator", "paste", "formencode", "pyramid", "pyramid-jinja2", "pyramid-beaker", "waitress", "requests" ], "requires_python": "", "summary": "A REST service which emulates Amazon CloudSearch for local testing.", "version": "2.0.3" }, "last_serial": 5435385, "releases": { "2.0.1": [ { "comment_text": "", "digests": { "md5": "514e1b44bc7e7a51697e8ec3f6524bc0", "sha256": "34d4a4cee3f409aab1d30ae8efecb7eb76a97b6938f717772950c185837b042b" }, "downloads": -1, "filename": "nozama_cloudsearch-2.0.1-py3-none-any.whl", "has_sig": false, "md5_digest": "514e1b44bc7e7a51697e8ec3f6524bc0", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 11268, "upload_time": "2019-06-22T16:15:01", "url": "https://files.pythonhosted.org/packages/e6/99/90c8cc46f1223507c7d9e7e2d916261781e75cd0fb506aeaf8152f85ec1f/nozama_cloudsearch-2.0.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "1b352357a2d8935104dc78aa30fbdb5e", "sha256": "87e161846486d0511632a398d1a2b5217aa2558dd6c0480d3b8d9a013ab1e2b9" }, "downloads": -1, "filename": "nozama-cloudsearch-2.0.1.tar.gz", "has_sig": false, "md5_digest": "1b352357a2d8935104dc78aa30fbdb5e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 20270, "upload_time": "2019-06-22T16:15:06", "url": "https://files.pythonhosted.org/packages/8d/eb/f074da8d16ad5300ccc5286c67c192fea7e2a11ad1e9c3f25ec1276dfe32/nozama-cloudsearch-2.0.1.tar.gz" } ], "2.0.2": [ { "comment_text": "", "digests": { "md5": "2f5621d5e88c53dc18711ca584337392", "sha256": "7059dc357f1b95db1aa626dc2f72c33264cf668d1cc1eea2298136788ff60729" }, "downloads": -1, "filename": "nozama_cloudsearch-2.0.2-py2-none-any.whl", "has_sig": false, "md5_digest": "2f5621d5e88c53dc18711ca584337392", "packagetype": "bdist_wheel", "python_version": "py2", "requires_python": null, "size": 11271, "upload_time": "2019-06-22T16:56:52", "url": "https://files.pythonhosted.org/packages/d6/f5/87a9bd7db534a10c0337c970cbb75e9689e0f047a3753bf810918ffd91af/nozama_cloudsearch-2.0.2-py2-none-any.whl" }, { "comment_text": "", "digests": { "md5": "f95fb4e1c55edc4060e41a8d05ef4029", "sha256": "5106ba19f2751c309359fee9124e968a086870a0891b374b6326fec478a1d8da" }, "downloads": -1, "filename": "nozama-cloudsearch-2.0.2.tar.gz", "has_sig": false, "md5_digest": "f95fb4e1c55edc4060e41a8d05ef4029", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10412, "upload_time": "2019-06-22T16:56:54", "url": "https://files.pythonhosted.org/packages/e6/a1/8e2fdb0e9dba661811f9485cf7afe3398c043d1d0351fbc1d6b1831df664/nozama-cloudsearch-2.0.2.tar.gz" } ], "2.0.3": [ { "comment_text": "", "digests": { "md5": "99a675932210e91a0e8253a23670b4ab", "sha256": "75e2777e913a9b4b06ba9d0c901afad5a29eec6c1be57124ff95dc1fdc840823" }, "downloads": -1, "filename": "nozama_cloudsearch-2.0.3-py3-none-any.whl", "has_sig": false, "md5_digest": "99a675932210e91a0e8253a23670b4ab", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 24795, "upload_time": "2019-06-22T18:19:19", "url": "https://files.pythonhosted.org/packages/f3/7c/32e5aa8e8c646f5b3a2c15565b292e8a626f3262b97813d5bf96292bacc4/nozama_cloudsearch-2.0.3-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "d2d3c07b4ef4d9080a260ab73c141296", "sha256": "d423d7c8cf5fc40037ab220d2cffd78962c2bc13904db80e05c4b4940fcd32c5" }, "downloads": -1, "filename": "nozama-cloudsearch-2.0.3.tar.gz", "has_sig": false, "md5_digest": "d2d3c07b4ef4d9080a260ab73c141296", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 21378, "upload_time": "2019-06-22T18:19:21", "url": "https://files.pythonhosted.org/packages/8f/57/126c05fc752b1b971a8c9a297f58732f146c134b1a57791b2d71a23b2370/nozama-cloudsearch-2.0.3.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "99a675932210e91a0e8253a23670b4ab", "sha256": "75e2777e913a9b4b06ba9d0c901afad5a29eec6c1be57124ff95dc1fdc840823" }, "downloads": -1, "filename": "nozama_cloudsearch-2.0.3-py3-none-any.whl", "has_sig": false, "md5_digest": "99a675932210e91a0e8253a23670b4ab", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 24795, "upload_time": "2019-06-22T18:19:19", "url": "https://files.pythonhosted.org/packages/f3/7c/32e5aa8e8c646f5b3a2c15565b292e8a626f3262b97813d5bf96292bacc4/nozama_cloudsearch-2.0.3-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "d2d3c07b4ef4d9080a260ab73c141296", "sha256": "d423d7c8cf5fc40037ab220d2cffd78962c2bc13904db80e05c4b4940fcd32c5" }, "downloads": -1, "filename": "nozama-cloudsearch-2.0.3.tar.gz", "has_sig": false, "md5_digest": "d2d3c07b4ef4d9080a260ab73c141296", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 21378, "upload_time": "2019-06-22T18:19:21", "url": "https://files.pythonhosted.org/packages/8f/57/126c05fc752b1b971a8c9a297f58732f146c134b1a57791b2d71a23b2370/nozama-cloudsearch-2.0.3.tar.gz" } ] }