YoWASP WaveDrom package
This package provides a self-contained WaveDrom renderer for JavaScript and Python applications. See the overview of the YoWASP project for details.
Command-line tool
This package installs a command-line tool yowasp-wavedrom.
Usage: yowasp-wavedrom [<input.json>] [<output.svg>]
API reference (JavaScript)
The @yowasp/wavedrom package has one entry point, render(source): string. It accepts a JavaScript object in the WaveJSON format and returns an SVG image serialized as a string:
import { render } from '@yowasp/wavedrom';
console.log(render({signal: [{ name: "clk", wave: "p..." }, { name: "data", wave: "01.0" }]}));
// => <svg.../svg>
API reference (Python)
The yowasp-wavedrom package has one entry point, render(source) -> str. It accepts a Python dictionary in the WaveJSON format and returns an SVG image serialized as a string:
from yowasp_wavedrom import render
print(render({"signal": [{ "name": "clk", "wave": "p..." }, { "name": "data", "wave": "01.0" }]}))
# => <svg.../svg>
Implementation notes
This package embeds the upstream WaveDrom library bundled with the minimal amount of dependencies necessary to produce a serialized SVG, and, for the Python package, with a JavaScript runtime. In addition, the output is post-processed compared to the upstream library as follows:
- The
idattribute of the root<svg>element is removed. - The stylesheets are altered to take into account dark color scheme preference via media queries. If the user agent reports dark color scheme preference, the colors in the diagram are inverted.
- In case of the
darkwaveform diagram skin, this will cause it to use light colors. - When the SVG image is embedded in an HTML document using the
<img>tag, the color scheme preference can be set per-image using a CSS rule such asimg { color-scheme: light; }. This can be used to make the images responsive to dynamic theming, or simply to override the default behavior.
- In case of the
- Several otherwise blocking bugs are worked around.
Updates
Unlike most YoWASP packages, this package does not automatically track upstream releases. Please open a pull request bumping the version of wavedrom in package-in.json if you need a feature from a newer version of WaveDrom.
License
This package is covered by the MIT license.
Metadata
Release files for yowasp-wavedrom 3.5.0.9
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| yowasp_wavedrom-3.5.0.9-py3-none-any.whl | Python 3 | none | any | Details for yowasp_wavedrom-3.5.0.9-py3-none-any.whl |
Release files / yowasp_wavedrom-3.5.0.9-py3-none-any.whl
| Download URL | yowasp_wavedrom-3.5.0.9-py3-none-any.whl |
|---|---|
| Size | 40.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
2ecd53fd48dfc5fc5c49c47dcbcf43258864084177a1fb870a5ced1f8fedbab5
|
|
BLAKE2b-256 checksum How to use checksums |
9d4138990239e079c0fd84a9757353737188c3be9fb539be3ce5eef2efab3e5e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Security for yowasp-wavedrom 3.5.0.9
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.