{ "info": { "author": "Tommaso R. Donnarumma", "author_email": "tawmas@tawmas.net", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Natural Language :: English", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.7", "Topic :: Software Development :: Libraries", "Topic :: Software Development :: Libraries :: Python Modules" ], "description": "=======\nSchemes\n=======\n\n\nSchemes is a library for validating and deserializing input obtained via JSON,\nXML, msgpack or other similar formats, and for preparing data for serialization\nfor output to the same formats and/or for persistence (typically, but not\nexclusively, to a cache or a NoSQL data store).\n\n\nOverview\n--------\n\nIn order to use Schemes, you need at first to define one or more schemas::\n\n user_schema = Schema({'id': ReadOnly(Long()),\n 'username': String(min_length=3, max_length=16),\n 'fullname': Optional(String()),\n 'password': WriteOnly(String(min_length=8))})\n\nYou can then use the schema definition to create a document from input data::\n\n try:\n user = user_schema.create(\n {'username': u'tawmas', 'password': u'supersecret'})\n except ValidationError as error:\n print(error.reason)\n\nAll fields are implicitly treated as mandatory, unless marked with a modifier\nsuch as ``Optional``, ``ReadOnly`` or ``Internal``. If one or more validation\nerrors occurr, Schemes will report all validation errors in a friendly\ndictionary structure.\n\nYou can update an existing document from new input data::\n\n try:\n user = user_schema.patch(user, {'password': u'verysecure'})\n except ValidationError as error:\n print(error.reason)\n\n``patch()`` accepts partial inputs, and it only overwrites the fields which are\nactually present in the input data.\n\nFinally, you can leverage the schema to prepare a document for output::\n\n representation = user_schema.emit(user)\n\nThis gives you a dictionary representation of your document suitable to be\nserialized. Non-public fields are omitted, and some field types are converted\nto a serialization friendly formats (for example, datetimes are emitted as RFC\n3339 strings).\n\n\nEarly prerelease warning\n------------------------\n\nSchemes is at an early prerelease stage. As such, the public interface may well\nchange, and no documentation is available yet except for the Overview_ above.\n\nFull documentation will be made available when the project reaches the beta\nstage. In the meanwhile, you can have a look at the tests, especially the\nintegration tests in ``tests/integration``.\n\nInitial development is on Python 2.7. The code is expected, and periodically\ntested, to work on pypy, and it is expected to break on Python 3. Full support\nfor pypy and Python 3.3+ are planned for a later alpha stage.\n\n\nFeatures and roadmap\n--------------------\n\n* Validation and conversion from a serialized format for document creation\n and update.\n\n* Conversion to a serializable external representation.\n\n* Conversion to a serializable internal representation (PLANNED).\n\n* Coercion of raw data (e.g. from a database or a cache) without triggering\n full validation (PROVISIONAL IMPLEMENTATION).\n\n* Easily extensible.\n\n* Many field types supported out of the box:\n\n * booleans\n * integers\n * longs\n * floats\n * decimals (PLANNED)\n * unicode strings\n * encoded bytestrings (PLANNED)\n * datetimes\n * dates\n * lists\n * embedded schemas\n\n* Many field modifiers supported out of the box: optional (with or without a\n default value), read-only (with optional automatic creation and update\n values), write-only, internal.\n\n* Support custom rules on existing field types (PLANNED).\n\n* Alternate declarative syntax (PLANNED).\n\n* Versioned schemas with automatic upgrade and downgrade of documents (PLANNED).\n\n\nInstalling Schemes\n------------------\n\nYou can install Schemes with pip::\n\n pip install schemes\n\nIf you want to hack on Schemes or run the test suite, you will also need to\ninstall ``pytest``, and optionally the ``pytest-cov`` extension. You can\nautomatically install Schemes and its testing dependencies with pip::\n\n pip install schemes[testing]\n\n\nLicense\n-------\n\nSchemes is an open source project by `Tommaso R. Donnarumma`_, distributed under\nthe MIT license. See the ``LICENSE`` file for details.\n\nSchemes comes with an embedded copy of the `python-rfc3339`_ library by LShift\nLtd., which is also distributed under the MIT license.\n\n.. _Tommaso R. Donnarumma: http://www.tawmas.net/\n.. _python-rfc3339: https://github.com/tonyg/python-rfc3339", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://bitbucket.org/tawmas/schemes", "keywords": null, "license": "MIT License", "maintainer": null, "maintainer_email": null, "name": "schemes", "package_url": "https://pypi.org/project/schemes/", "platform": "any", "project_url": "https://pypi.org/project/schemes/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://bitbucket.org/tawmas/schemes" }, "release_url": "https://pypi.org/project/schemes/0.1/", "requires_dist": null, "requires_python": null, "summary": "Easy input validation and data manipulation.", "version": "0.1" }, "last_serial": 1000654, "releases": { "0.1": [ { "comment_text": "", "digests": { "md5": "baadb7e62ec3a2a2d39b1536d453861f", "sha256": "300cf470b81a0c8b1d14bd7f567aa48571293661f8b8feeb88d1f6c3f6674ac4" }, "downloads": -1, "filename": "schemes-0.1.tar.gz", "has_sig": false, "md5_digest": "baadb7e62ec3a2a2d39b1536d453861f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 20106, "upload_time": "2014-02-15T15:27:38", "url": "https://files.pythonhosted.org/packages/03/0a/46b94871cfc2cdcf4df47482b0182c552555af1d2d1fe126fdb57e755ffc/schemes-0.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "baadb7e62ec3a2a2d39b1536d453861f", "sha256": "300cf470b81a0c8b1d14bd7f567aa48571293661f8b8feeb88d1f6c3f6674ac4" }, "downloads": -1, "filename": "schemes-0.1.tar.gz", "has_sig": false, "md5_digest": "baadb7e62ec3a2a2d39b1536d453861f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 20106, "upload_time": "2014-02-15T15:27:38", "url": "https://files.pythonhosted.org/packages/03/0a/46b94871cfc2cdcf4df47482b0182c552555af1d2d1fe126fdb57e755ffc/schemes-0.1.tar.gz" } ] }