{ "info": { "author": "Andy Gayton", "author_email": "andy@simperium.com", "bugtrack_url": null, "classifiers": [ "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python :: 3 :: Only" ], "description": "# simperium-python3\n\nSimperium is a simple way for developers to move data as it changes, instantly\nand automatically. This is the Python library. You can [browse the\ndocumentation](http://simperium.com/docs/python/).\n\nYou can [sign up](http://simperium.com) for a hosted version of Simperium. There\nare Simperium libraries for [other languages](https://simperium.com/overview/)\ntoo.\n\nThis is not yet a full Simperium library for parsing diffs and changes. It's a\nwrapper for our [HTTP API](https://simperium.com/docs/http/) intended for\nscripting and basic backend development.\n\n## About this fork\n\nThis is a Python 3 fork of\n[https://github.com/Simperium/simperium-python](https://github.com/Simperium/simperium-python).\n\nPorted and maintained by Samuel Walladge.\n\nThe following changes were done from the original python 2 version:\n\n- 2to3\n- use `requests` instead of urllib\n- don't catch any http errors; clients can handle that\n- add type hints\n- use a Pipfile to manage deps\n- update setup.py\n\n\n## Installing\n\n\n```\npip install git+https://github.com/swalladge/simperium-python3.git#egg=Simperium3\n```\n\n\n## Developing\n\nPipenv is used. Install the environment and deps with:\n\n```\nmake install\n```\n\nTests (unit tests with pytest and type checking with mypy):\n\nPut the following in `.env` (with your actual values):\n\n```\nexport SIMPERIUM_CLIENT_TEST_APPNAME=\"foo-bar-123\"\nexport SIMPERIUM_CLIENT_TEST_APIKEY=\"\"\n```\n\nThen:\n\n```\nmake tests\n```\n\nFormat all the code consistently:\n\n```\npipenv run pip install black\nmake fmt\n```\n\n(pipenv panics if black is in dev-dependencies because it is a pre-release\nversion.)\n\n\n## Examples\n\nA bunch of examples are included in the `examples/` directory. Run them like so:\n\n\n```\npipenv run python examples/simpletodo list app-name-123 myusertoken\n```\n\netc.\n\n\n\n## Getting Started\n\nTo get started, first log into [https://simperium.com](https://simperium.com) and\ncreate a new application. Copy down the new app's name, api key and admin key.\n\nNext install the python client:\n\n $ sudo pip install git+https://github.com/Simperium/simperium-python.git\n\nStart python and import the lib:\n\n $ python\n >>> from simperium.core import Auth, Api\n\nWe'll need to create a user to be able to store data:\n\n >>> auth = Auth(yourappname, yourapikey)\n >>> token = auth.create('joe@example.com', 'secret')\n >>> token\n '25c11ad089dd4c18b84f24bc18c58fe2'\n\nWe can now store and retrieve data from simperium. Data is stored in buckets.\nFor example, we could store a list of todo items in a todo bucket. When you\nstore items, you need to give them a unique identifier. Uuids are usually a\ngood choice.\n\n >>> import uuid\n >>> api = Api(yourappname, token)\n >>> todo1_id = uuid.uuid4().hex\n >>> api.todo.post(todo1_id,\n {'text': 'Read general theory of love', 'done': False})\n\nWe can retrieve this item:\n\n >>> api.todo.get(todo1_id)\n {'text': 'Read general theory of love', 'done': False}\n\nStore another todo:\n\n >>> api.todo.post(uuid.uuid4().hex,\n {'text': 'Watch battle royale', 'done': False})\n\nYou can retrieve an index of all of a buckets items:\n\n >>> api.todo.index()\n {\n 'count': 2,\n 'index': [\n {'id': 'f6b680f8504c4e31a0e54a95401ffca0', 'v': 1},\n {'id': 'c0d07bb7c46e48e693653425eca93af9', 'v': 1}],\n 'current': '4f8507b8faf44720dfc432b1',}\n\nRetrieve all the docuemnts in the index:\n\n >>> [api.todo.get(x['id']) for x in api.todo.index()['index']]\n [\n {'text': 'Read general theory of love', 'done': False},\n {'text': 'Watch battle royale', 'done': False}]\n\nIt's also possible to get the data for each document in the index with data=True:\n\n >>> api.todo.index(data=True)\n {\n 'count': 2,\n 'index': [\n {'id': 'f6b680f8504c4e31a0e54a95401ffca0', 'v': 1,\n 'd': {'text': 'Read general theory of love', 'done': False},},\n {'id': 'c0d07bb7c46e48e693653425eca93af9', 'v': 1,\n 'd': {'text': 'Watch battle royale', 'done': False},}],\n 'current': '4f8507b8faf44720dfc432b1'}\n\nTo update fields in an item, post the updated fields. They'll be merged\nwith the current document:\n\n >>> api.todo.post(todo1_id, {'done': True})\n >>> api.todo.get(todo1_id)\n {'text': 'Read general theory of love', 'done': True}\n\nSimperium items are versioned. It's possible to go back in time and retrieve\nprevious versions of documents:\n\n >>> api.todo.get(todo1_id, version=1)\n {'text': 'Read general theory of love', 'done': False}\n\nOf course, you can delete items:\n\n >>> api.todo.delete(todo1_id)\n >>> api.todo.get(todo1_id) == None\n True\n >>> api.todo.index()['count']\n 1\n\n\n## License\n\nThe Simperium Python library is available for free and commercial use under the MIT license.", "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/swalladge/simperium-python3", "keywords": "", "license": "", "maintainer": "", "maintainer_email": "", "name": "Simperium3", "package_url": "https://pypi.org/project/Simperium3/", "platform": "", "project_url": "https://pypi.org/project/Simperium3/", "project_urls": { "Homepage": "https://github.com/swalladge/simperium-python3" }, "release_url": "https://pypi.org/project/Simperium3/0.1.3/", "requires_dist": null, "requires_python": ">=3", "summary": "Python 3 client for the Simperium synchronization platform", "version": "0.1.3" }, "last_serial": 4439618, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "06b495079ff49674313a67ce1e5bbd8d", "sha256": "86f25bc835e8063cf1cb2edb0deec9b52d0302e748a2959fab934ff83c0048d8" }, "downloads": -1, "filename": "Simperium3-0.1.0-py3-none-any.whl", "has_sig": false, "md5_digest": "06b495079ff49674313a67ce1e5bbd8d", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3", "size": 11204, "upload_time": "2018-09-13T06:23:02", "url": "https://files.pythonhosted.org/packages/cf/24/4cb955998e41f9c8fe0c25ddfcdec8e193eb3de5b8b0cd54ea05e0bbdd6e/Simperium3-0.1.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "aea466cd58659ff073f7d287e1b20b56", "sha256": "35956c8c61112dcd6fa5e3972884c613457a22f5733eb18585630048198175c7" }, "downloads": -1, "filename": "Simperium3-0.1.0.tar.gz", "has_sig": false, "md5_digest": "aea466cd58659ff073f7d287e1b20b56", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3", "size": 10266, "upload_time": "2018-09-13T06:23:04", "url": "https://files.pythonhosted.org/packages/9e/c9/d18e0e9af97444029bafec4ddcfaa4ad6da9478b254a4e3595e3d758ca2e/Simperium3-0.1.0.tar.gz" } ], "0.1.1": [ { "comment_text": "", "digests": { "md5": "79699bc7ed8eec0d5ba5fc9ab9c5f89f", "sha256": "3d84b1d6d1125000fa94228a560cfe927de3c89d2bff75a91c185ef64fbe9ae3" }, "downloads": -1, "filename": "Simperium3-0.1.1-py3-none-any.whl", "has_sig": false, "md5_digest": "79699bc7ed8eec0d5ba5fc9ab9c5f89f", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3", "size": 11203, "upload_time": "2018-09-13T06:43:47", "url": "https://files.pythonhosted.org/packages/a9/00/aaefec6f2704dd7ea6fbc45cd14ebc99def79edac5b36ed29730ef54d6ba/Simperium3-0.1.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "3d3cde880c753a13f4205c7636dac65a", "sha256": "0b9457cb4e917962582f031d0a6ebdaacbba8d64f1e2a44dbaf4b5f02b5be803" }, "downloads": -1, "filename": "Simperium3-0.1.1.tar.gz", "has_sig": false, "md5_digest": "3d3cde880c753a13f4205c7636dac65a", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3", "size": 10262, "upload_time": "2018-09-13T06:43:49", "url": "https://files.pythonhosted.org/packages/5f/a2/0a4456ea009fd2f092cb4ef568898b7af7177a7aebdd7a4d1ef79a885f2a/Simperium3-0.1.1.tar.gz" } ], "0.1.2": [ { "comment_text": "", "digests": { "md5": "35083b541a29f3bd74334db803764cfb", "sha256": "cc8cd3c4ddaee9a9b9337b70ce1a4e694b6e33843020ecc1d72eed511c928e54" }, "downloads": -1, "filename": "Simperium3-0.1.2-py3-none-any.whl", "has_sig": false, "md5_digest": "35083b541a29f3bd74334db803764cfb", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3", "size": 11218, "upload_time": "2018-09-17T03:35:10", "url": "https://files.pythonhosted.org/packages/b1/ff/7c3943fdc9c5c98fb1f8ca9f066bf4e28c7664032a634a48f5207c424651/Simperium3-0.1.2-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "94f215213ca62fa06b885db47f93d35b", "sha256": "a9f7581d1a2d457fa6aaaefa659b56c1c62b3f231e6fb037830d8410a529ddea" }, "downloads": -1, "filename": "Simperium3-0.1.2.tar.gz", "has_sig": false, "md5_digest": "94f215213ca62fa06b885db47f93d35b", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3", "size": 10276, "upload_time": "2018-09-17T03:35:12", "url": "https://files.pythonhosted.org/packages/8c/35/9bda4f31bf4150a01e2b1f8c8f00a5c896533e9d9498a1563a19f22e58ed/Simperium3-0.1.2.tar.gz" } ], "0.1.3": [ { "comment_text": "", "digests": { "md5": "29daa19b85046ac8ebd08ae054b5be52", "sha256": "d71ce5923b04b9853c7fc500a466ac724a767b5e33616c122564a71165233cc8" }, "downloads": -1, "filename": "Simperium3-0.1.3.tar.gz", "has_sig": false, "md5_digest": "29daa19b85046ac8ebd08ae054b5be52", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3", "size": 10304, "upload_time": "2018-11-01T05:59:47", "url": "https://files.pythonhosted.org/packages/6a/57/6770190250f0c60e19ced27ca16791cf675afbb4570f45f05d4dc7949ff2/Simperium3-0.1.3.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "29daa19b85046ac8ebd08ae054b5be52", "sha256": "d71ce5923b04b9853c7fc500a466ac724a767b5e33616c122564a71165233cc8" }, "downloads": -1, "filename": "Simperium3-0.1.3.tar.gz", "has_sig": false, "md5_digest": "29daa19b85046ac8ebd08ae054b5be52", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3", "size": 10304, "upload_time": "2018-11-01T05:59:47", "url": "https://files.pythonhosted.org/packages/6a/57/6770190250f0c60e19ced27ca16791cf675afbb4570f45f05d4dc7949ff2/Simperium3-0.1.3.tar.gz" } ] }