{"id":24738661,"url":"https://github.com/zweifisch/yaddle-py","last_synced_at":"2026-05-04T14:36:12.752Z","repository":{"id":57477985,"uuid":"39412506","full_name":"zweifisch/yaddle-py","owner":"zweifisch","description":"data format description language translates to json-schema","archived":false,"fork":false,"pushed_at":"2015-07-26T01:36:17.000Z","size":148,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-27T22:55:09.038Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/zweifisch.png","metadata":{"files":{"readme":"README.rst","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-07-20T22:57:52.000Z","updated_at":"2016-05-11T00:41:15.000Z","dependencies_parsed_at":"2022-09-10T08:22:33.745Z","dependency_job_id":null,"html_url":"https://github.com/zweifisch/yaddle-py","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zweifisch%2Fyaddle-py","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zweifisch%2Fyaddle-py/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zweifisch%2Fyaddle-py/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zweifisch%2Fyaddle-py/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zweifisch","download_url":"https://codeload.github.com/zweifisch/yaddle-py/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245006658,"owners_count":20546136,"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":[],"created_at":"2025-01-27T22:55:17.155Z","updated_at":"2026-05-04T14:36:12.694Z","avatar_url":"https://github.com/zweifisch.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"yaddle\n======\n\n|Build Status|\n\nYet Another Data format Description LanguagE\n\n::\n\n    @role: admin | author | collaborator | \"role with space\"\n\n    user:\n      name: str{3,20}\n      age: int{10,200}\n      gender: male | female\n      roles: [@role]\n      description?: str{,200}\n\ntranslated to json-schema\n\n.. code:: javascript\n\n    {\n      \"additionalProperties\": false,\n      \"definitions\": {\n        \"role\": {\n          \"enum\": [\n            \"admin\",\n            \"author\",\n            \"collaborator\",\n            \"role with space\"\n          ]\n        }\n      },\n      \"required\": [\n        \"user\"\n      ],\n      \"type\": \"object\",\n      \"properties\": {\n        \"user\": {\n          \"additionalProperties\": false,\n          \"required\": [\n            \"name\",\n            \"age\",\n            \"gender\",\n            \"roles\"\n          ],\n          \"type\": \"object\",\n          \"properties\": {\n            \"gender\": {\n              \"enum\": [\n                \"male\",\n                \"female\"\n              ]\n            },\n            \"age\": {\n              \"minimum\": 10,\n              \"type\": \"integer\",\n              \"maximum\": 200\n            },\n            \"name\": {\n              \"minLength\": 3,\n              \"type\": \"string\",\n              \"maxLength\": 20\n            },\n            \"roles\": {\n              \"items\": {\n                \"$ref\": \"#/definitions/role\"\n              },\n              \"type\": \"array\"\n            },\n            \"description\": {\n              \"type\": \"string\",\n              \"maxLength\": 200\n            }\n          }\n        }\n      }\n    }\n\napi\n---\n\nuse load/loads to translate yaddle into json-schema\n\n.. code:: py\n\n    from yaddle import load, loads\n    load(open(\"some.ydl\"))\n    loads(\"\"\"[str]{,3}\"\"\")\n\ncli\n\n.. code:: sh\n\n    cat schema.ydl | python -m yaddle.tool\n\nmore details\n------------\n\nnumber\n~~~~~~\n\n::\n\n    int{100,200}\n\n.. code:: javascript\n\n    {\n        \"type\": \"integer\",\n        \"minimum\": 100,\n        \"maximum\": 200\n    }\n\n::\n\n    num{,,0.1}\n\n.. code:: javascript\n\n    {\n        \"type\": \"number\",\n        \"multipleOf\": 0.1\n    }\n\nstring\n~~~~~~\n\n::\n\n    str{1,2} /pattern/\n\n.. code:: javascript\n\n    {\n        \"type\": \"string\",\n        \"minLength\": 1,\n        \"maxLength\": 20,\n        \"pattern\": \"pattern\"\n    }\n\n::\n\n    /pattern/\n\n.. code:: javascript\n\n    {\n        \"type\": \"string\",\n        \"pattern\": \"pattern\"\n    }\n\nformat ``date-time``, ``email``, ``hostname``, ``ipv4``, ``ipv6``,\n``uri``\n\n::\n\n    %email\n\n.. code:: javascript\n\n    {\n        \"format\": \"email\"\n    }\n\narray\n~~~~~\n\n::\n\n    [str]{1,10}\n\n.. code:: javascript\n\n    {\n        \"type\": \"array\",\n        \"minItems\": 1,\n        \"maxItems\": 10,\n        \"items\": {\n            \"type\": \"string\"\n        }\n    }\n\n::\n\n    [str|num]\n\n.. code:: javascript\n\n    {\n        \"type\": \"array\",\n        \"items\": {\n            oneOf: [\n                {\"type\": \"string\"},\n                {\"type\": \"number\"}\n            ]\n        }\n    }\n\n::\n\n    [str, num]\n\n.. code:: javascript\n\n    {\n        \"type\": \"array\",\n        \"items\": [\n            {\"type\": \"string\"},\n            {\"type\": \"number\"}\n        }\n    }\n\n``!`` for uniqueItems\n\n::\n\n    [num]!\n\n.. code:: javascript\n\n    {\n        \"type\": \"array\",\n        \"items\": {\n            {type: \"number\"}\n        },\n        \"uniqueItems\": true\n    }\n\nobject\n~~~~~~\n\n-  all properties are required, except those one with a ``?`` suffix\n-  ``...`` to allow ``additionalProperties``\n\n::\n\n    key: str\n    size?: number\n    ...\n\n.. code:: javascript\n\n    {\n        \"type\": \"object\",\n        \"properties\": {\n            \"key\": {\n                \"type\": \"string\"\n            },\n            \"size\": {\n                \"type\": \"number\"\n            },\n            \"required\": [\"key\"]\n        }\n        \"additionalProperties\": true\n    }\n\noneOf, anyOf, allOf\n~~~~~~~~~~~~~~~~~~~\n\n-  ``|`` for oneOf like ``@ref | @ref2``\n-  ``/`` for anyOf\n-  ``\u0026`` for allOf\n\nreference\n~~~~~~~~~\n\nlocal reference\n\n::\n\n    @address:\n        street_address: str\n        city: str\n        state: str\n\n    billing_address: @address\n    shipping_address: @address\n\n.. code:: javascript\n\n    {\n      \"additionalProperties\": false,\n      \"definitions\": {\n        \"address\": {\n          \"additionalProperties\": false,\n          \"required\": [\n            \"street_address\",\n            \"city\",\n            \"state\"\n          ],\n          \"type\": \"object\",\n          \"properties\": {\n            \"city\": {\n              \"type\": \"string\"\n            },\n            \"state\": {\n              \"type\": \"string\"\n            },\n            \"street_address\": {\n              \"type\": \"string\"\n            }\n          }\n        }\n      },\n      \"required\": [\n        \"billing_address\",\n        \"shipping_address\"\n      ],\n      \"type\": \"object\",\n      \"properties\": {\n        \"billing_address\": {\n          \"$ref\": \"#/definitions/address\"\n        },\n        \"shipping_address\": {\n          \"$ref\": \"#/definitions/address\"\n        }\n      }\n    }\n\nreferece remote schema(TBD)\n\n::\n\n    @\"http://example.com/schema\"\n\n    @product:\n        price: num{0,}\n        title: str{,200}\n\nreferece it in another schema\n\n::\n\n    @example: \"http://example.com/schema\"\n\n    products: [@example:product]\n\nexamples\n--------\n\nexample from http://json-schema.org/example2.html translated to yaddle\n\n::\n\n    @diskDevice:\n        type: disk\n        divice: /^/dev/[^/]+(/[^/]+)*$/\n    @diskUUID:\n        type: disk\n        label: /^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$/\n    @nfs:\n        type: nfs\n        remotePath: /^(/[^/]+)+$/\n        server: %host-name | %ipv4 | %ipv6\n    @tmpfs:\n        type: tmpfs\n        sizeInMB: int{16,512}\n\n    storage: @diskDevice | @diskUUID | @nfs | @tmpfs\n    fstype?: ext3 | ext4 | btrfs\n    options?: [str]{1,}!\n    readonly?: bool\n\n.. |Build Status| image:: https://img.shields.io/travis/zweifisch/yaddle-py.svg?style=flat\n   :target: https://travis-ci.org/zweifisch/yaddle-py\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzweifisch%2Fyaddle-py","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzweifisch%2Fyaddle-py","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzweifisch%2Fyaddle-py/lists"}