poetree.Poem
Class corresponding to a particular poem.
Parameters
Parameter | Mandatory | Data type | Description |
lang | 1 | str | ISO code of the corpus. Values: 'cs', 'de', 'en', 'es', 'fr', 'hu', 'it', 'pt', 'ru' |
id_ | 1 | int | Id(DB) if the poem |
method :: get_body
Get body of the poem (if not fetched yet), store it in self.content_ and return it
Returns
Data type | Description |
dict | Object representing body of the poem |
method :: get_all
Get body of the poem (if not fetched yet), store it in self.content_ and return it together with metadata
Returns
Data type | Description |
dict | Object representing body and metadata of the poem |
method :: metadata
Returns metadata of the poem as a list, pandas dataframe or prints out a stringified table. It may be sorted according to any metadata key.
Parameters
Parameter | Mandatory | Data type | Description |
output | 0 | str | Output format. Values: 'list', 'pandas', 'print'. Default: 'list' |
sortby | 0 | str | Subdict key according to which sort the list. Default: None |
reverse | 0 | bool | Sort in reversed (descending) order. Default False |
Returns
Data type | Description |
(list|pd.DataFrame|None) | metadata |