Installation¶
libsbgnpy requires python >= 3.11 and is available from pypi.
With uv¶
uv is the recommended way to install the package. In a project it is added as a dependency, which resolves and locks it together with the rest of the environment:
Into an existing virtual environment it is installed through the pip interface of uv:
With pip¶
Development version¶
The current state of the develop branch is installed directly from GitHub:
or, with pip,
To work on the repository itself, with the test and documentation tooling, see Development.
Dependencies¶
The package depends on xsdata, which reads and writes the SBGN-ML documents, lxml, which validates them against the schema, requests, which queries the rendering web service, and rich, which formats the output of the examples. lxml ships wheels for all common platforms, so no compiler is needed.
Logging¶
libsbgnpy does not configure logging. It logs to loggers below the libsbgnpy logger and leaves handlers, levels and formatting to the application, so the messages of the package stay under your control:
import logging
logging.basicConfig(level=logging.INFO)
logging.getLogger("libsbgnpy").setLevel(logging.WARNING)
For scripts and interactive work the rich output of the package can be turned on explicitly: