poetree.Corpus

Class corresponding to a particular corpus.

Parameters
ParameterMandatoryData typeDescription
lang1strISO code of the corpus. Values: 'cs', 'de', 'en', 'es', 'fr', 'hu', 'it', 'pt', 'ru'
base_url0strAPI base_url. Default: 'https://versologie.cz/poetree/api/'

method :: get_authors

Get metadata of all available authors. Create a new Author instance for each author, store it in a list and return it.

Parameters
ParameterMandatoryData typeDescription
country0str|list|setLimit to authors from certain countries. Either a single value, e.g. 'pt' or list-like, e.g. ('pt,br').
born_after0intLimit to authors born no sooner than a given year
born_before0intLimit to authors born no later than a given year
died_after0intLimit to authors that died no sooner than a given year
died_before0intLimit to authors that died no later than a given year

Returns
Data typeDescription
listList holding instances of Author

method :: get_sources

Get metadata of all available sources. Create a new Source instance for each source, store it in a list and return it.

Parameters
ParameterMandatoryData typeDescription
id_author0intLimit to sources by author with this id(DB)
wiki0strLimit to sources by author with this wiki id
viaf0strLimit to sources by author with this VIAF id
published_after0intLimit to sources published no sooner than a given year
published_before0intLimit to sources published no later than a given year

Returns
Data typeDescription
listList holding instances of Source

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: 'authors', 'sources', '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)