{ "info": { "author": "Andy Yulius", "author_email": "julot@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "Environment :: Console", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python", "Topic :: Documentation", "Topic :: Utilities" ], "description": "################\nsphinxcontrib.dd\n################\n\nSphinx extension for Data Dictionary and Database Diagram.\n\nThe syntax is using extended `Swagger `__\nformat.\n\nDatabase diagram will be generated by `GraphViz `__.\nBecause its dependency to GraphViz,\nplease remember to properly setup\n`GraphViz extension `__\nfirst.\n\n\nInstallation\n============\n\n::\n\n > pip install sphinxcontrib-dd\n\nSetup extension in ``conf.py`` file.\n\n::\n\n extensions = ['sphinxcontrib.dd']\n\n\nSchema\n======\n\n- definitions\n- tables\n- relationships\n\n\ndefinitions\n-----------\n\nThis is definitions as specified by Swagger\n`here `__.\n\nExample:\n\n::\n\n definitions:\n Identity:\n type: integer\n format: int64\n minimum: 1\n\n User:\n properties:\n id:\n $ref: '#/definitions/Identity'\n name:\n type: nvarchar\n maxLength: 255\n\n Role:\n properties:\n id:\n $ref: '#/definitions/Identity'\n name:\n type: nvarchar\n maxLength: 255\n\n UserRole:\n properties:\n id:\n $ref: '#/definitions/Identity'\n user_id:\n $ref: '#/definitions/Identity'\n role_id:\n $ref: '#/definitions/Identity'\n\n\ntables\n------\n\n=========== ====================================\nField Name Description\n=========== ====================================\nname Table name\ndescription Information about the table\ncolumns Should be simply $ref to definitions\n=========== ====================================\n\nExample:\n\n::\n\n tables:\n User:\n name: users\n description: Table to stores user information.\n columns:\n $ref: '#/definitions/User'\n Role:\n name: roles\n description: Table to stores roles.\n columns:\n $ref: '#/definitions/Role'\n UserRole:\n name: users_roles\n description: Table to stores user roles.\n columns:\n $ref: '#/definitions/UserRole'\n\n\nrelationships\n-------------\n\nDetermine the relationship between two entities.\n\n========= ===============================================\nSymbol Meaning\n========= ===============================================\n\\| One\n\\|\\| One and only one\n\\|0 / 0\\| Zero or one\n> / < Many\n>0 / 0< Zero or many\n>\\| / \\|< One or many\n========= ===============================================\n\nThe syntax is ``--``.\n\nExample:\n\n::\n\n relationships:\n - User ||--0< UserRole\n - UserRole >0--|| Role\n\n\nUsage\n=====\n\nThis extension add two directives:\n\n**.. database-diagram:: path [another_path]**\n Embed database diagram produced by GraphViz.\n\n**.. data-dictionary:: path [another_path]**\n Embed data dictionary in table format.\n\npath\n Path to yml file.\n\nanother_path\n Optional path to another yml file if split the spec.\n\n If you already have a swagger spec file used to define your REST API,\n you can reuse that file as is without modification by specifying it here.\n\n In the background I simply combine the two files into one.\n\n\nDatabase Diagram\n----------------\n\nThis extension is inspired by\n`sphinx_erdiagram `__.\n\nBut unfortunately,\nthe extension has been heavily design for japanese language document.\nSo it looks rather ugly in english document due to the font it use.\nAnd I also want to reuse the Swagger specification file used to define the REST\nAPI.\n\nExample:\n\n::\n\n .. database-diagram:: example.yml\n\nThe ``example.yml`` file from\n`here `__\nwill result in\n`this `__.\n\n.. image:: https://image.ibb.co/ceDJMF/example.png\n\nThere are several options available to modify the look and feel of the diagram:\n\ngraph-fontname\n Set font family for graph label.\n Default to \"Times-Roman\" inherited from GraphViz.\n\ngraph-fontsize\n Point size or label.\n Default to 14 inherited from GraphViz.\n\ngraph-label\n Label of the graph.\n\ngraph-labeljust\n Alignment of graph label.\n Default to \"centered\" inherited from GraphViz.\n\n \"l\" and \"r\" for left- and right-justi\ufb01ed labels, respectively.\n\n\ngraph-labelloc\n Location of graph label.\n Default to \"top\" inherited from GraphViz.\n\n \"t\" and \"b\" for top- and bottom-justi\ufb01ed labels, respectively.\n\n\ngraph-margin\n Margin included in page, in inches.\n Default to 0.\n\ngraph-nodesep\n Separation between nodes, in inches.\n Default to 0.75 inch.\n\ngraph-ranksep\n Separation between ranks, in inches.\n Default to 0.75 inch.\n\nnode-fontname\n Set font family for graph label.\n Default to \"Times-Roman\" inherited from GraphViz.\n\nnode-fontsize\n Point size or label.\n Default to 14 inherited from GraphViz.\n\nnode-shape\n The shape of the node.\n Default to \"box\".\n\n More `here `__.\n\n\nnode-style\n Style of of the node.\n Default to \"rounded\"\n\n More `here `__.\n\n\nroot-samerank\n This option tells GraphViz that some node should be in the same rank.\n\n This options is in comma separated value format.\n\n Before everything else, please remember that:\n\n - Rank direction is from left to right.\n - The placement of the nodes is heavily influence by how you define the\n relationship.\n - To completely understand this options,\n you must understand how GraphViz's DiGraph works.\n\n Example:\n\n Relationship ``A ||--0< B`` will produce:\n\n ::\n\n +---+ +---+\n | A | ||----0< | B |\n +---+ +---+\n\n If you understand dot syntax,\n the relationship above is translated into ``A -> B``.\n\n While relationship ``B >0--|| A`` will produce:\n\n ::\n\n +---+ +---+\n | B | >0----|| | A |\n +---+ +---+\n\n Remember that rank direction is from left to right.\n\n But for relationship ``A ||--0< B`` with ``root-samerank`` option in the\n directive like this:\n\n ::\n\n .. database-diagram:: external.yml\n :root-samerank: A B\n\n It will forced the nodes to be in the same rank:\n\n ::\n\n +---+\n | A |\n +---+\n =\n |\n |\n 0\n ^\n +---+\n | B |\n +---+\n\n To illustrate how the option works in comma separated value,\n imagine you have relationship in yaml file like this:\n\n ::\n\n relationships:\n - A ||--0< B\n - B >0--|| C\n - C ||--0< D\n\n Without ``root-samerank`` option,\n the nodes will be placed right next to each other resulting in one row.\n But if you set the option like this:\n\n ::\n\n .. database-diagram:: external.yml\n :root-samerank: A B, C D\n\n It will produces diagram like this:\n\n ::\n\n +---+\n | A |\n +---+\n =\n |\n |\n 0\n ^\n +---+ +---+\n | B | >0----|| | C |\n +---+ +---+\n =\n |\n |\n 0\n ^\n +---+\n | D |\n +---+\n\n Let's see how this works.\n\n First remember that this option is in comma separated value format.\n This means that the option will produce to values: ``A B`` and ``C D``.\n\n These two values force A and B to be in the same rank\n and C and D to be in the same rank too.\n But because we didn't specify B and C to be in the same rank,\n C node is placed in the right of the B node.\n\n If you want D node placed at the top of C node,\n you can simply change the relationship into ``D >0--|| C``.\n\nNow, if you understand dot language you may already realized that ``graph-*``\nand ``node-*`` options is just a shameless rip-off from GrahpViz attribute.\nThat's completely correct.\nI'm too lazy to define my own options and conversions.\nBeside I strongly believe that we should not reinvent the wheel,\nunless absolutely necessary.\nI even too lazy to define all the attributes asides from the one I need.\nSo please let me know if you need a currently unavailable attributes.\nOr simply ask a pull request.\nBut please remember that some attributes may unavailable for modification.\n\nComplete options is available `here `__.\nBut you may find the pdf version is easier to read,\nthough the html version is more comprehensive.\n\nIf you prefer the pdf version you can download it\n`here `__.\nThe options for node is available in appendixes A, edge in appendixes B and\ngraph in appendixes C.\n\nThe options can also be set as config specified in ``conf.py`` by prefixing it\nwith ``database_diagram_`` and change the ``-`` into ``_`` character.\nThe value in ``conf.py`` is applied to all directives but will be override by\noptions in the directive.\n\nFor example you want to set ``node-fontname`` to \"Calibri\" for all diagram.\n\nIn ``conf.py``:\n\n::\n\n database_diagram_node_fontname = \"Calibri\"\n\nYou may set all the config value as string even for numeric value.\n\nPlease note that this options is not available as config:\n\n- root-samerank\n\n.. note::\n\n To change the image format you should directly change GraphViz options.\n\n ``graphviz_output_format = 'svg'``\n\n I want to change this to ``database_diagram_output_format`` but for now I\n just didn't know how to do that.\n If you knows how to do that,\n please let me know or add a pull request.\n\n\nData Dictionary\n---------------\n\nGenerate data dictionary:\n\n::\n\n .. data-dictionary:: example.yml\n\n\nAvailable options:\n\nwidths\n Space- or comma-separated list of integer.\n These values calculated into percent totaled to 100%.\n\n The default is ``1 1 1 4`` that will be calculated into 14%, 14%, 14% and\n 57% respectively.\n\n\nheaders\n Space- or comma-separated list of string that will become table header.\n\n The default is ``Name Type Length Description``.\n\n .. note::\n\n If you want a column name that contains space,\n use comma-separated format instead.\n\n\ncolumns\n Space- or comma-separated list attributes of a property.\n\n The default is ``name type maxLength description``.\n ``name`` is a special keyword that points to the property name.\n\n\nThe options can also be set as config specified in ``conf.py`` by prefixing it\nwith ``data_dictionary_``.\nBut set the value as list.\nThe value in ``conf.py`` is applied to all directives but will be override by\noptions in the directive.\n\nIn ``conf.py``:\n\n::\n\n data_dictionary_widths = [1, 1, 1, 4]\n data_dictionary_headers = ['Name', 'Type', 'Length', 'Description']\n data_dictionary_columns = ['name', 'type', 'maxLength', 'description']\n\n\nChanges\n=======\n\n0.1.7\n-----\n\n* Fix allOf bug.\n\n\n0.1.6\n-----\n\n* Change ``sphinx.util.compat.Directive`` to\n ``docutils.parsers.rst.Directive`` because it will be removed in Sphinx 1.7.\n\n\n0.1.5\n-----\n\n* Change table name in data dictionary into section.\n\n\n0.1.4\n-----\n\n* Resolve allOff.\n\n\n0.1.3\n-----\n\n* Change syntax for description from reStructuredText to Markdown because\n Swagger use Markdown.\n\n\n0.1.2\n-----\n\n* Description may contains reStructuredText syntax.\n\n\n0.1.1\n-----\n\n* Strange thing happens.\n After delete and re-upload version 0.1.0, pip is unable to install it.\n\n\n0.1.0\n-----\n\n* First public release.\n\n\nTODO\n====\n\n#. Change output format from ``graphviz_output_format = 'svg'`` to\n ``database_diagram_output_format = 'svg'`` so it's only affect\n database-diagram directive.", "description_content_type": null, "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/julot/sphinxcontrib-dd", "keywords": "sphinx sphinxcontrib data dictionary database diagram", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "sphinxcontrib-dd", "package_url": "https://pypi.org/project/sphinxcontrib-dd/", "platform": "any", "project_url": "https://pypi.org/project/sphinxcontrib-dd/", "project_urls": { "Homepage": "https://github.com/julot/sphinxcontrib-dd" }, "release_url": "https://pypi.org/project/sphinxcontrib-dd/0.1.7/", "requires_dist": [ "PyYAML (>=3.12)", "Sphinx (>=0.6)", "jsonschema (>=2.5.1)", "recommonmark (>=0.4.0)" ], "requires_python": "", "summary": "Sphinx extension for Data Dictionary and Database Diagram", "version": "0.1.7" }, "last_serial": 2953780, "releases": { "0.1.0": [], "0.1.1": [ { "comment_text": "", "digests": { "md5": "a0005210256062a474f3f688f7151e72", "sha256": "08a16652c06b5faabae5563e576bf1381ccba800651427ebc78e65b93e14f00d" }, "downloads": -1, "filename": "sphinxcontrib_dd-0.1.1-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "a0005210256062a474f3f688f7151e72", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 15811, "upload_time": "2017-03-16T04:41:30", "url": "https://files.pythonhosted.org/packages/6e/28/7ccec9072b528f19e25ce04c2ebbad4446aa1e7315c48aaf27b219648397/sphinxcontrib_dd-0.1.1-py2.py3-none-any.whl" } ], "0.1.3": [ { "comment_text": "", "digests": { "md5": "926221fdfc5085d2b04003aea4157eb1", "sha256": "ff8073d8021f2ee1322a93362321bfc667a2261e1d3a174dbd708f91136aed78" }, "downloads": -1, "filename": "sphinxcontrib_dd-0.1.3-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "926221fdfc5085d2b04003aea4157eb1", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 16383, "upload_time": "2017-03-17T06:40:32", "url": "https://files.pythonhosted.org/packages/fd/c4/0ca6039feac3c77040d7f6fdaaed9fa23a1369f3c1d8450ac0703cc3ec8f/sphinxcontrib_dd-0.1.3-py2.py3-none-any.whl" } ], "0.1.4": [ { "comment_text": "", "digests": { "md5": "9e61d0176f61a193ffd1fbcf877869c8", "sha256": "aa543d205f0b7733a4b8d9a952bd5b91d5a24ba2061cbd5004869dcac3d16a99" }, "downloads": -1, "filename": "sphinxcontrib_dd-0.1.4-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "9e61d0176f61a193ffd1fbcf877869c8", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 16726, "upload_time": "2017-03-17T09:52:55", "url": "https://files.pythonhosted.org/packages/20/65/84ecba819aac16fa479fd71126932f57185a52326b33d6c1a4f160e9b046/sphinxcontrib_dd-0.1.4-py2.py3-none-any.whl" } ], "0.1.5": [ { "comment_text": "", "digests": { "md5": "d2965f8768c799cb45939ced346a5018", "sha256": "cc1f6f78fe93540da1b1dcf49cf248dbc91efe574842baf0f066d115169a2216" }, "downloads": -1, "filename": "sphinxcontrib_dd-0.1.5-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "d2965f8768c799cb45939ced346a5018", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 16711, "upload_time": "2017-03-29T04:14:31", "url": "https://files.pythonhosted.org/packages/85/7f/49ed7f75492df80c9451a47c373020440564e1da6290c88558d09a291cab/sphinxcontrib_dd-0.1.5-py2.py3-none-any.whl" } ], "0.1.6": [ { "comment_text": "", "digests": { "md5": "060468ccf6bbe5071f3edc3c6a504ebf", "sha256": "316e006ab0a7660f1be5866e2f9134dc59f019b4d0ce149779632e972e44597c" }, "downloads": -1, "filename": "sphinxcontrib_dd-0.1.6-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "060468ccf6bbe5071f3edc3c6a504ebf", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 16810, "upload_time": "2017-06-10T04:50:21", "url": "https://files.pythonhosted.org/packages/83/70/98760de66eb3e61e6771f35ecbbb2892db06870371f63cbcff191992d8f4/sphinxcontrib_dd-0.1.6-py2.py3-none-any.whl" } ], "0.1.7": [ { "comment_text": "", "digests": { "md5": "8b3ee61d3356531fca1ed5fec8399bb7", "sha256": "930ce8a782d8e35d37093ffb51f842c5511998c45908449de56667b559e5d3c0" }, "downloads": -1, "filename": "sphinxcontrib_dd-0.1.7-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "8b3ee61d3356531fca1ed5fec8399bb7", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 16970, "upload_time": "2017-06-16T06:08:58", "url": "https://files.pythonhosted.org/packages/47/fe/2bc03f559a2866effe0a4c6bdc7dd687f765b6f8bfa39f4c5dd29e1b4d22/sphinxcontrib_dd-0.1.7-py2.py3-none-any.whl" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "8b3ee61d3356531fca1ed5fec8399bb7", "sha256": "930ce8a782d8e35d37093ffb51f842c5511998c45908449de56667b559e5d3c0" }, "downloads": -1, "filename": "sphinxcontrib_dd-0.1.7-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "8b3ee61d3356531fca1ed5fec8399bb7", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 16970, "upload_time": "2017-06-16T06:08:58", "url": "https://files.pythonhosted.org/packages/47/fe/2bc03f559a2866effe0a4c6bdc7dd687f765b6f8bfa39f4c5dd29e1b4d22/sphinxcontrib_dd-0.1.7-py2.py3-none-any.whl" } ] }