hop.models¶
-
class
hop.models.
GCNCircular
(header: dict, body: str)[source]¶ Defines a GCN Circular structure.
The parsed GCN circular is formatted as a dictionary with the following schema:
{‘headers’: {‘title’: …, ‘number’: …, …}, ‘body’: …}
-
asdict
()[source]¶ Represents the GCN Circular as a dictionary.
- Returns:
The dictionary representation of the Circular.
-
classmethod
load
(email_input)[source]¶ Create a new GCNCircular from an RFC 822 formatted circular.
- Args:
email_input: A file object or string.
- Returns:
The GCNCircular.
-
-
class
hop.models.
MessageBlob
(content: str, missing_schema: bool = False)[source]¶ Defines an unformatted message structure.
This is included to mirror the implementation of structured formats.
-
asdict
()[source]¶ Represents the message as a dictionary.
- Returns:
The dictionary representation of the message.
-
classmethod
load
(blob_input)[source]¶ Create a blob message from input text.
- Args:
blob_input: The unstructured message text or file object.
- Returns:
The Blob.
-
-
class
hop.models.
VOEvent
(ivorn: str, role: str = 'observation', version: str = '2.0', Who: dict = <factory>, What: dict = <factory>, WhereWhen: dict = <factory>, How: dict = <factory>, Why: dict = <factory>, Citations: dict = <factory>, Description: dict = <factory>, Reference: dict = <factory>)[source]¶ Defines a VOEvent 2.0 structure.
- Implements the schema defined by:
-
asdict
()[source]¶ Represents the VOEvent as a dictionary.
- Returns:
A dictionary representation of the VOEvent.
-
classmethod
load
(xml_input)[source]¶ Create a new VOEvent from an XML-formatted VOEvent.
- Args:
xml_input: A file object, string, or generator.
- Returns:
The VOEvent.