# GenPinoutSVG **Repository Path**: bjr2016/GenPinoutSVG ## Basic Information - **Project Name**: GenPinoutSVG - **Description**: fork from https://github.com/stevenj/GenPinoutSVG.git - **Primary Language**: Unknown - **License**: GPL-3.0 - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2022-07-30 - **Last Updated**: 2022-08-02 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # GenPinoutSVG This repository contains a program to produce pinout SVG files from a CSV file source file of pin definitions and other graphical/format commands. This program was inspired by [Graphical Datasheets](https://github.com/sparkfun/Graphical_Datasheets) ## How To Use This is a Python 3 program and has only been tested on V3.6. It should be considered the minimum version for bug reports. 1. Create a Python Virtual Environment 2. Install Dependencies with pip * docopt * svgwrite * wand 3. Clone this repository 4. Execute ./GenPinoutSVG.py \ ## CSV Input data format The CSV format is a simple list of drawing commands, at a higher level than raw SVG and targeted to the needs of a graphical pinout datasheet. The basic format of the CSV file is: * \n (Carriage Return 0x13) is the Line Ender character * Fields are separated with , (Comma) * If you put a comma inside a string, quote it with " (double quote) Each line of the CSV is a command, with the following general format: * First Field = Command Name * Second to Nth Field = Options to the command There are **TWO** Phases in the drawing process and the commands are divided by phase. The first phase is the SETUP phase, which defines all the attributes of the page and drawing options, themes. The Second phase is the DRAW phase and it is triggered by the DRAW command. DRAW Operations must occur in Draw Phase and Setup operations must occur in Setup phase. ### **SETUP** Phase Commands (Called before the **DRAW** Command) * **LABEL**, DEFAULT, TYPE, GROUP, \ * Defines PIN labels, best as the first command in the file. Aligns with pin data draw commands in draw phase. Helps create named columns which ease editing in a spreadsheet. * DEFAULT - Defines the Default theme * TYPE - Pin Type Theme Settings * GROUP - Pin Group Theme Settings * \ - The List of PIN Functions * **BORDER COLOR**, default, \, \, \ * Defines Theme border color of Pin Type * DEFAULT - Default border color, must be specified * \ - Optional border color for Types * \ - Optional border color for Pin Groups * \ - Optional border color for each Pin Label * **FILL COLOR**, default, \, \, \ * Defines Theme fill color of Pin Type * DEFAULT - Default fill color, must be specified * \ - Optional fill color for Types * \ - Optional fill color for Pin Groups * \ - Optional fill color for each Pin Label * **OPACITY**, default, \, \, \ * Theme Opacity Value of Pin Type * DEFAULT - Default fill color opacity, must be specified * \ - Optional fill color opacity for Types * \ - Optional fill color opacity for Pin Groups * \ - Optional fill color opacity for each Pin Label * **FONT** default, \, \, \ * Theme Font of Pin Type * DEFAULT - Default Font, must be specified * \ - Optional Font for Types * \ - Optional Font for Pin Groups * \ - Optional Font for each Pin Label * **FONT SIZE**, default, \, \, \ * Theme Font Size of Pin Type * DEFAULT - Default Font Size, must be specified * \ - Optional Font Size for Types * \ - Optional Font Size for Pin Groups * \ - Optional Font Size for each Pin Label * **FONT COLOR**, default, \, \, \ * Theme Font Color of Pin Type * DEFAULT - Default Font Color, must be specified * \ - Optional Font Color for Types * \ - Optional Font Color for Pin Groups * \ - Optional Font Size for each Pin Label * **FONT SLANT**, default, \, \, \ * Theme Font Slant of Pin Type, possible slants are: "normal","italic", "oblique" * DEFAULT - Default Font Slant, must be specified * \ - Optional Font Slant for Types * \ - Optional Font Slant for Pin Groups * \ - Optional Font Slant for each Pin Label * **FONT BOLD**, default, \, \, \ * Theme Font Boldness of Pin Type, possible boldness are: "normal", "bold", "bolder", "lighter", "100", "200", "300", "400", "500", "600", "700", "800", "900" * DEFAULT - Default Font Boldness, must be specified * \ - Optional Font Boldness for Types * \ - Optional Font Boldness for Pin Groups * \ - Optional Font Boldness for each Pin Label * **FONT STRETCH**, default, \, \, \ * Theme Font Stretch of Pin Type, possible stretch are: "normal", "wider", "narrower", "ultra-condensed", "extra-condensed", "condensed", "semi-condensed", "semi-expanded", "expanded", "extra-expanded", "ultra-expanded" * DEFAULT - Default Font Stretch, must be specified * \ - Optional Font Stretch for Types * \ - Optional Font Stretch for Pin Groups * \ - Optional Font Stretch for each Pin Label * **TYPE**, **IO**, Color, Opacity * Sets the Color and Opacity IO pin Indicator * Color - The Color of the IO Pin Type indicator * Opacity - The Opacity of the IO Pin Type indicator * **TYPE**, **INPUT**, Color, Opacity * Sets the Color and Opacity INPUT pin Indicator * Color - The Color of the INPUT Pin Type indicator * Opacity - The Opacity of the INPUT Pin Type indicator * **TYPE**, **OUTPUT**, Color, Opacity * Sets the Color and Opacity OUTPUT pin Indicator * Color - The Color of the OUTPUT Pin Type indicator * Opacity - The Opacity of the OUTPUT Pin Type indicator * **WIRE**, **DIGITAL**, Color, Opacity, Thickness * Sets the Color, Opacity and Thickness of Digital Wires * Color - The Color of the Digital Wire * Opacity - The Opacity of Digital Wire * Thickness - The Thickness of a Digital Wire * **WIRE**, **PWM**, Color, Opacity, Thickness * Sets the Color, Opacity and Thickness of PWM Wires * Color - The Color of the PWM Wire * Opacity - The Opacity of PWM Wire * Thickness - The Thickness of a PWM Wire * **WIRE**, **ANALOG**, Color, Opacity, Thickness * Sets the Color, Opacity and Thickness of ANALOG Wires * Color - The Color of the ANALOG Wire * Opacity - The Opacity of ANALOG Wire * Thickness - The Thickness of a ANALOG Wire * **WIRE**, **HS-ANALOG**, Color, Opacity, Thickness * Sets the Color, Opacity and Thickness of High Speed ANALOG Wires * Color - The Color of the ANALOG Wire * Opacity - The Opacity of ANALOG Wire * Thickness - The Thickness of a ANALOG Wire * **WIRE**, **POWER**, Color, Opacity, Thickness * Sets the Color, Opacity and Thickness of POWER Wires * Color - The Color of the POWER Wire * Opacity - The Opacity of POWER Wire * Thickness - The Thickness of a POWER Wire * **GROUP**, name, Color, Opacity * Sets the Name of a Pin group, and the Color and Opacity of the Pin Group Circle. * name - The name of the pin group * color - The color of the pin group * opacity - The opacity of the pin group * **BOX**, \, \, \, \, \, \, \, \, \, \, \, \ * Define a box theme * Name - The name of the box theme * Border Color - The color of the Border line around the box * Border Opacity - Number 0.00-1.00 defines opacity of the border line * Fill Color - Fill color of the box * Fill Opacity - Opacity of the Fill (0.00-1.00), set to 0 for no fill * Line Width - Width of the border line * Box Width - Default width of the box * Box Height - Default height of the box * Box Cr X - Box Corner Radius (X Direction) * Box Cr Y - Box Corner Radius (Y Direction) * Box Skew - Amount of slant to pu on the box * **TEXT FONT**, \, \, \, \, \, \, \, \ * Defines a Font for use by text entries. Text entries can also use a font theme for a labeled pin column * **PAGE**, "page name" * Sets the page size Defaults to A4-L) * page name - Name of page, ("A4-P", "A4-L", "A3-P" or "A3-L") * **DPI**, dpi * Sets the dots per inch. * dpi - dots per inch on the page (Defaults to 300) * **DRAW** * Starts the Page Draw, Setup commands after this are ignored. Draw commands before this are ignored. ### **DRAW** Phase Commands (Called before the **DRAW** Command) * **GOOGLEFONT**, \ * Embed a link to google web fonts (doesn't work for Inkscape) * **IMAGE**, name, X, Y, W, H, \, \, \, \, \ * Puts a PNG on the page at the requested location and for the requested size, with an optional crop and rotate. * **ICON**, name.svg, X,Y,W,H,\ * Embeds another SVG inside this one, at the required location and size/rotation. (Used for informational icons) * name.svg = svg file name to use * X,Y = Top left Origin * W/H = Width and Height to display at. * rot = Optional angle of rotation to apply * **ANCHOR**, X, Y * Sets Starting point for Pin Attribute display. * X - X Coordinate of top left corner of first pin to show * Y - Y Coordinate of top left corner of first pin to show * **PINSET**, Side, Packed, JustifyX, JustifyY, LineStep, PinWidth, GroupWidth, LeaderOffset, Column Gap, LeaderHStep * Define a pin list. * Side - The side the pins are on. * Packed - Pins are listed Packed, or Columnar * JustifyX - How text aligns in the X Direction * JustifyY - How text aligns vertically * LineStep - Step between consecutive lines * PinWidth - Width of the pin Indicator * GroupWidth - Width of the pin Group Indicator * LeaderOffset - Width of Leader Wire * Column Gap - Distance between adjacent boxes * LeaderHStep - allows the leader to be offset each line for vertical pins. * **PIN**, \, \, \, \ * Pin Attributes to print at next pin line. * Wire = The Wire Type (POWER/PWM/ANALOG/DIGITAL) Defaults to DIGITAL if not set. * TYPE = Pin Type (IO/INPUT/OUTPUT) Defaults to IO if not set. * GROUP = Pin Group name. Defaults to un-grouped if not set. * List = List of pin functions, in order of defined Labels. * **PINTEXT**, \, \, \, \, \