{ "info": { "author": "mySociety", "author_email": "modules@mysociety.org", "bugtrack_url": null, "classifiers": [], "description": "popit-python\n============\n\nPython bindings to connect to the `PopIt `_ API. You can *create*, *read*, *update* and *delete* any items from PopIt through this Binding. Actually, this is only a convenient wrapper around `PopIt's `_ RESTful API.\n\nInstallation\n------------\nPopIt-Python is available as a module on PyPi, to install, simply run::\n\n pip install PopIt-Python\n\nAlternatively, clone this repo and install as you see fit.\n\nHow do I use this when I want to...\n-----------------------------------\n\nFirst, you'll need to get the PopIt binding object. Make sure PopIt as running and that you have all the information you need. Then get the object use the `PopIt` constructor. ::\n\n from popit_api import PopIt\n\n api = PopIt(instance='professors',\n hostname='127-0-0-1.org.uk',\n port=3000,\n api_version='v0.1',\n api_key='f093903b7a1aa9688b36241502beadc7')\n\n* ``instance`` Name of the instance you created. There can be more than one for one installation.\n* ``hostname`` The hostname of the PopIt server.\n* ``api_version`` The version of the PopIt API. Since there may be changes in the way you access the data in PopIt you want to have a stable API version. We recommend that you use the latest version, if possible.\n* ``port`` The port that PopIt is listening on. This probably is ``80`` or ``3000``. ``80`` is the default.\n* ``api_key`` This is the API key you can request by clicking\n 'Get API key' in the PopIt web interface for your instance, as\n `described in the documentation `_.\n\nIf you're still using an older PopIt instance and have not upgraded\nyour account for the new, more secure authentication system, instead\nof ``api_key`` you can supply ``user`` and ``password``:\n\n* ``user`` Your username, the email address that you created the instance with\n* ``password`` The password you were emailed when creating the instance\n\n\u2026create something?\n~~~~~~~~~~~~~~~~~~\n\nThis PopitWrapper lets you easily create a new item by name. This can be a ``person``, ``organization`` or ``position``. There may be other options that you can find in the `PopIt API documentation `_. ::\n\n new_person = api.persons.post({'name': 'Albert Keinstein'})\n print(new_person)\n\n # get the id of the newly created item\n id = new_person['result']['_id']\n\n\n\u2026read something\n~~~~~~~~~~~~~~~~\n\nIf you want to get a single item from PopIt, use ``name(id)``. ::\n\n # you need a valid ID for example from the create process.\n person = api.persons(id).get()\n print(person)\n\nTo get all Items from a kind, use `get()`. ::\n\n people = api.persons.get()\n print(people)\n\n\u2026update something?\n~~~~~~~~~~~~~~~~~~\n\n::\n\n result = api.persons(id).put({\"name\": \"Albert Einstein\"})\n print(result)\n\n\u2026delete something?\n~~~~~~~~~~~~~~~~~~\n\n::\n\n successfully_deleted = api.persons(id).delete()\n\n\u2026get an error?\n~~~~~~~~~~~~~~\n\nThis is easy. This wrapper helps you with various error messages that help you get the wrapper working. Here are some explanations for error messages.\n\n**HttpClientError: Client Error 404**\nYou are looking for an item that does not exist. Please provide a valid id. This Error can happen when you ty to *create*, *read*, *update* or *delete* an item.\n\n**HttpClientError: Client Error 401**\nYou wanted to *create*, *update* or *delete* an item but provided a wrong username or password.\n\n*Note*: You won't see this error before you actually try to modify any data.\n\n**SchemaError: 'foo does not exist. Try one of these schemas: organizations, positions, persons.'**\nThis happens when you try to get data from a schema that does not exist (in this case ``foo``). The available schemas are determined when you first create the api object.\n\n\u2026get more information about what's going on internally?\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\nEnable logging. ::\n\n logging.basicConfig(level=logging.WARN, format=FORMAT)\n\nRequirements\n------------\n\nIf you don't use pip to install the module, you'll also need:\n\n* requests (``pip install requests==0.14.2``)\n* slumber (``pip install slumber``)\n\nNote you need to specify the version of requests, because slumber does not and it is not compatible with requests >= 1.0.0 yet. It also needs to be specified and installed before slumber, else slumber's requirements.txt will override it and your specified version won't be installed.\n\nHow to run the tests\n--------------------\n\n* Copy the file ``config_example.py`` to ``config_test.py``\n* Change the entries in ``config_test.py`` to refer to your local test server\n* Install `oktest `_ (``pip install oktest``)\n* Make sure PopIt is running. You cannot test this wrapper without a running PopIt instance.\n* run ``python test.py``", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/mysociety/popit-python", "keywords": null, "license": "UNKNOWN", "maintainer": null, "maintainer_email": null, "name": "PopIt-Python", "package_url": "https://pypi.org/project/PopIt-Python/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/PopIt-Python/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/mysociety/popit-python" }, "release_url": "https://pypi.org/project/PopIt-Python/0.1.11/", "requires_dist": null, "requires_python": null, "summary": "Python bindings to connect to the PopIt API", "version": "0.1.11" }, "last_serial": 1509446, "releases": { "0.1": [ { "comment_text": "", "digests": { "md5": "d6b047bb0d669d92a2e1f7612bdd32a8", "sha256": "36825aa9a5446c8eed5cb6112ae1c719339dff88492cdaf43cd8ab0677a42cc6" }, "downloads": -1, "filename": "PopIt-Python-0.1.tar.gz", "has_sig": false, "md5_digest": "d6b047bb0d669d92a2e1f7612bdd32a8", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 1862, "upload_time": "2012-11-26T13:14:23", "url": "https://files.pythonhosted.org/packages/19/58/90979d9851c0ba747ee5d1602619426d1e19aaead10de9f1e315adc73db7/PopIt-Python-0.1.tar.gz" } ], "0.1.1": [ { "comment_text": "", "digests": { "md5": "ff4d44dc7589460c307ac6bb56a6a975", "sha256": "3974924cd778873e5953a65dd30f572969981748187152b47f76e17a5a41e6b8" }, "downloads": -1, "filename": "PopIt-Python-0.1.1.tar.gz", "has_sig": false, "md5_digest": "ff4d44dc7589460c307ac6bb56a6a975", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 1867, "upload_time": "2012-11-26T13:28:29", "url": "https://files.pythonhosted.org/packages/dd/93/9acfccde20027ee1bd58c9950b60cab4c9cf4e095eef1661673766425642/PopIt-Python-0.1.1.tar.gz" } ], "0.1.10": [ { "comment_text": "", "digests": { "md5": "dba7ea899fd528733fa7a0ba45cdf709", "sha256": "1b7908710e3b835d3a29d1ff1c37233282c1a5b246e256c33e66a71e9c168149" }, "downloads": -1, "filename": "PopIt-Python-0.1.10.tar.gz", "has_sig": false, "md5_digest": "dba7ea899fd528733fa7a0ba45cdf709", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4522, "upload_time": "2014-09-17T17:44:51", "url": "https://files.pythonhosted.org/packages/33/cf/01f23d79e9ed41d749f315e270f5607bfe12f23ceefd37bf90ecbb93d8be/PopIt-Python-0.1.10.tar.gz" } ], "0.1.11": [ { "comment_text": "", "digests": { "md5": "5874d8850b9811010ada2cf74a9830c3", "sha256": "37512bd67ebfbdf771f7373305ddf5154af64da5b0f3bacf41b6f19b7c25e6b3" }, "downloads": -1, "filename": "PopIt-Python-0.1.11.tar.gz", "has_sig": false, "md5_digest": "5874d8850b9811010ada2cf74a9830c3", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4568, "upload_time": "2015-04-17T15:18:29", "url": "https://files.pythonhosted.org/packages/f3/dc/306e106c7dedca7dea05e912b7e16f3ed4c955f576bd9ec4959cef24c133/PopIt-Python-0.1.11.tar.gz" } ], "0.1.2": [ { "comment_text": "", "digests": { "md5": "d62c57a6f06fb24561abdc7f03294d80", "sha256": "58af33a312e5b840a982baf39f0720b33c26fc1ce4c9d463a3b0ed1b7c5df95c" }, "downloads": -1, "filename": "PopIt-Python-0.1.2.tar.gz", "has_sig": false, "md5_digest": "d62c57a6f06fb24561abdc7f03294d80", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3633, "upload_time": "2012-11-26T13:52:57", "url": "https://files.pythonhosted.org/packages/01/de/0cd3bb947b0467dfa0d7a7ae22cf942142cd9c30b42ab8af7f7509611be0/PopIt-Python-0.1.2.tar.gz" } ], "0.1.3": [ { "comment_text": "", "digests": { "md5": "fe51c900962be1ccd8edf907a39dacba", "sha256": "b1fc46d6ab19ddee66aa3bf12d8eefc2054a4244c7fc348a32decf94a81e845c" }, "downloads": -1, "filename": "PopIt-Python-0.1.3.tar.gz", "has_sig": false, "md5_digest": "fe51c900962be1ccd8edf907a39dacba", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3646, "upload_time": "2012-11-27T13:02:04", "url": "https://files.pythonhosted.org/packages/7c/cb/5c661489534004acc8bbaa684ff29a7127ba153e616762083bb0b72c4c13/PopIt-Python-0.1.3.tar.gz" } ], "0.1.4": [ { "comment_text": "", "digests": { "md5": "3fc22740d7467c427d2b76c56eafc27f", "sha256": "e5aeab4708eb348f5fa15410e3da803d6e3d83f67f1564258fc3974010f405f1" }, "downloads": -1, "filename": "PopIt-Python-0.1.4.tar.gz", "has_sig": false, "md5_digest": "3fc22740d7467c427d2b76c56eafc27f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 1867, "upload_time": "2012-11-27T13:04:21", "url": "https://files.pythonhosted.org/packages/09/82/aa5eb5be4adcab23971ff0a814e74f0a5873832745b53270698b38a229a0/PopIt-Python-0.1.4.tar.gz" } ], "0.1.5": [ { "comment_text": "", "digests": { "md5": "4b3436b9eeec87a7fb73cf3bd605de0d", "sha256": "571a13119adab0249d6ac72fd0debf4219614dd7030bb31ab3fb2ae25c84722b" }, "downloads": -1, "filename": "PopIt-Python-0.1.5.tar.gz", "has_sig": false, "md5_digest": "4b3436b9eeec87a7fb73cf3bd605de0d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 1868, "upload_time": "2012-11-27T13:20:32", "url": "https://files.pythonhosted.org/packages/12/e3/086f5fa6d3aab1829fca04b213e3336c2c38e0455e361e59fbabe0bd4f1d/PopIt-Python-0.1.5.tar.gz" } ], "0.1.6": [ { "comment_text": "", "digests": { "md5": "f289ea7d53ab6400391c72d6f7a950e7", "sha256": "7dfd624644a740ee642012df6d5d2235b5c9e6fa0387619108ce134f8be99d00" }, "downloads": -1, "filename": "PopIt-Python-0.1.6.tar.gz", "has_sig": false, "md5_digest": "f289ea7d53ab6400391c72d6f7a950e7", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3708, "upload_time": "2013-01-31T12:53:17", "url": "https://files.pythonhosted.org/packages/5d/ad/6a26b6f368fa5894d67dfd1244f5debc3348a194a5136660a5655aa5de83/PopIt-Python-0.1.6.tar.gz" } ], "0.1.7": [ { "comment_text": "", "digests": { "md5": "4fcfc38de81f49f2a0da50874f5566c9", "sha256": "e958a0363af4483bfc3f891deadb350286cd713275019c3d655cb4be6cdec518" }, "downloads": -1, "filename": "PopIt-Python-0.1.7.tar.gz", "has_sig": false, "md5_digest": "4fcfc38de81f49f2a0da50874f5566c9", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3994, "upload_time": "2013-01-31T12:58:56", "url": "https://files.pythonhosted.org/packages/32/69/5c3ed38202169f09472ad3c89715f980777afd4a65396970f849976f9f93/PopIt-Python-0.1.7.tar.gz" } ], "0.1.8": [ { "comment_text": "", "digests": { "md5": "8c377f6a586e61c24bd17890c86f0eb9", "sha256": "b4367b54cb5f5470f8b0c35ced915e3b09403405a5c4d0f44eec6470c9591028" }, "downloads": -1, "filename": "PopIt-Python-0.1.8.tar.gz", "has_sig": false, "md5_digest": "8c377f6a586e61c24bd17890c86f0eb9", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3071, "upload_time": "2014-09-17T16:51:38", "url": "https://files.pythonhosted.org/packages/b6/38/68bdc05f5fe372f59082d3ff7347b45d34a1e1cedf8c60b34952b4b2deef/PopIt-Python-0.1.8.tar.gz" } ], "0.1.9": [ { "comment_text": "", "digests": { "md5": "27c0bc1b3e0db1704eaa97651b35b212", "sha256": "cc39dfc515dd5fada230980416ee614cf55f11d541b709f1272a5f94cd635531" }, "downloads": -1, "filename": "PopIt-Python-0.1.9.tar.gz", "has_sig": false, "md5_digest": "27c0bc1b3e0db1704eaa97651b35b212", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4130, "upload_time": "2014-09-17T17:24:53", "url": "https://files.pythonhosted.org/packages/3f/4a/71584f16f61df96549462f8c9d32332104b82448f4e760229f5de3f20e07/PopIt-Python-0.1.9.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "5874d8850b9811010ada2cf74a9830c3", "sha256": "37512bd67ebfbdf771f7373305ddf5154af64da5b0f3bacf41b6f19b7c25e6b3" }, "downloads": -1, "filename": "PopIt-Python-0.1.11.tar.gz", "has_sig": false, "md5_digest": "5874d8850b9811010ada2cf74a9830c3", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4568, "upload_time": "2015-04-17T15:18:29", "url": "https://files.pythonhosted.org/packages/f3/dc/306e106c7dedca7dea05e912b7e16f3ed4c955f576bd9ec4959cef24c133/PopIt-Python-0.1.11.tar.gz" } ] }