Pigeon is a tool that generates SBOL compliant visualizations from text scripts. This readme provides instructions on how to install and use Pigeon.
Make sure you have the following dependency installed:
- graphviz Detailed Instructions
- Clone the repository.
- Install the project and dependencies by running
pip install -e .
orpoetry install
(if you want to actively edit the project). - If using Poetry, activate the shell with
poetry shell
, then runpigeon <your_pigeon_script>.txt
to generate the SVGs.
If you only want to install and use the project without any development, simply run pip install .
.
To run Pigeon from the command line, use the following command:
pigeon <your_pigeon_script>.txt
If you have installed the project, a softlink for pigeon
should be added. If you encounter any issues, you can use python cmdline.py
instead.
By default, Pigeon generates an SVG with the same name as the pigeon script passed in and saves it in the project repository. For example, if you run:
pigeon pigeon_script.txt
Pigeon will generate and save an image called pigeon_script.svg
in the same folder.
You can also specify additional configuration options when using Pigeon, including:
- Image name
- Image format (png, pdf, or svg)
- Image location
For example:
python cmdline.py -name=my_image -format=png -location=/path/to/myFolder pigeon_script.txt
This will generate an image named my_image.png
and save it in the /myFolder
directory.
To integrate Pigeon into your code, follow these steps:
- Check
pyproject.toml
to ensure all required dependencies are installed. - Import Pigeon (see class specifications in
Pigeon.py
). - Create a parser, generate and save the image using the following code:
parser = Pigeon.Pigeon(image_format) # If no format is specified, the default is SVG.
parser.parseAndGenerateImage(script_string) # The script is passed as a string to the parsing function.
parser.save(image_location, image_name) # Saves the image with the name 'image_name' in the folder specified by 'image_location'.
To set up Pigeon with Flask, follow these steps:
Set Flask variables:
export FLASK_ENV=development
export FLASK_APP=server.py
Run the application:
flask run
Please note that the web setup section requires updating and should be referred to the updated documentation.