{"id":13648266,"url":"https://github.com/wallento/wavedrompy","last_synced_at":"2025-04-05T16:04:47.625Z","repository":{"id":39953766,"uuid":"157742711","full_name":"wallento/wavedrompy","owner":"wallento","description":"WaveDrom compatible python command line","archived":false,"fork":false,"pushed_at":"2023-06-02T13:50:35.000Z","size":453,"stargazers_count":102,"open_issues_count":17,"forks_count":26,"subscribers_count":7,"default_branch":"master","last_synced_at":"2025-03-29T15:03:56.599Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/wallento.png","metadata":{"files":{"readme":"README.md","changelog":null,"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}},"created_at":"2018-11-15T16:44:22.000Z","updated_at":"2025-02-21T08:52:36.000Z","dependencies_parsed_at":"2024-01-07T01:08:26.302Z","dependency_job_id":"da83e905-7610-4c17-823a-fa08d23e67a1","html_url":"https://github.com/wallento/wavedrompy","commit_stats":{"total_commits":207,"total_committers":12,"mean_commits":17.25,"dds":0.5217391304347826,"last_synced_commit":"82a0e75cf201ed4e9f9c2ec3e56e54b6ec93c11a"},"previous_names":[],"tags_count":15,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wallento%2Fwavedrompy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wallento%2Fwavedrompy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wallento%2Fwavedrompy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wallento%2Fwavedrompy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/wallento","download_url":"https://codeload.github.com/wallento/wavedrompy/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247361615,"owners_count":20926642,"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":"2024-08-02T01:04:05.793Z","updated_at":"2025-04-05T16:04:47.587Z","avatar_url":"https://github.com/wallento.png","language":"Python","funding_links":[],"categories":["Python","Documentation"],"sub_categories":[],"readme":"# WaveDromPy\n\nThis is a python module and command line fully compatible with [WaveDrom](https://wavedrom.com/), which is originally implemented in JavaScript. It is useful if you want to generate wavedrom diagrams from a python environment or simply don't want to install the _Node.js_ environment just to use WaveDrom as simple command line.\n\nWaveDromPy is for example used in [sphinxcontrib-wavedrom](https://pypi.org/project/sphinxcontrib-wavedrom/) to render wavedrom for Sphinx documentation. While the original project renders the diagrams in JavaScript in the browser, WaveDromPy renders them to SVG files.\n\nThis tool is a direct translation of original Javascript file _WaveDrom.js_ to Python. No extra feature added. We seek to have it fully compatible.\n\nThe tool _WaveDromPy_ directly converts _WaveDrom_ compatible JSON files into SVG format.\n\n[![Build Status](https://travis-ci.org/wallento/wavedrompy.svg?branch=master)](https://travis-ci.org/wallento/wavedrompy)\n[![PyPI version](https://badge.fury.io/py/wavedrom.svg)](https://badge.fury.io/py/wavedrom)\n\n## Installation\n\nIt is most easy to just install wavedrom via pip/pypi:\n\n    pip install wavedrom\n    \nAlternatively you can install the latest version from this repository:\n\n    pip install git+https://github.com/wallento/wavedrompy\n    \nor from your local copy:\n\n    pip install .\n\n## Usage\n\nYou can either use the tool from Python:\n\n    import wavedrom\n    svg = wavedrom.render(\"\"\"\n    { \"signal\": [\n     { \"name\": \"CK\",   \"wave\": \"P.......\",                                              \"period\": 2  },\n     { \"name\": \"CMD\",  \"wave\": \"x.3x=x4x=x=x=x=x\", \"data\": \"RAS NOP CAS NOP NOP NOP NOP\", \"phase\": 0.5 },\n     { \"name\": \"ADDR\", \"wave\": \"x.=x..=x........\", \"data\": \"ROW COL\",                     \"phase\": 0.5 },\n     { \"name\": \"DQS\",  \"wave\": \"z.......0.1010z.\" },\n     { \"name\": \"DQ\",   \"wave\": \"z.........5555z.\", \"data\": \"D0 D1 D2 D3\" }\n    ]}\"\"\")\n    svg.saveas(\"demo1.svg\")\n    \nThis will render a waveform as:\n\n![Example 1](https://raw.githubusercontent.com/wallento/wavedrompy/2e8568d50561f534133d036fee3bd35756f416d9/doc/demo1.svg?sanitize=true \"Example 1\")\n\nYou can find more examples [in the WaveDrom tutorial](https://wavedrom.com/tutorial.html).\n\nA second feature is that WaveDrom can render logic circuit diagrams:\n\n    import wavedrom\n    svg = wavedrom.render(\"\"\"\n    { \"assign\":[\n      [\"out\",\n        [\"|\",\n          [\"\u0026\", [\"~\", \"a\"], \"b\"],\n          [\"\u0026\", [\"~\", \"b\"], \"a\"]\n        ]\n      ]\n    ]}\"\"\")\n    svg.saveas(\"demo2.svg\")\n \nThis will render a as:\n\n![Example 2](https://raw.githubusercontent.com/wallento/wavedrompy/2e8568d50561f534133d036fee3bd35756f416d9/doc/demo2.svg?sanitize=true \"Example 2\")\n\nYou can find more examples [in the WaveDrom tutorial2](https://wavedrom.com/tutorial2.html).\n\nFinally, wavedrom can draw registers as bitfields:\n\n    import wavedrom\n    svg = wavedrom.render(\"\"\"\n    {\"reg\": [\n      { \"name\": \"IPO\",   \"bits\": 8, \"attr\": \"RO\" },\n      {                  \"bits\": 7 },\n      { \"name\": \"\u003co\u003eB\u003c/o\u003e\u003cb\u003eR\u003ci\u003eK\u003c/i\u003e\u003c/b\u003e\",   \"bits\": 5, \"attr\": \"RW\", \"type\": 4 },\n      { \"name\": \"CPK\",   \"bits\": 1 },\n      { \"name\": \"Clear\", \"bits\": 3 },\n      { \"bits\": 8 }\n      ]\n    ]}\"\"\")\n    svg.saveas(\"demo3.svg\")\n\n    \nThis will render as:\n\n![Example 3](https://raw.githubusercontent.com/wallento/wavedrompy/2e8568d50561f534133d036fee3bd35756f416d9/doc/demo3.svg?sanitize=true \"Example 3\")\n\nThis mode is documented as part of the [bit-field](https://www.npmjs.com/package/bit-field) JavaScript package.\n\nAlternatively, WaveDromPy can be called from the command line:\n\n    wavedrompy --input input.json --svg output.svg\n\n## Important notice\n\nThe command line uses Python's JSON interpreter that is more restrictive (coherent with the JSOC spec), while the JavaScript json is more relaxed:\n\n * All strings have to be written between quotes (\"\"),\n * Extra comma (,) not supported at end of lists or dictionaries\n \n## AsciiDoctor example\n\nAn _AsciiDoctor_ example is provided to directly generate timing diagrams from _AsciiDoctor_ formatted documents.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwallento%2Fwavedrompy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwallento%2Fwavedrompy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwallento%2Fwavedrompy/lists"}