svgen (0.9.5) — docs

Skip to main content
`Ctrl`+`K`

# svgen (0.9.5)

A tool for working with scalable vector graphics.

Consider sponsoring development.

(interface documentation)

## Python Version Support

This package is tested with the following Python minor versions:

- `python3.13`

- `python3.14`

## Platform Support

This package is tested on the following platforms:

- `ubuntu-latest`

- `macos-latest`

- `windows-latest`

# Introduction

This utility provides a means to work on graphics with a programmatic workflow.

# Command-line Options

    $ ./venv3.14/bin/svgen -h

    usage: svgen [-h] [--version] [-v] [-q] [--curses] [--no-uvloop] [-C DIR]
                 [-c CONFIG] [--height HEIGHT] [--width WIDTH] [--images]
                 [-o OUTPUT]
                 [scripts ...]

    A tool for working with scalable vector graphics.

    positional arguments:
      scripts              scripts to run for composing the SVG document (in
                           order)

    options:
      -h, --help           show this help message and exit
      --version            show program's version number and exit
      -v, --verbose        set to increase logging verbosity
      -q, --quiet          set to reduce output
      --curses             whether or not to use curses.wrapper when starting
      --no-uvloop          whether or not to disable uvloop as event loop driver
      -C, --dir DIR        execute from a specific directory
      -c, --config CONFIG  top-level configuration to load (default: 'svgen.json')
      --height HEIGHT      height of the document, if not specified by
                           configuration (default: 100)
      --width WIDTH        width of the document, if not specified by
                           configuration (default: 100)
      --images             generate output images
      -o, --output OUTPUT  file to write SVG output (default: 'svgen.svg')

# Internal Dependency Graph

A coarse view of the internal structure and scale of `svgen`’s source. Generated using pydeps (via `mk python-deps`).

Interface Documentation

- svgen package
  - Subpackages
    - svgen.attribute package
      - Submodules
      - svgen.attribute.style module
      - svgen.attribute.viewbox module
      - Module contents
    - svgen.cartesian package
      - Subpackages
      - Submodules
      - svgen.cartesian.angle module
      - svgen.cartesian.circle module
      - svgen.cartesian.mutate module
      - svgen.cartesian.plane module
      - svgen.cartesian.point module
      - Module contents
    - svgen.color package
      - Subpackages
      - Submodules
      - svgen.color.alpha module
      - svgen.color.conversion module
      - svgen.color.hsl module
      - svgen.color.numbers module
      - svgen.color.resolve module
      - svgen.color.rgb module
      - Module contents
    - svgen.element package
      - Subpackages
      - Submodules
      - svgen.element.circle module
      - svgen.element.line module
      - svgen.element.path module
      - svgen.element.rect module
      - svgen.element.svg module
      - svgen.element.text module
      - Module contents
    - svgen.generation package
      - Submodules
      - svgen.generation.images module
      - Module contents
    - svgen.shapes package
      - Submodules
      - svgen.shapes.chip module
      - svgen.shapes.pins module
      - Module contents
  - Submodules
  - svgen.app module
    - `add_app_args()`
    - `entry()`
    - `generate()`
  - svgen.config module
    - `add_dimension_args()`
    - `initialize_config()`
  - svgen.display module
    - `AspectRatio`
      - `AspectRatio.args`
      - `AspectRatio.as_str()`
      - `AspectRatio.create()`
      - `AspectRatio.final`
      - `AspectRatio.height`
      - `AspectRatio.landscape`
      - `AspectRatio.over_height`
      - `AspectRatio.portrait`
      - `AspectRatio.rotate()`
      - `AspectRatio.square`
      - `AspectRatio.width`
    - `common_sizes()`
  - svgen.entry module
    - `main()`
  - svgen.inkscape module
    - `InkscapeTask`
      - `InkscapeTask.invoke()`
    - `invoke()`
    - `invoke_multiple()`
  - svgen.script module
    - `invoke_script()`
  - Module contents