poetree.Author
Class corresponding to a particular author. *One of id_author / wiki / viaf parameters needs to be set.
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_author | 0 | int | Id(DB) if the author |
wiki | 0 | str | Wiki id of the author |
viaf | 0 | str | VIAF id of the author |
base_url | 0 | str | API base_url. Default: 'https://versologie.cz/poetree/api/' |
method :: get_sources
Get metadata of sources by the author. Create a new Source instance for each source, store it in a list and return it.
Parameters
Parameter | Mandatory | Data type | Description |
published_after | 0 | int | Limit to sources published no sooner than a given year |
published_before | 0 | int | Limit to sources published no later than a given year |
Returns
Data type | Description |
list | List holding instances of Source |
method :: get_poems
Get metadata of poems by the author. Create a new Poem instance for each poem, store it in a list and return it.
Parameters
Parameter | Mandatory | Data type | Description |
id_source | 0 | int | Limit to poems from certain source |
Returns
Data type | Description |
list | List holding instances of Poem |
method :: metadata
Returns metadata of selected target 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 |
target | 0 | str | Metadata of what to return. Values: 'sources', 'poems', 'self'. Default: 'self' |
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 |