src/pybel/manager/models.py
def to_json(self, include_id: bool = False) -> Mapping[str, Any]:
        """Return this network as JSON.

        :param include_id: If true, includes the model identifier
        """
        result = {
            METADATA_NAME: self.name,
            METADATA_VERSION: self.version,
        }

        if self.created:
            result['created'] = str(self.created)

        if include_id:
            result['id'] = self.id

        if self.authors:
            result[METADATA_AUTHORS] = self.authors

        if self.contact:
            result[METADATA_CONTACT] = self.contact

        if self.description:
            result[METADATA_DESCRIPTION] = self.description

        if self.copyright:
            result[METADATA_COPYRIGHT] = self.copyright

        if self.disclaimer:
            result[METADATA_DISCLAIMER] = self.disclaimer

        if self.licenses:
            result[METADATA_LICENSES] = self.licenses

        return result
Return this network as JSON.

        :param include_id: If true, includes the model identifier
        
Return this network as JSON.
Return this network as JSON .
def to_json(self, include_id: bool = False) -> Mapping[str, Any]:
        result = {
            METADATA_NAME: self.name,
            METADATA_VERSION: self.version,
        }
        if self.created:
            result['created'] = str(self.created)
        if include_id:
            result['id'] = self.id
        if self.authors:
            result[METADATA_AUTHORS] = self.authors
        if self.contact:
            result[METADATA_CONTACT] = self.contact
        if self.description:
            result[METADATA_DESCRIPTION] = self.description
        if self.copyright:
            result[METADATA_COPYRIGHT] = self.copyright
        if self.disclaimer:
            result[METADATA_DISCLAIMER] = self.disclaimer
        if self.licenses:
            result[METADATA_LICENSES] = self.licenses
        return result
def to_json ( self , include_id : bool = False ) -> Mapping [ str , Any ] : result = { METADATA_NAME : self . name , METADATA_VERSION : self . version , } if self . created : result [ 'created' ] = str ( self . created ) if include_id : result [ 'id' ] = self . id if self . authors : result [ METADATA_AUTHORS ] = self . authors if self . contact : result [ METADATA_CONTACT ] = self . contact if self . description : result [ METADATA_DESCRIPTION ] = self . description if self . copyright : result [ METADATA_COPYRIGHT ] = self . copyright if self . disclaimer : result [ METADATA_DISCLAIMER ] = self . disclaimer if self . licenses : result [ METADATA_LICENSES ] = self . licenses return result
Return this network as JSON.
Return this network as JSON .
"""Return this network as JSON.

        :param include_id: If true, includes the model identifier
        """
self
include_id
bool
If true, includes the model identifier
If true includes the model identifier