Skip to main content

A SBGN rendering library

Project description

SBGNRender Python library

This library is using Selenium to control ChromeDriver, to run a JS website rendering SBGN (based on Newt)

To install it, the simplest way is via PyPI :

sudo pip3 install sbgnrender

After installing the library, usage is the following :

from sbgnrender import renderSBGN

renderSBGN(
    input_file,  // Path as a string
    output_file, // Path as a string
    format,      // Format as a string : svg, png, jpg
    scale,       // Scale of the network (default 1 for svg, 3 for jpg/png)
    bg,          // Background color as HTML String (ex #fff for white), None for transparent (available for png/svg),
    max_width,   // Maximum width in pixels
    min_width,   // Minimum width in pixels
    quality,     // Quality (available for jpg),
    layout,      // Perform automatic layout
    verbose      // True | False
)

This library depends on ChromeDriver, which can be installed on ubuntu/debian systems with

sudo apt install chromium-chromedriver

On Ubuntu 19.x and later, chromium installation is using snap package manager, which causes a problem while writing and accessing temporary files. The current workaround is to change chromium temporary directory permissions with :

sudo chmod 711 /tmp/snap.chromium

This is just a temporary which you will have to do at startup (after having run chrome at least once) everytime. If somebody knows a trick, contributions are welcome

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

sbgnrender-1.0.0a6.tar.gz (5.7 kB view details)

Uploaded Source

Built Distribution

sbgnrender-1.0.0a6-py3-none-any.whl (3.9 MB view details)

Uploaded Python 3

File details

Details for the file sbgnrender-1.0.0a6.tar.gz.

File metadata

  • Download URL: sbgnrender-1.0.0a6.tar.gz
  • Upload date:
  • Size: 5.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/47.1.0 requests-toolbelt/0.9.1 tqdm/4.50.0 CPython/3.8.5

File hashes

Hashes for sbgnrender-1.0.0a6.tar.gz
Algorithm Hash digest
SHA256 9140013c833b6343e6210c30b05860e6a0529f8f8e1280ab668af991792cc249
MD5 ddb351463d622ef7ac3878392723fbd4
BLAKE2b-256 e4bc0d4587c6f7c3d436711f21adeb4d744223da29c616ac6804ffadafe993c6

See more details on using hashes here.

File details

Details for the file sbgnrender-1.0.0a6-py3-none-any.whl.

File metadata

  • Download URL: sbgnrender-1.0.0a6-py3-none-any.whl
  • Upload date:
  • Size: 3.9 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/47.1.0 requests-toolbelt/0.9.1 tqdm/4.50.0 CPython/3.8.5

File hashes

Hashes for sbgnrender-1.0.0a6-py3-none-any.whl
Algorithm Hash digest
SHA256 40feb5e84acabf689303ecaa76dee35a3e9a5c2618a19e5c132285366ead0be3
MD5 49712ea38fc8345c44121279b8a0f1b3
BLAKE2b-256 fc2ffdfda584241bb6a3028a0e3c0ba990701d3742c82f7dacee60e26fc1c1cb

See more details on using hashes here.

Supported by

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