Skip to main content

Parsing, validation, compilation, and data exchange of Biological Expression Language (BEL)

Project description

PyBEL is a pure Python package for parsing and handling biological networks encoded in the Biological Expression Language (BEL). It also facilitates data interchange between common formats and databases such as NetworkX, JSON, CSV, SIF, Cytoscape, CX, NDEx, SQL, and Neo4J.

Its companion package, PyBEL Tools, contains a suite of functions and pipelines for analyzing the resulting biological networks.

We realize there we have a name conflict with the python wrapper for the cheminformatics package, OpenBabel. If you’re looking for their python wrapper, see here.


If you find PyBEL useful for your work, please consider citing:

[1]Hoyt, C. T., et al. (2017). PyBEL: a Computational Framework for Biological Expression Language. Bioinformatics, 34(December), 1–2.

Getting Started

This example illustrates how the Selventa Small Corpus can be loaded.

>>> import pybel
>>> graph = pybel.from_url('')
>>> graph.number_of_nodes()  # Will be smaller than expected because we have the most strict settings enabled

More examples can be found in the documentation and in the PyBEL Notebooks repository.

PyBEL also installs a command line interface with the command pybel for simple utilities such as data conversion. In this example, a BEL document is compiled then exported to GraphML for viewing in Cytoscape.

$ pybel compile ~/Desktop/example.bel
$ pybel serialize ~/Desktop/example.bel --graphml ~/Desktop/example.graphml

In Cytoscape, open with Import > Network > From File.

Installation Current version on PyPI Stable Supported Python Versions Apache 2.0 License

PyBEL can be installed easily from PyPI with the following code in your favorite terminal:

$ pip install pybel

or from the latest code on GitHub with:

$ pip install git+

See the installation documentation for more advanced instructions. Also, check the change log at CHANGELOG.rst.


Contributions, whether filing an issue, making a pull request, or forking, are appreciated. See CONTRIBUTING.rst for more information on getting involved. Please add your name to AUTHORS.rst!


Project details

Release history Release notifications

Download files

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

Files for pybel, version 0.13.2
Filename, size File type Python version Upload date Hashes
Filename, size pybel-0.13.2-py3-none-any.whl (284.7 kB) File type Wheel Python version py3 Upload date Hashes View hashes
Filename, size pybel-0.13.2.tar.gz (361.0 kB) File type Source Python version None Upload date Hashes View hashes

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page