{"id":13813622,"url":"https://github.com/maximkulkin/lollipop","last_synced_at":"2025-03-15T11:31:43.901Z","repository":{"id":46644214,"uuid":"63717172","full_name":"maximkulkin/lollipop","owner":"maximkulkin","description":"Python data serialization/validation library","archived":false,"fork":false,"pushed_at":"2024-04-26T12:11:50.000Z","size":307,"stargazers_count":36,"open_issues_count":4,"forks_count":8,"subscribers_count":7,"default_branch":"master","last_synced_at":"2024-05-01T23:18:53.758Z","etag":null,"topics":["json","python","serialization","validation"],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/maximkulkin.png","metadata":{"files":{"readme":"README.rst","changelog":"CHANGELOG.rst","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-07-19T18:10:50.000Z","updated_at":"2024-06-20T23:29:13.886Z","dependencies_parsed_at":"2024-06-20T23:29:12.895Z","dependency_job_id":"bd32280b-e958-4b6c-b523-429e8e43dd67","html_url":"https://github.com/maximkulkin/lollipop","commit_stats":{"total_commits":158,"total_committers":7,"mean_commits":"22.571428571428573","dds":0.09493670886075944,"last_synced_commit":"04bb038d93405d13ba3d193766014818bc5b1fcf"},"previous_names":[],"tags_count":15,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maximkulkin%2Flollipop","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maximkulkin%2Flollipop/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maximkulkin%2Flollipop/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maximkulkin%2Flollipop/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/maximkulkin","download_url":"https://codeload.github.com/maximkulkin/lollipop/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":221571841,"owners_count":16845530,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["json","python","serialization","validation"],"created_at":"2024-08-04T04:01:23.569Z","updated_at":"2024-10-26T19:33:20.802Z","avatar_url":"https://github.com/maximkulkin.png","language":"Python","funding_links":[],"categories":["Python"],"sub_categories":[],"readme":"********\nlollipop\n********\n\n.. image:: https://img.shields.io/pypi/l/lollipop.svg\n    :target: https://github.com/maximkulkin/lollipop/blob/master/LICENSE\n    :alt: License: MIT\n\n.. image:: https://img.shields.io/travis/maximkulkin/lollipop.svg\n    :target: https://travis-ci.org/maximkulkin/lollipop\n    :alt: Build Status\n\n.. image:: https://readthedocs.org/projects/lollipop/badge/?version=latest\n    :target: http://lollipop.readthedocs.io/en/latest/?badge=latest\n    :alt: Documentation Status\n\n.. image:: https://img.shields.io/pypi/v/lollipop.svg\n    :target: https://pypi.python.org/pypi/lollipop\n    :alt: PyPI\n\nData serialization and validation library\n\nFeatures\n========\n* flexible schema definition API with powerful type combinators\n* data validation\n* serialization/deserialization\n* in-place deserialization\n\nExample\n=======\n.. code-block:: python\n\n    from lollipop.types import Object, String, Date\n    from lollipop.validators import Length\n    from collections import namedtuple\n    from datetime import date\n\n    Person = namedtuple('Person', ['name'])\n    Book = namedtuple('Book', ['title', 'publish_date', 'author'])\n\n    PersonType = Object({\n        'name': String(validate=Length(min=1)),\n    }, constructor=Person)\n\n    BookType = Object({\n        'title': String(),\n        'publish_date': Date(),\n        'author': PersonType,\n    }, constructor=Book)\n\n    harryPotter1 = Book(\n        title='Harry Potter and the Philosopher\\'s Stone',\n        publish_date=date(1997, 6, 26),\n        author=Person(name='J. K. Rowling')\n    )\n\n    # Dumping\n    BookType.dump(harryPotter1)\n    # =\u003e {'title': 'Harry Potter and the Philosopher\\'s Stone',\n    #     'publish_date': '1997-06-26',\n    #     'author': {'name': 'J. K. Rowling'}}\n\n    # Loading\n    BookType.load({'title': 'Harry Potter and the Philosopher\\'s Stone',\n                   'publish_date': '1997-06-26',\n                   'author': {'name': 'J. K. Rowling'}})\n    # =\u003e Book(title='Harry Potter and the Philosopher\\'s Stone',\n    #         publish_date=date(1997, 06, 26),\n    #         author=User(name='J. K. Rowling'))\n\n    # Partial inplace loading\n    BookType.load_into(harryPotter1, {'publish_date': '1997-06-27'})\n    # =\u003e Book(title='Harry Potter and the Philosopher\\'s Stone',\n    #         publish_date=date(1997, 06, 27),\n    #         author=User(name='J. K. Rowling'))\n\n    # Loading list of objects\n    List(BookType).load([\n        {'title': 'Harry Potter and the Philosopher\\'s Stone',\n         'publish_date': '1997-06-26',\n         'author': {'name': 'J. K. Rowling'}},\n        {'title': 'Harry Potter and the Chamber of Secrets',\n         'publish_date': '1998-07-02',\n         'author': {'name': 'J. K. Rowling'}},\n    ])\n    # =\u003e [Book(...), Book(...)]\n\n    # Validation\n    BookType.validate({\n        'title': 'Harry Potter and the Philosopher\\'s Stone',\n        'author': {'name': ''},\n    })\n    # =\u003e {'author': {'name': 'Length should be at least 1'},\n    #     'publish_date': 'Value is required'}\n\n\nInstallation\n============\n\n::\n\n    $ pip install lollipop\n\n\nDocumentation\n=============\n\nDocumentation is available at http://lollipop.readthedocs.io/ .\n\n\nRequirements\n============\n\n- Python \u003e= 2.6 or \u003c= 3.6\n\n\nProject Links\n=============\n\n- Documentation: http://lollipop.readthedocs.io/\n- PyPI: https://pypi.python.org/pypi/lollipop\n- Issues: https://github.com/maximkulkin/lollipop/issues\n\n\nLicense\n=======\n\nMIT licensed. See the bundled `LICENSE \u003chttps://github.com/maximkulkin/lollipop/blob/master/LICENSE\u003e`_ file for more details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmaximkulkin%2Flollipop","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmaximkulkin%2Flollipop","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmaximkulkin%2Flollipop/lists"}