Skip to main content

Welcome to svgblock

Python 3.10+ No dependencies 50 themes 6 entry animations SVG output

What svgblock does

Table of Contents

How a block is built

⬆ back to top

How to use

Step 1: install svgblock

python --version
pip install git+https://github.com/JonatasCortes/svgblock.git

# or clone the repository and install it from the folder
git clone https://github.com/JonatasCortes/svgblock.git
cd svgblock
pip install .

Step 2: write your first block

from svgblock import Block

(
    Block(theme="neon", width=900, animation="slide-up")
    .title("Hello, I'm Bob")
    .text("I build **small tools** in **pure Python** and I love open source.")
    .subsection("What I am learning")
    .text("Right now I am studying **graph algorithms** and **computer vision**.")
    .save("assets/block.svg")
)

Step 3: run the script

python generate_blocks.py

Step 4: show the block in your profile

<p align="center">
  <img src="assets/block.svg" alt="About me" width="900">
</p>

Optional: add more blocks

from svgblock import Block

Block(theme="dracula", animation="fade").title("About me").text("...").save("assets/about.svg")
Block(theme="nord", animation="pop").title("Projects").text("...").save("assets/projects.svg")

⬆ back to top

Creating a block

Block(theme="red", width=900, animation="fade")

Adding content

(
    Block(theme="coffee")
    .title("Projects")
    .text("A few things I built.", font_size=18)
    .subsection("HNSW Character Recognition")
    .text("Train and test your own model.")
    .divider()
    .table(["Project", "Stars"], [["HNSW", 120], ["Voronoi Stats", 85]])
    .image("assets/preview.png", width=300)
    .divider(0.5)
    .title("Contact")
    .text("Find me on GitHub.")
)

Text markers

.text("**ola __mundo__** ola, --errado-- e ##inclinado##")
.text(r"A literal \*\* needs a backslash before each asterisk.")

Columns

from svgblock import Block, Column

(
    Block(theme="nord")
    .columns(
        Column(1).subsection("Weight 1").text("A narrow column, good for short notes."),
        Column(2).subsection("Weight 2").text("A column twice as wide, ideal for the main text."),
    )
)

Tables

.table(
    ["Language", "Level", "Typed"],
    [
        ["Python", "**Advanced**", True],
        ["Rust", "##Learning##", True],
        ["COBOL", "--Retired--", None],
    ],
    align=("left", "center", "center"),
    weights=(2, 2, 1),
    striped=True,
    row_dividers=True,
    column_dividers=False,
)

Images

(
    Block(theme="mocha")
    .columns(
        Column(1).image("assets/logo.png", width=110),
        Column(4).subsection("A logo beside the text").text("The text takes the rest of the width."),
    )
)

Saving the result

Animations

fade animation pop animation slide-up animation slide-down animation slide-left animation slide-right animation

from svgblock import Animation, Block

# No animation (the default)
Block()

# Plays once
Block(animation="pop")
Block(animation=Animation.SLIDE_UP)

# Replays every 5 seconds
Block(animation="slide-up", animation_loop=5)

⬆ back to top

Customization

Creating your own theme

"mytheme": {
    "background_center": "#1B2B34", "background_edge": "#0B1014",
    "border_start": "#6699CC", "border_end": "#223344",
    "title_text": "#99C794", "title_bar": "#99C794",
    "subsection_text": "#FAC863", "subsection_marker": "#FAC863",
    "text": "#D8DEE9", "highlight": "#FFFFFF",
    "underline": "#6699CC", "strikethrough": "#65737E", "italic": "#C0C5CE",
    "table_background": "#10181D", "table_header_background": "#223540",
    "table_header_text": "#99C794", "table_text": "#D8DEE9",
    "table_divider": "#33505F", "table_stripe_background": "#15222A",
    "table_border": "#33505F", "divider": "#6699CC",
},

Constants reference

git clone https://github.com/JonatasCortes/svgblock.git
cd svgblock
pip install -e .

⬆ back to top

Themes

Dark colors

red theme orange theme yellow theme green theme blue theme purple theme pink theme obsidian theme

Light colors

mint theme chocomint theme lavender theme peach theme sky theme

Seasons

spring theme summer theme autumn theme winter theme

Drinks

wine theme beer theme coffee theme matcha theme berrymatcha theme latte theme

Countries and geography

brazil theme usa theme miami theme france theme japandark theme japanlight theme sakura theme india theme china theme mexico theme fiesta theme greece theme egypt theme

Aesthetics and culture

neon theme cyberpunk theme steampunk theme synthwave theme lofi theme

Classical UI dev themes

dracula theme mocha theme nord theme solarizeddark theme solarizedlight theme atlas theme

Mythology and concepts

heaven theme hell theme abyss theme

⬆ back to top

Troubleshooting

⬆ back to top

Made with love for GitHub profiles

Metadata

Release files for svgblock 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for svgblock 0.1.0
File Size Uploaded Provenance Actions
svgblock-0.1.0.tar.gz 26.3 kB Without provenance Details for svgblock-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for svgblock 0.1.0
File Interpreter ABI Platform Actions
svgblock-0.1.0-py3-none-any.whl Python 3 none any Details for svgblock-0.1.0-py3-none-any.whl

Total release size: 51.5 kB

Release files / svgblock-0.1.0.tar.gz

Download URL svgblock-0.1.0.tar.gz
Size 26.3 kB
Tags Source
SHA-256 checksum
How to use checksums
897ca400d7278543910e9a42f4bf9a21aabd9f56b185a47eddf007c5c267f431
BLAKE2b-256 checksum
How to use checksums
82fba684663c37f352bc6a4256aab2e399667bdf332229a69d9ef82dd2c59b75
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.2

Release files / svgblock-0.1.0-py3-none-any.whl

Download URL svgblock-0.1.0-py3-none-any.whl
Size 25.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b31329023fbab7f208e19c46b30d6d6345964a18a7b3b985d8e51488de8f33d2
BLAKE2b-256 checksum
How to use checksums
1745f3779545604d3c821c72c59ef4e2871ba823d5da9738b6bf1913b0414f13
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.2

Security for svgblock 0.1.0

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.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page