            <div class="code-wrap">
                <div class="code-label">
                    <div class="code-lang-row"><div class="code-dots"><span></span><span></span><span></span></div><span class="code-lang">python</span></div>
                    <button class="copy-btn" onclick="copyCode(this)"><i class="fa-regular fa-copy"></i> copy</button>
                </div>
                <pre><code class="language-python">import novasvg

# One-liner: SVG file -> PNG file
novasvg.svg2png("input.svg", "output.png", width=800)

# Or work with the document model
doc = novasvg.Document.load_from_file("artwork.svg")
print(doc.width, doc.height)

# Query elements with CSS selectors and restyle the document
rects = doc.query_selector_all("rect")
doc.apply_stylesheet("rect { fill: red; }")

# Render to a bitmap, save it, or get the pixels as a NumPy array
bitmap = doc.render_to_bitmap(400, 300)
bitmap.write_to_png("artwork.png")
pixels = bitmap.numpy()   # shape (300, 400, 4)</code></pre>
            </div>
