Skip to main content

A Python library for SVG network switch configuration rendering.

Project description

# switch-config-render

switch-config-render is a python module that can be used to create an SVG depiction of the internal configuration of an FPGA-based network switch product.

The module renders: * Front panel interfaces in use, together with their optional alias and description * FPGA application interfaces with their optional alias and description * Applications configured on the FPGA devices and the ports that they are connected to * Cross-connect connections between the front panel and application interfaces which can be colour-coded depending on the connection type(s) as defined in the interface definitions

Example output:

![](example_output.png)

Install by running pip install switch-config-render. directory.

## Generating an SVG

The SVG can be generated by calling the generate_system_svg function:

`python generate_system_svg('svg_file.svg', interfaces, connections, fpga_apps, app_shapes, onchip_connections) `

Where: * svg_file.svg is the name of the destination .svg file * interfaces is a dict specifying all the front panel and FPGA application interfaces * connections is a dict of key: value pairs, where the key defines the destination and the value the source of a connection * fpga_apps is a dict that specifies the applications that are configured on the given FPGA * app_shapes defines the vertices of the shapes to be used for the applications defined in fpga_apps * onchip_connections specifies internal connectivity within the FPGA and between FPGAs, between ap interfaces and FPGA applications

Refer to the example code in switch_config_render.__main__.py for more information.

## Example Application

An example application is provided and can be run by calling:

`bash python -m switch_config_render `

from the project root. The example runs switch_config_render.__main__.py which runs two examples: one that calls the high-level generate_system_svg function and one low-level example that manually creates objects for fine-grained placement control. These examples produce the high_level_example.svg and low_level_example.svg files respectively.

## License

switch-config-render is:

Copyright [2021] [Optiver]

Licensed under the Apache License, Version 2.0 (the “License”); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an “AS IS” BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

switch-config-render-0.2.1.tar.gz (12.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

switch_config_render-0.2.1-py2-none-any.whl (15.9 kB view details)

Uploaded Python 2

File details

Details for the file switch-config-render-0.2.1.tar.gz.

File metadata

  • Download URL: switch-config-render-0.2.1.tar.gz
  • Upload date:
  • Size: 12.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.15.0 pkginfo/1.7.0 requests/2.25.1 setuptools/39.1.0 requests-toolbelt/0.9.1 tqdm/4.58.0 CPython/2.7.12

File hashes

Hashes for switch-config-render-0.2.1.tar.gz
Algorithm Hash digest
SHA256 a97fa4a85999ea78f67000a3c67a0c1a03730bc4d6f01f30b7edef2225abbac5
MD5 774ffce8100a6f127a550346700fec80
BLAKE2b-256 4f5888c086d1afdfc2d3034dc4ad712faa7c1cfc1c7626f5719ec1230174e6cd

See more details on using hashes here.

File details

Details for the file switch_config_render-0.2.1-py2-none-any.whl.

File metadata

  • Download URL: switch_config_render-0.2.1-py2-none-any.whl
  • Upload date:
  • Size: 15.9 kB
  • Tags: Python 2
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.15.0 pkginfo/1.7.0 requests/2.25.1 setuptools/39.1.0 requests-toolbelt/0.9.1 tqdm/4.58.0 CPython/2.7.12

File hashes

Hashes for switch_config_render-0.2.1-py2-none-any.whl
Algorithm Hash digest
SHA256 4ac8a2533221eca0a6cba71fffd9da5cef22ab197f21baf391c9470307133558
MD5 c1cc926e5fb1d1f3f9b70290d3566d1b
BLAKE2b-256 cd86ecfd836bdcc3ca5bb3e073648d02c60d73b8a76f659f35085cb6924c67af

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page