poetree.Source

Class corresponding to a particular source. *One of id_ / id_poem parameters needs to be set.

Parameters
ParameterMandatoryData typeDescription
lang1strISO code of the corpus. Values: 'cs', 'de', 'en', 'es', 'fr', 'hu', 'it', 'pt', 'ru'
id_0intId(DB) if the source
id_poem0intId(DB) of the poem its source is to be found
base_url0strAPI base_url. Default: 'https://versologie.cz/poetree/api/'

method :: get_poems

Get metadata of poems in the source. Create a new Poem instance for each poem, store it in a list and return it.

Parameters

None

Returns
Data typeDescription
listList 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
ParameterMandatoryData typeDescription
target0strMetadata of what to return. Values: 'poems', 'self'. Default: 'self'
output0strOutput format. Values: 'list', 'pandas', 'print'. Default: 'list'
sortby0strSubdict key according to which sort the list. Default: None
reverse0boolSort in reversed (descending) order. Default False

Returns
Data typeDescription
(list|pd.DataFrame|None)metadata
Supported by the Czech Science Foundation (GA23-07727S)