Package: piate
piateA python library and cli tool to interact with theIATE (InteractiveTerminology forEurope)database.CLI toolLibraryInstallingpip install piateCLI toolCurrently working commands:iate list-collectionsiate list-domainsiate list-institutionsiate inventories list-languagesiate inventories list-primaritiesiate inventories list-query-operatorsiate inventories list-reliabilitiesiate inventories list-searchable-fieldsiate inventories list-term-typesFilteringIt's suggested to use thejqto filter the responses on the command line.For example, only select official languages:iateinventorieslist-languages|jq'[.[] | select(.is_official == true)] | length'Libraryclient()collectionspages()institutionspages()domainslist()inventoriespages_languages()pages_query_operators()pages_term_types()pages_searchable_fields()pages_primarities()pages_reliabilities()client(**kwargs)The entrypoint into the library, allowing the provision of authentication.Parametersusername(string)-- Username to use to authenticate against the API. Conflicts withsession. Requirespassword.password(string)-- Password to use to authenticate against the API. Conflicts withsession. Requiresusername.session(piate.api.session.Session)-- Session object to use to authenticate against the API. Conflicts withusernameandpassword.Examples# Example with username and passwordimportpiateiate_client=piate.client(username="myusername",api_key="...")# Example with session objectimportpiatefrompiate.api.sessionimportSessionfrompiate.api.credentialsimportCredentialsiate_client=piate.client(session=Session(credentials=Credentials(username="myusername",api_key="...")))CollectionsA resource representing collectionsimportpiatecollections=piate.client(...).collectionsThese are the available methods:pages()pages()Iterate through pages of responses for Collections objects.Examplesforpageincollections.pages():forcollectioninpage.items:print(collection.name)InstitutionsA resource representing institutionsimportpiateinstitutions=piate.client(...).institutionsThese are the available methods:pages()pages()Iterate through pages of response for Institutions objects.Examplesforpageininstitutions.pages():forinstitutioninpage.items:print(institution.name)DomainsA resource representing domainsimportpiatedomains=piate.client(...).domainsThese are the available methods:list()list()List all the available domains.Examplesfordomainindomains.list():print(domain.name)InventoriesA resoure representing inventoriesimportpiateinventories=piate.client(...).inventoriesThese are the available methods:pages_languages()pages_query_operators()pages_term_types()pages_searchable_fields()pages_primarities()pages_reliabilities()pages_languages(**kwargs)Iterate through pages of response for language objects.Parameterstranslation_language(string)-- Translation LanguageExamplesforpageininventories.pages_languages(translation_language="en"):forlanguageinpage.items:print(language.name)pages_query_operators(**kwargs)Iterate through pages of response for language objects.Parameterstranslation_language(string)-- Translation LanguageExamplesforpageininventories.pages_query_operators(translation_language="en"):forquery_operatorsinpage.items:print(query_operators.name)pages_term_types(**kwargs)Iterate through pages of response for language objects.Parameterstranslation_language(string)-- Translation LanguageExamplesforpageininventories.pages_term_types(translation_language="en"):forterm_typesinpage.items:print(term_types.name)pages_searchable_fields(**kwargs)Iterate through pages of response for language objects.Parameterstranslation_language(string)-- Translation LanguageExamplesforpageininventories.pages_searchable_fields(translation_language="en"):forsearchable_fieldinpage.items:print(searchable_field.name)pages_primarities(**kwargs)Iterate through pages of response for language objects.Parameterstranslation_language(string)-- Translation LanguageExamplesforpageininventories.pages_primarities(translation_language="en"):forprimaritiesinpage.items:print(primarities.name)pages_reliabilities(**kwargs)Iterate through pages of response for language objects.Parameterstranslation_language(string)-- Translation LanguageExamplesforpageininventories.pages_reliabilities(translation_language="en"):forreliabilitiesinpage.items:print(reliabilities.name)