{ "info": { "author": "Alex Kessinger", "author_email": "voidfiles@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 5 - Production/Stable", "Intended Audience :: Developers", "License :: OSI Approved :: Apache Software License", "Natural Language :: English", "Programming Language :: Python", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.5", "Programming Language :: Python :: 2.6", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: Implementation :: PyPy", "Topic :: Software Development", "Topic :: Software Development :: Libraries :: Python Modules" ], "description": "Strainer: Fast Functional Serializers\n=====================================\n\n.. image:: https://img.shields.io/pypi/v/pystrainer.svg\n :target: https://pypi.python.org/pypi/pystrainer\n\n.. image:: https://readthedocs.org/projects/strainer/badge/?version=latest\n :target: https://strainer.readthedocs.io/en/latest/\n\n.. image:: https://travis-ci.org/voidfiles/strainer.svg?branch=master\n :target: https://travis-ci.org/voidfiles/strainer\n\nStrainer is a different take on serialization and validation in python. It utilizes a functional style over classes.\n\nStrainer officially supports Python 2.6\u20132.7 & 3.4\u20133.5, and runs great on PyPy.\n\nFeatures\n--------\n\n- Functional\n- Complex Python object serialization\n- Data de-serialization\n- Data Validation\n- `Speed `_\n\nSerialization Example\n---------------------\n\n.. code-block:: python\n\n import datetime\n from strainer import (serializer, field, child,\n formatters, validators,\n ValidationException)\n\n artist_serializer = serializer(\n field('name', validators=[validators.required()])\n )\n\n album_schema = serializer(\n field('title', validators=[validators.required()]),\n field('release_date',\n validators=[validators.required(), validators.datetime()],\n formatters=[formatters.format_datetime()]),\n child('artist', serializer=artist_serializer, validators=[validators.required()])\n )\n\n class Artist(object):\n def __init__(self, name):\n self.name = name\n\n class Album(object):\n def __init__(self, title, release_date, artist):\n self.title = title\n self.release_date = release_date\n self.artist = artist\n\n bowie = Artist(name='David Bowie')\n album = Album(\n artist=bowie,\n title='Hunky Dory',\n release_date=datetime.datetime(1971, 12, 17)\n )\n\nNow we can serialize, deserialize, and validate data\n\n.. code-block:: python\n\n >>> album_schema.serialize(album)\n {'artist': {'name': 'David Bowie'},\n 'release_date': '1971-12-17T00:00:00',\n 'title': 'Hunky Dory'}\n >>> album_schema.deserialize(album_schema.serialize(album))\n {'artist': {'name': 'David Bowie'},\n 'release_date': datetime.datetime(1971, 12, 17, 0, 0, tzinfo=),\n 'title': 'Hunky Dory'}\n >>> input = album_schema.serialize(album)\n >>> del input['artist']\n >>> album_schema.deserialize(input)\n ValidationException: {'artist': ['This field is required']}\n\nThe example has been borrowed from `Marshmallow `_ and tweaked.\n\nInstallation\n------------\n\nTo install Strainer, simply:\n\n.. code-block:: bash\n\n $ pip install pystrainer\n \u2728\ud83c\udf70\u2728\n\nSatisfaction, guaranteed.\n\n\n.. :changelog:\n\nRelease History\n---------------\n\n\n1.0.1\n++++++++++\n\n- refining validators\n- added attr_getter to child, and many\n\n1.0.0\n++++++++++\n\n- Updating docs\n- Making it official\n\n0.0.9\n++++++++++++++++++\n\n* Fixing python 3 comptatability issue\n\n0.0.8\n++++++++++++++++++\n\n* Removed an errant print statement\n\n0.0.7\n++++++++++++++++++\n\n* Fixed a bug with datetime validators\n\n0.0.6\n++++++++++++++++++\n\n* Fixed a bug with multiple validation, pointing to the correct index\n* Fixed a bug that applied vlaidation to entire array in multiple instead of elements\n* Added a dict_field, if source is dict, instead of an object\n* Added ability to pass validators to child, and many instances applying validation before moving to sub-element\n* Added tests around catching nested validation errors\n* Added formatters, so things can be formatted on the way out\n* Got rid of encoders, not the domain of this project\n* Everything can be imported from one namespace\n* Changed the API from to_representation/to_internal to serialize/deserialize\n\n0.0.5 (2016-11-29)\n++++++++++++++++++\n\n* Fleshed out docs\n* Added datetime validator\n* Increased speed bu reducing loops\n\n0.0.4 (2016-11-23)\n++++++++++++++++++\n\n* Add some validators\n\n\n0.0.1 (2016-11-23)\n++++++++++++++++++\n\n* Birth\n", "description_content_type": null, "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "http://github.com/voidfiles/strainer", "keywords": "", "license": "Apache 2.0", "maintainer": "", "maintainer_email": "", "name": "pystrainer", "package_url": "https://pypi.org/project/pystrainer/", "platform": "", "project_url": "https://pypi.org/project/pystrainer/", "project_urls": { "Homepage": "http://github.com/voidfiles/strainer" }, "release_url": "https://pypi.org/project/pystrainer/1.3.1/", "requires_dist": null, "requires_python": "", "summary": "Fast functional serializers", "version": "1.3.1" }, "last_serial": 3174004, "releases": { "0.0.1": [ { "comment_text": "", "digests": { "md5": "57d0b245415ca03528aa334cb4e1716e", "sha256": "b328d4254621c1d5630d85a40a98e34dceae049761c327ce7082657de6b521a0" }, "downloads": -1, "filename": "pystrainer-0.0.1.tar.gz", "has_sig": false, "md5_digest": "57d0b245415ca03528aa334cb4e1716e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4014, "upload_time": "2016-11-23T21:39:16", "url": "https://files.pythonhosted.org/packages/24/4a/a9b276b6cbd3bc22958766b4083877b7d5ac70e866eae456ff1b8fe0b6fc/pystrainer-0.0.1.tar.gz" } ], "0.0.2": [ { "comment_text": "", "digests": { "md5": "f2a0255ea7a15391a993909316fcfffc", "sha256": "294e084b0224108e92a913fc23e804bc3937e8db44975711ef9d718c985e43a7" }, "downloads": -1, "filename": "pystrainer-0.0.2.tar.gz", "has_sig": false, "md5_digest": "f2a0255ea7a15391a993909316fcfffc", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3908, "upload_time": "2016-11-23T22:01:37", "url": "https://files.pythonhosted.org/packages/e1/b2/7fadd28260e1e31623390738765ec8e03b3d620c093c07059cd876c8ed6e/pystrainer-0.0.2.tar.gz" } ], "0.0.3": [ { "comment_text": "", "digests": { "md5": "70e14e280ef07304298bd8012bbe60c9", "sha256": "78d8f15b22714eb41718cd393fa06ec5192d0f08ccc995a96bbcaf3b07196e4b" }, "downloads": -1, "filename": "pystrainer-0.0.3.tar.gz", "has_sig": false, "md5_digest": "70e14e280ef07304298bd8012bbe60c9", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3906, "upload_time": "2016-11-23T23:03:09", "url": "https://files.pythonhosted.org/packages/cd/25/04b40db9d4707f393ae61d70d802856909a0b9b870877fcff31b81cb1d6b/pystrainer-0.0.3.tar.gz" } ], "0.0.4": [ { "comment_text": "", "digests": { "md5": "6088efda499f7ca1832d06b6e6b2eb02", "sha256": "0367338841e7c802f1f5ea49ba4aa1c26383b77ef9655252be4a899e364158eb" }, "downloads": -1, "filename": "pystrainer-0.0.4.tar.gz", "has_sig": false, "md5_digest": "6088efda499f7ca1832d06b6e6b2eb02", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4373, "upload_time": "2016-11-24T06:26:41", "url": "https://files.pythonhosted.org/packages/a6/52/72adad45eb9f20a56b1edfa195709e664c41f43f9aa002b298b91ad8aa8e/pystrainer-0.0.4.tar.gz" } ], "0.0.5": [ { "comment_text": "", "digests": { "md5": "a9f3a8185a8259bd1967b6e9c7fe0670", "sha256": "765a8070f84caaea5d4a38d039b60f4d1482a91c4325522d99a13bac29e58454" }, "downloads": -1, "filename": "pystrainer-0.0.5.tar.gz", "has_sig": false, "md5_digest": "a9f3a8185a8259bd1967b6e9c7fe0670", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5281, "upload_time": "2016-11-29T17:53:02", "url": "https://files.pythonhosted.org/packages/4a/38/b524523bf30aa9c3170965e984dee8366574114c26b71683df613968da6c/pystrainer-0.0.5.tar.gz" } ], "0.0.6": [ { "comment_text": "", "digests": { "md5": "6aeba6f87babe670516d4df450de952b", "sha256": "186746564610c5d98e53f05a679f401ea060c2f797285fca06b54ee98adb95d1" }, "downloads": -1, "filename": "pystrainer-0.0.6.tar.gz", "has_sig": false, "md5_digest": "6aeba6f87babe670516d4df450de952b", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6428, "upload_time": "2016-12-04T19:32:51", "url": "https://files.pythonhosted.org/packages/3b/75/d0f95778a467c10f8719fa1370fde6f3ed648e2e1be63963cbdd4d5e5bcb/pystrainer-0.0.6.tar.gz" } ], "0.0.7": [ { "comment_text": "", "digests": { "md5": "b0d00415b28cfaaa32464f87cd27c7ca", "sha256": "b43253c3b61f8a5da791d89fad17ca1991e43262df7a7a73c63afb18161d4e03" }, "downloads": -1, "filename": "pystrainer-0.0.7.tar.gz", "has_sig": false, "md5_digest": "b0d00415b28cfaaa32464f87cd27c7ca", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6439, "upload_time": "2016-12-06T17:56:44", "url": "https://files.pythonhosted.org/packages/55/90/dfc1437e97f495d66f3c083802f80d8db79e57be529049afb6766e4733bf/pystrainer-0.0.7.tar.gz" } ], "0.0.8": [ { "comment_text": "", "digests": { "md5": "ac8dea4021d796fb8cedf0a68bc0193f", "sha256": "6c02af3e660f4cfad95096b124c9bbb4d6d88de3722eab4d1b42d1a37cfe5f63" }, "downloads": -1, "filename": "pystrainer-0.0.8.tar.gz", "has_sig": false, "md5_digest": "ac8dea4021d796fb8cedf0a68bc0193f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6451, "upload_time": "2016-12-06T18:45:36", "url": "https://files.pythonhosted.org/packages/88/92/ebd8c23d5f12e7e9796620676b0ae09fb2d526545e7d4c2d5d559a464ebd/pystrainer-0.0.8.tar.gz" } ], "0.0.9": [ { "comment_text": "", "digests": { "md5": "317754b751b8ffbfc2504dcfea8f3251", "sha256": "80815a7636888b9b74bc4b9bfbbf1280eb3741b394273a8e53b7d2f26f6290e9" }, "downloads": -1, "filename": "pystrainer-0.0.9.tar.gz", "has_sig": false, "md5_digest": "317754b751b8ffbfc2504dcfea8f3251", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6484, "upload_time": "2016-12-06T19:15:00", "url": "https://files.pythonhosted.org/packages/2b/aa/f91cde421f56b08edd7eb92b72396a3e5b5749bdbfe6976353a5b13cc785/pystrainer-0.0.9.tar.gz" } ], "1.0.0": [ { "comment_text": "", "digests": { "md5": "e69a246c6fe5f8ce535de9d11a5b48c5", "sha256": "60f8cb11c231704c3213941fed982ba903cf2af51decd89ff77616fab624047b" }, "downloads": -1, "filename": "pystrainer-1.0.0.tar.gz", "has_sig": false, "md5_digest": "e69a246c6fe5f8ce535de9d11a5b48c5", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6816, "upload_time": "2016-12-11T05:57:01", "url": "https://files.pythonhosted.org/packages/57/e9/af62e52c467cab4b8ea61a1f105618d0b6f928e0a89855f32bb76229ac58/pystrainer-1.0.0.tar.gz" } ], "1.0.1": [ { "comment_text": "", "digests": { "md5": "be78a8945460f3118ddd030b533ff920", "sha256": "b1230e25d94f4c70907080c40070446c5a1076294ed4135f4a378e214ea43cb1" }, "downloads": -1, "filename": "pystrainer-1.0.1.tar.gz", "has_sig": false, "md5_digest": "be78a8945460f3118ddd030b533ff920", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7047, "upload_time": "2016-12-15T01:13:53", "url": "https://files.pythonhosted.org/packages/4b/89/d2845463ab92336f307ad669963b8260a8d1ac7d55576c6637dd70813762/pystrainer-1.0.1.tar.gz" } ], "1.1.0": [ { "comment_text": "", "digests": { "md5": "3248d09a22fa2330896e172b6872989c", "sha256": "b2a5b0644705d762dabe90293ec448e351c00173640147111d698f40efcc1787" }, "downloads": -1, "filename": "pystrainer-1.1.0.tar.gz", "has_sig": false, "md5_digest": "3248d09a22fa2330896e172b6872989c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7064, "upload_time": "2016-12-27T05:17:26", "url": "https://files.pythonhosted.org/packages/c8/34/ad5b64bd9db47fe4878db35652b3faeac3707897bcf6e8bba16d3cadfd20/pystrainer-1.1.0.tar.gz" } ], "1.1.1": [ { "comment_text": "", "digests": { "md5": "15b8bd856ca100eee2aa6b2fda86d8c3", "sha256": "3a9a337c3fd4895385f2a9c8a4e8bdfefe2bb91ffecd8ef6755d362b24f8f8d6" }, "downloads": -1, "filename": "pystrainer-1.1.1.tar.gz", "has_sig": false, "md5_digest": "15b8bd856ca100eee2aa6b2fda86d8c3", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7051, "upload_time": "2017-03-21T00:33:23", "url": "https://files.pythonhosted.org/packages/ce/9b/c992147784d4282a2b2bee006231dc589fed5309821eb4bd20e3f409301f/pystrainer-1.1.1.tar.gz" } ], "1.2.0": [ { "comment_text": "", "digests": { "md5": "56a46078630606c4afcbfa6917e1b4d6", "sha256": "dd634884555ec456c2d35b5353a6fa1191b79a0d91f9f2ba4c76fa6dbdc22b59" }, "downloads": -1, "filename": "pystrainer-1.2.0.tar.gz", "has_sig": false, "md5_digest": "56a46078630606c4afcbfa6917e1b4d6", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7447, "upload_time": "2017-05-25T02:57:58", "url": "https://files.pythonhosted.org/packages/6a/ea/8fbf60c686482888102ce4dfb8d8fb14cd70b5352ce229fbbc34899ad159/pystrainer-1.2.0.tar.gz" } ], "1.3.0": [ { "comment_text": "", "digests": { "md5": "e61f3802e7682701e0db991031db7e85", "sha256": "f8ef911fc8e355b5d809af9bca2f6941ef90081f08b496181945fa3d8da7f669" }, "downloads": -1, "filename": "pystrainer-1.3.0.tar.gz", "has_sig": false, "md5_digest": "e61f3802e7682701e0db991031db7e85", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7492, "upload_time": "2017-07-22T20:05:39", "url": "https://files.pythonhosted.org/packages/c0/00/ad47e98c85cdfa7eed5d7ee790de1215b536f3ef0258844c550e8014850c/pystrainer-1.3.0.tar.gz" } ], "1.3.1": [ { "comment_text": "", "digests": { "md5": "66a476e10a4fa4b7e7c50b41926024b8", "sha256": "ad4e2882f31fe36c6538ef20fc73213e8df5d666857d9d2b140be492ed044e1f" }, "downloads": -1, "filename": "pystrainer-1.3.1.tar.gz", "has_sig": false, "md5_digest": "66a476e10a4fa4b7e7c50b41926024b8", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7480, "upload_time": "2017-09-14T15:17:30", "url": "https://files.pythonhosted.org/packages/ba/6f/f43227bb174d7e680375efd1bcd6c1f6365229445522ac4bee5bffed8b45/pystrainer-1.3.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "66a476e10a4fa4b7e7c50b41926024b8", "sha256": "ad4e2882f31fe36c6538ef20fc73213e8df5d666857d9d2b140be492ed044e1f" }, "downloads": -1, "filename": "pystrainer-1.3.1.tar.gz", "has_sig": false, "md5_digest": "66a476e10a4fa4b7e7c50b41926024b8", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7480, "upload_time": "2017-09-14T15:17:30", "url": "https://files.pythonhosted.org/packages/ba/6f/f43227bb174d7e680375efd1bcd6c1f6365229445522ac4bee5bffed8b45/pystrainer-1.3.1.tar.gz" } ] }