{ "info": { "author": "Pierre Tardy", "author_email": "tardyp@gmail.com", "bugtrack_url": null, "classifiers": [ "Intended Audience :: Developers", "License :: OSI Approved :: BSD License", "Programming Language :: Python", "Topic :: Software Development :: Libraries :: Python Modules" ], "description": "Yamlconfig\r\n==========\r\n\r\nTools for loading and validating yaml config files.\r\n\r\npackage is shipped with 2 entry points scripts:\r\n\r\n* yamlvalidate: This tool can validate a yaml file against its spec.\r\n\r\n The spec file can be either automatically found given the filename or given as parameter with ``--meta``\r\n\r\n* yaml2rst: This tool automatically creates a rst documentation of the types defined in a directory.\r\n\r\n\r\nYamlConfig module\r\n=================\r\n\r\nA common problem for the complex CI system developer is to separate\r\nits configuration logic from its configuration data.\r\n\r\n- Logic is the configuration of the builder, what does it build,\r\n what are the buildsteps, etc\r\n- Data is the parameter you want to easily change in the day to day\r\n maintainance work. What are the slaves, and their capabilities?\r\n What branches are needed to be tracked? under what conditions? etc\r\n\r\nYamlConfig helps to resolve this problem by providing tools to create\r\nand describe a set of yaml files that are used as input for your master.cfg\r\n\r\nOriginally made for buildbot configuration, the spec format it defines can\r\nbe used to describe any kind of json compatible data.\r\n\r\n\r\nEach parsed yaml file can be given a ``.meta.yaml`` file that acts as a\r\nschema file describing what is allowed in the file, and potencially how to\r\npresent it in an edition UI.\r\n\r\n.. _Meta-File-Format:\r\n\r\n``.meta.yaml`` file Format\r\n---------------------------\r\n\r\nthe meta yaml file is a yaml file made of nested dicts, describing the type\r\nof data the type checker is waiting for.\r\n\r\nRoot Node\r\n`````````\r\nthe meta yaml file must describe the ``root`` type, which will snowball\r\nall the nested type checks\r\n\r\n.. code-block:: yaml\r\n\r\n root:\r\n type: dict\r\n kids:\r\n param1:\r\n type: int\r\n param2:\r\n type: string\r\n\r\nwill match:\r\n\r\n.. code-block:: yaml\r\n\r\n param1: 1\r\n param2: stringvalue\r\n\r\nimports Node\r\n`````````````\r\n\r\nThe meta yaml file can use types described in another file. For that, it will import\r\na list of ``.types.yaml`` files.\r\n\r\nA ``.types.yaml`` is a yaml file defining a map of named types. ex:\r\n\r\n.. code-block:: yaml\r\n\r\n foo:\r\n type: string\r\n values: [bar]\r\n\r\ncan be used in a ``myconfig.meta.yaml``:\r\n\r\n.. code-block:: yaml\r\n\r\n imports:\r\n - foo.type.yaml\r\n root:\r\n type: dict\r\n kids:\r\n foo:\r\n type: listoffoos\r\n\r\nBase types\r\n``````````\r\nbase types are:\r\n\r\nint\r\n an integer\r\n\r\nstring\r\n a string\r\n\r\nboolean\r\n a true/false boolean\r\n\r\nfloat\r\n a floating point number\r\n\r\nCompound types\r\n``````````````\r\nA value of compound type is composed of several subtypes values or key/value:\r\n\r\ndict\r\n an associative array that has a defined list of childrens key\r\n\r\nmap\r\n an associative array that has an arbitrary list childrens keys\r\n\r\nlist\r\n a list of arbitrary values\r\n\r\nset\r\n a list that ensure member unicity (you cannot have several time the same value)\r\n\r\nSpecifying types of values\r\n``````````````````````````\r\nFor ``map``, ``list``, ``set``, it is possible to specify what type is expected\r\nas the values. The syntax is:\r\n\r\n.. code-block:: yaml\r\n\r\n type: ofs\r\n\r\nfor example, following types are valid\r\n\r\n.. code-block:: yaml\r\n\r\n type: mapofstrings\r\n type: listofints\r\n type: listofsetsofints\r\n\r\nUser defined types\r\n``````````````````\r\nYou can specify a meta.yaml file defining the map of types, you can reuse inside your\r\nmain meta.yaml file. e.g:\r\n\r\n.. code-block:: yaml\r\n\r\n location:\r\n type: string\r\n values: [l1,l2,l3,l4,l5,l6]\r\n\r\nThis defines a ``location`` type, which is a string with 6 possible values.\r\n\r\ntypes modifers\r\n``````````````\r\nEach type can be associated with a number of modifiers, that will extend the number\r\nof specification you describe for it:\r\n\r\nvalues:\r\n a set of possible values that the attribute can take\r\n\r\nname:\r\n the name of the attribute as displayed in the UI\r\n\r\ndefault:\r\n The value the attribute takes if it is not defined explicitly\r\n\r\nforbidden:\r\n a python expression checking whether this attribute should not be defined in\r\n a particular configuration\r\n\r\nrequired:\r\n a python expression checking whether this attribute must be defined in\r\n a particular configuration\r\n\r\nmaybenull:\r\n a python expression checking whether this attribute must be defined in\r\n a particular configuration\r\n\r\n\r\nMore complex example\r\n--------------------\r\n\r\nThe ``meta.yaml``:\r\n\r\n.. code-block:: yaml\r\n\r\n root:\r\n type: dict\r\n kids:\r\n slaves:\r\n type: listofdicts\r\n name: Build Slaves\r\n kids:\r\n caps:\r\n type: dict\r\n name: Capabilities\r\n kids:\r\n builder:\r\n name: Used by builder\r\n type: setofstrings\r\n values: [ autolint, build ]\r\n required: true\r\n location:\r\n type: location\r\n required: true\r\n speed:\r\n type: string\r\n default: fast\r\n values: [fast,slow]\r\n slaves:\r\n type: setofstrings\r\n\r\nmatches a yaml file like:\r\n\r\n.. code-block:: yaml\r\n\r\n slaves:\r\n - caps:\r\n builder: [build]\r\n location: l4\r\n slaves: [buildbot1build]\r\n - caps:\r\n builder: [autolint, build]\r\n location: l1\r\n speed: fast\r\n slaves: [build3build, build4build, build5build]", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "http://github.com/tardyp/yamltypes", "keywords": "yaml,schema", "license": "BSD", "maintainer": "", "maintainer_email": "", "name": "yamltypes", "package_url": "https://pypi.org/project/yamltypes/", "platform": "Any", "project_url": "https://pypi.org/project/yamltypes/", "project_urls": { "Download": "UNKNOWN", "Homepage": "http://github.com/tardyp/yamltypes" }, "release_url": "https://pypi.org/project/yamltypes/1.0/", "requires_dist": null, "requires_python": null, "summary": "tools for validating, documenting, and editing json and yaml data", "version": "1.0" }, "last_serial": 1392080, "releases": { "1.0": [ { "comment_text": "", "digests": { "md5": "d1f30b7727ec1a3d989ea6516a118356", "sha256": "703f7216032104211a8ab9e92a62774e54941295eecd2503dade01e0849ff816" }, "downloads": -1, "filename": "yamltypes-1.0.tar.gz", "has_sig": false, "md5_digest": "d1f30b7727ec1a3d989ea6516a118356", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 18240, "upload_time": "2015-01-22T16:39:35", "url": "https://files.pythonhosted.org/packages/cc/86/5d196339fd16cecbe701f721438e5fe23b6591e4c9760e6ac92a8e598b01/yamltypes-1.0.tar.gz" }, { "comment_text": "", "digests": { "md5": "efd7772d84cf3e89bad6e8e53463396e", "sha256": "6e39a36ef6adff0ed3a198c9d8268c87a162160bf1a614061ce8ccac730801fc" }, "downloads": -1, "filename": "yamltypes-1.0.zip", "has_sig": false, "md5_digest": "efd7772d84cf3e89bad6e8e53463396e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 23120, "upload_time": "2015-01-22T16:39:37", "url": "https://files.pythonhosted.org/packages/ae/81/a4db307aa6e769860326db8ac1b88d8d63506429ce54244a6223e33f93ca/yamltypes-1.0.zip" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "d1f30b7727ec1a3d989ea6516a118356", "sha256": "703f7216032104211a8ab9e92a62774e54941295eecd2503dade01e0849ff816" }, "downloads": -1, "filename": "yamltypes-1.0.tar.gz", "has_sig": false, "md5_digest": "d1f30b7727ec1a3d989ea6516a118356", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 18240, "upload_time": "2015-01-22T16:39:35", "url": "https://files.pythonhosted.org/packages/cc/86/5d196339fd16cecbe701f721438e5fe23b6591e4c9760e6ac92a8e598b01/yamltypes-1.0.tar.gz" }, { "comment_text": "", "digests": { "md5": "efd7772d84cf3e89bad6e8e53463396e", "sha256": "6e39a36ef6adff0ed3a198c9d8268c87a162160bf1a614061ce8ccac730801fc" }, "downloads": -1, "filename": "yamltypes-1.0.zip", "has_sig": false, "md5_digest": "efd7772d84cf3e89bad6e8e53463396e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 23120, "upload_time": "2015-01-22T16:39:37", "url": "https://files.pythonhosted.org/packages/ae/81/a4db307aa6e769860326db8ac1b88d8d63506429ce54244a6223e33f93ca/yamltypes-1.0.zip" } ] }