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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for sbgnrender-1.0.0a9-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f59284e4582b8e72a6f1bb116a99216704b92782b8f72b23e56e8dfc3079fc32 |
|
MD5 | 6d9b80264a7a623550b453c89d2d3aea |
|
BLAKE2b-256 | ef8080f83dc5d83c49dd981d77c91b19ee6b730a6365917de5f79814f3545577 |