*******************
lollipop-jsonschema
*******************
.. image:: https://img.shields.io/pypi/l/lollipop-jsonschema.svg
:target: https://github.com/maximkulkin/lollipop-jsonschema/blob/master/LICENSE
:alt: License: MIT
.. image:: https://img.shields.io/travis/maximkulkin/lollipop-jsonschema.svg
:target: https://travis-ci.org/maximkulkin/lollipop-jsonschema
:alt: Build Status
.. image:: https://img.shields.io/pypi/v/lollipop-jsonschema.svg
:target: https://pypi.python.org/pypi/lollipop-jsonschema
:alt: PyPI
Library to convert `Lollipop schema <https://github.com/maximkulkin/lollipop>`_
to `JSON schema <http://json-schema.org>`_ in a format compliant with OpenAPI 3.1.0.
Example
=======
.. code:: python
import lollipop.types as lt
import lollipop.validators as lv
EMAIL_REGEXP = r"^[a-zA-Z0-9_.+-]+@[a-zA-Z0-9-]+\.[a-zA-Z0-9-.]+$"
USER = lt.Object({
'name': lt.String(validate=lv.Length(min=1)),
'email': lt.String(validate=lv.Regexp(EMAIL_REGEXP)),
'age': lt.Optional(lt.Integer(validate=lv.Range(min=18))),
}, name='User', description='User information')
from lollipop_jsonschema import json_schema
import json
print json.dumps(json_schema(USER), indent=2)
# {
# "title": "User",
# "description": "User information",
# "type": "object",
# "properties": {
# "age": {
# "type": "integer",
# "minimum": 18
# },
# "name": {
# "type": "string",
# "minLength": 1
# },
# "email": {
# "type": "string",
# "pattern": "^[a-zA-Z0-9_.+-]+@[a-zA-Z0-9-]+\\.[a-zA-Z0-9-.]+$"
# }
# },
# "required": [
# "name",
# "email"
# ]
# }
Installation
============
::
$ pip install lollipop-jsonschema
Requirements
============
- Python >= 2.7 and <= 3.6
- `lollipop <https://pypi.python.org/pypi/lollipop>`_ >= 1.1.5
Project Links
=============
- PyPI: https://pypi.python.org/pypi/lollipop-jsonschema
- Issues: https://github.com/maximkulkin/lollipop-jsonschema/issues
License
=======
MIT licensed. See the bundled `LICENSE <https://github.com/maximkulkin/lollipop-jsconschema/blob/master/LICENSE>`_ file for more details.
Raw data
{
"_id": null,
"home_page": "https://github.com/maximkulkin/lollipop-jsonschema",
"name": "lollipop-jsonschema",
"maintainer": null,
"docs_url": null,
"requires_python": null,
"maintainer_email": null,
"keywords": "lollipop, json, schema",
"author": "Maxim Kulkin",
"author_email": "maxim.kulkin@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/e6/3a/cafef31e4e5d349a25fc198bc4ee902f64c80a9eb14187e89ce6dbf3ae71/lollipop_jsonschema-0.9.0.tar.gz",
"platform": null,
"description": "*******************\nlollipop-jsonschema\n*******************\n\n.. image:: https://img.shields.io/pypi/l/lollipop-jsonschema.svg\n :target: https://github.com/maximkulkin/lollipop-jsonschema/blob/master/LICENSE\n :alt: License: MIT\n\n.. image:: https://img.shields.io/travis/maximkulkin/lollipop-jsonschema.svg\n :target: https://travis-ci.org/maximkulkin/lollipop-jsonschema\n :alt: Build Status\n\n.. image:: https://img.shields.io/pypi/v/lollipop-jsonschema.svg\n :target: https://pypi.python.org/pypi/lollipop-jsonschema\n :alt: PyPI\n\nLibrary to convert `Lollipop schema <https://github.com/maximkulkin/lollipop>`_\nto `JSON schema <http://json-schema.org>`_ in a format compliant with OpenAPI 3.1.0.\n\nExample\n=======\n.. code:: python\n\n import lollipop.types as lt\n import lollipop.validators as lv\n\n EMAIL_REGEXP = r\"^[a-zA-Z0-9_.+-]+@[a-zA-Z0-9-]+\\.[a-zA-Z0-9-.]+$\"\n\n USER = lt.Object({\n 'name': lt.String(validate=lv.Length(min=1)),\n 'email': lt.String(validate=lv.Regexp(EMAIL_REGEXP)),\n 'age': lt.Optional(lt.Integer(validate=lv.Range(min=18))),\n }, name='User', description='User information')\n\n from lollipop_jsonschema import json_schema\n import json\n\n print json.dumps(json_schema(USER), indent=2)\n # {\n # \"title\": \"User\",\n # \"description\": \"User information\",\n # \"type\": \"object\",\n # \"properties\": {\n # \"age\": {\n # \"type\": \"integer\",\n # \"minimum\": 18\n # },\n # \"name\": {\n # \"type\": \"string\",\n # \"minLength\": 1\n # },\n # \"email\": {\n # \"type\": \"string\",\n # \"pattern\": \"^[a-zA-Z0-9_.+-]+@[a-zA-Z0-9-]+\\\\.[a-zA-Z0-9-.]+$\"\n # }\n # },\n # \"required\": [\n # \"name\",\n # \"email\"\n # ]\n # }\n\nInstallation\n============\n::\n\n $ pip install lollipop-jsonschema\n\nRequirements\n============\n\n- Python >= 2.7 and <= 3.6\n- `lollipop <https://pypi.python.org/pypi/lollipop>`_ >= 1.1.5\n\nProject Links\n=============\n\n- PyPI: https://pypi.python.org/pypi/lollipop-jsonschema\n- Issues: https://github.com/maximkulkin/lollipop-jsonschema/issues\n\nLicense\n=======\n\nMIT licensed. See the bundled `LICENSE <https://github.com/maximkulkin/lollipop-jsconschema/blob/master/LICENSE>`_ file for more details.\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "Library to convert Lollipop schema to JSON schema",
"version": "0.9.0",
"project_urls": {
"Homepage": "https://github.com/maximkulkin/lollipop-jsonschema"
},
"split_keywords": [
"lollipop",
" json",
" schema"
],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "64c3666069de9add3ccefdad9b4ee315e8054616d2dadc9b59e9a9bcfcea0f6d",
"md5": "ddb0d2a047edaf20caf3d7c4ca1a1b19",
"sha256": "17535a4d19321b64211b2109bf9fc44eea899b34b30424d6bd21dab826abe627"
},
"downloads": -1,
"filename": "lollipop_jsonschema-0.9.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "ddb0d2a047edaf20caf3d7c4ca1a1b19",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": null,
"size": 7092,
"upload_time": "2025-07-24T18:30:07",
"upload_time_iso_8601": "2025-07-24T18:30:07.769077Z",
"url": "https://files.pythonhosted.org/packages/64/c3/666069de9add3ccefdad9b4ee315e8054616d2dadc9b59e9a9bcfcea0f6d/lollipop_jsonschema-0.9.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "e63acafef31e4e5d349a25fc198bc4ee902f64c80a9eb14187e89ce6dbf3ae71",
"md5": "e133f4f002a4f66b81dd78cc2a1a97e1",
"sha256": "b2c69280f9cfc677c49b99c4782b9c31cb4f2f3cdbdc24b00f98ef1aad501371"
},
"downloads": -1,
"filename": "lollipop_jsonschema-0.9.0.tar.gz",
"has_sig": false,
"md5_digest": "e133f4f002a4f66b81dd78cc2a1a97e1",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 11199,
"upload_time": "2025-07-24T18:30:09",
"upload_time_iso_8601": "2025-07-24T18:30:09.068471Z",
"url": "https://files.pythonhosted.org/packages/e6/3a/cafef31e4e5d349a25fc198bc4ee902f64c80a9eb14187e89ce6dbf3ae71/lollipop_jsonschema-0.9.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-07-24 18:30:09",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "maximkulkin",
"github_project": "lollipop-jsonschema",
"travis_ci": true,
"coveralls": false,
"github_actions": false,
"tox": true,
"lcname": "lollipop-jsonschema"
}