Reader¶
This module contains the Reader class, which is used to read the paper.
Classes¶
- class chemdatawriter.reader.Reader(path_or_paper=None, doctype=None)¶
Reader class to process and retrieve details from the BDE document.
- __init__(path_or_paper=None, doctype=None)¶
Initialize the Reader with a path or a paper.
- Parameters:
path_or_paper (str|dict) – The path to the document or the paper itself.
doctype (str) – The type of the document (“bde” or “json”).
- _load_bde()¶
Load BDE document.
- _load_json()¶
Load JSON document.
- _get(field, default_value='')¶
Generic getter for metadata.
- Parameters:
field (str) – Field from metadata to retrieve.
default_value (str) – Default value to return if field is not present.
- metadata¶
Retrieve the metadata from the document.
- title¶
Retrieve the title.
- authors¶
Retrieve the authors.
- date¶
Retrieve the date.
- abstract¶
Retrieve the abstract.
- doi¶
Retrieve the DOI.
- body¶
Retrieve the body of the document.