A PyBEL extension for interconversion with CX
Project description
A PyBEL extension for interconversion with CX.
Installation
PyBEL-CX can be installed easily from PyPI with the following code in your favorite terminal:
$ python3 -m pip install pybel-cx
or from the latest code on GitHub with:
$ python3 -m pip install git+https://github.com/pybel/pybel-cx.git
Command Line Usage
PyBEL-CX installs two command line utilities: bel_to_cx and cx_to_bel.
CX to BEL
Running this script has the caveat that the CX document should conform to the schema created by PyBEL-CX.
$ cat my_network.cx | cx_to_bel > my_network.bel
BEL to CX
$ cat my_network.bel | bel_to_cx > my_network.cx
Since this operation can be expensive, PyBEL caches namespace resources. The -c flag can be used to specify a database connection string to use a high performance RDBMS instead of the default SQLite. For example, if you would like to use MySQL, this database string will look something like mysql+pymysql://<username>:<password>@<host>/<dbname>?charset=utf8[&<options>]. Be sure to pip install the connector, which is pymysql in this example.
$ pip install pymysql
$ cat my_network.bel | bel_to_cx -c "mysql+pymysql://root:root@localhost/mydb?charset=utf8" > my_network.cx
More documentation on connection strings at http://pybel.readthedocs.io/en/latest/manager.html#pybel.manager.BaseManager.from_connection.
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
File details
Details for the file pybel_cx-0.1.2.dev0.tar.gz
.
File metadata
- Download URL: pybel_cx-0.1.2.dev0.tar.gz
- Upload date:
- Size: 23.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/40.0.0 requests-toolbelt/0.8.0 tqdm/4.24.0 CPython/3.7.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1604b3e9be1fd2f1dbd0c91392886b99be6f0cd986f85410b306c8a766263d43 |
|
MD5 | e56f9da0b957eb69720a2889b326e017 |
|
BLAKE2b-256 | 13ca1bd18a19a1753820771e5acac97dd61fb9cadcd89ea67daf0ab1a2dda0be |
File details
Details for the file pybel_cx-0.1.2.dev0-py3-none-any.whl
.
File metadata
- Download URL: pybel_cx-0.1.2.dev0-py3-none-any.whl
- Upload date:
- Size: 11.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/40.0.0 requests-toolbelt/0.8.0 tqdm/4.24.0 CPython/3.7.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3ae1c2ad1442cdbebde5c79832f51d2e743e87e153b43fc31b367ec6e46ed152 |
|
MD5 | 14e75e63c11afc95a759ffd8758151e5 |
|
BLAKE2b-256 | 1db7c3f74f7f24fc4e2bbbcb8206ace102a5ebb3b7fd285bbfbb52a756516558 |