src/pybel/io/jgif.py
def to_jgif_file(graph: BELGraph, file: Union[str, TextIO], **kwargs) -> None:
    """Write JGIF to a file.

    :param graph: A BEL graph
    :param file: A writable file or file-like

    The example below shows how to output a BEL graph as JGIF to an open file.

    .. code-block:: python

       from pybel.examples import sialic_acid_graph
       from pybel import to_jgif_file
       with open('graph.bel.jgif.json', 'w') as file:
           to_jgif_file(sialic_acid_graph, file)

    The example below shows how to output a BEL graph as JGIF to a file at a given path.

    .. code-block:: python

        from pybel.examples import sialic_acid_graph
        from pybel import to_jgif_file
        to_jgif_file(sialic_acid_graph, 'graph.bel.jgif.json')

    If you have a big graph, you might consider storing it as a gzipped JGIF file
    by using :func:`to_jgif_gz`.
    """
    json.dump(to_jgif(graph), file, ensure_ascii=False, **kwargs)
Write JGIF to a file.

    :param graph: A BEL graph
    :param file: A writable file or file-like

    The example below shows how to output a BEL graph as JGIF to an open file.

    .. code-block:: python

       from pybel.examples import sialic_acid_graph
       from pybel import to_jgif_file
       with open('graph.bel.jgif.json', 'w') as file:
           to_jgif_file(sialic_acid_graph, file)

    The example below shows how to output a BEL graph as JGIF to a file at a given path.

    .. code-block:: python

        from pybel.examples import sialic_acid_graph
        from pybel import to_jgif_file
        to_jgif_file(sialic_acid_graph, 'graph.bel.jgif.json')

    If you have a big graph, you might consider storing it as a gzipped JGIF file
    by using :func:`to_jgif_gz`.
    
Write JGIF to a file.
Write JGIF to a file .
def to_jgif_file(graph: BELGraph, file: Union[str, TextIO], **kwargs) -> None:
    json.dump(to_jgif(graph), file, ensure_ascii=False, **kwargs)
def to_jgif_file ( graph : BELGraph , file : Union [ str , TextIO ] , ** kwargs ) -> None : json . dump ( to_jgif ( graph ) , file , ensure_ascii = False , ** kwargs )
Write JGIF to a file.
Write JGIF to a file .
"""Write JGIF to a file.

    :param graph: A BEL graph
    :param file: A writable file or file-like

    The example below shows how to output a BEL graph as JGIF to an open file.

    .. code-block:: python

       from pybel.examples import sialic_acid_graph
       from pybel import to_jgif_file
       with open('graph.bel.jgif.json', 'w') as file:
           to_jgif_file(sialic_acid_graph, file)

    The example below shows how to output a BEL graph as JGIF to a file at a given path.

    .. code-block:: python

        from pybel.examples import sialic_acid_graph
        from pybel import to_jgif_file
        to_jgif_file(sialic_acid_graph, 'graph.bel.jgif.json')

    If you have a big graph, you might consider storing it as a gzipped JGIF file
    by using :func:`to_jgif_gz`.
    """
graph
BELGraph
A BEL graph
A BEL graph
file
Union[str, TextIO]
A writable file or file-like
The example below shows how to output a BEL graph as JGIF to an open file.

code-block:: python

from pybel.examples import sialic_acid_graph
from pybel import to_jgif_file
with open('graph.bel.jgif.json', 'w') as file:
to_jgif_file(sialic_acid_graph, file)

The example below shows how to output a BEL graph as JGIF to a file at a given path.

code-block:: python

from pybel.examples import sialic_acid_graph
from pybel import to_jgif_file
to_jgif_file(sialic_acid_graph, 'graph.bel.jgif.json')

If you have a big graph, you might consider storing it as a gzipped JGIF file
by using :func:`to_jgif_gz`.
A writable file or file - like The example below shows how to output a BEL graph as JGIF to an open file . code - block :: python from pybel . examples import sialic_acid_graph from pybel import to_jgif_file with open ( ' graph . bel . jgif . json ' ' w ' ) as file : to_jgif_file ( sialic_acid_graph file ) The example below shows how to output a BEL graph as JGIF to a file at a given path . code - block :: python from pybel . examples import sialic_acid_graph from pybel import to_jgif_file to_jgif_file ( sialic_acid_graph ' graph . bel . jgif . json ' ) If you have a big graph you might consider storing it as a gzipped JGIF file by using : func : ` to_jgif_gz ` .