traopia commited on
Commit
a4877a2
·
1 Parent(s): aec563a
Files changed (1) hide show
  1. src/wikibase_helpers.py +4 -4
src/wikibase_helpers.py CHANGED
@@ -4,6 +4,8 @@ from wikibaseintegrator import WikibaseIntegrator, datatypes, wbi_helpers
4
  from wikibaseintegrator.wbi_config import config
5
  from wikibaseintegrator.wbi_exceptions import MWApiError
6
  from wikibaseintegrator.wbi_helpers import mediawiki_api_call_helper, SearchError
 
 
7
 
8
  wikibase_api_url = 'https://fashionwiki.wikibase.cloud/w/api.php'
9
  config = {
@@ -55,10 +57,8 @@ def get_entity_id_by_label(search_string,wiki, dict_result=False) -> list:
55
  :param dict_result: If True, the result will be a list of dictionaries with the keys 'id', 'label', 'match', 'description' and 'aliases'. If False, the result will be a list of strings with the entity IDs.
56
  :return: A list of dictionaries or strings with the search results
57
  """
58
- if wiki == "wikidata":
59
- login = login_wikidata
60
- mediawiki_api_url = wikidata_api_url
61
- elif wiki == "wikibase":
62
  login = login_wikibase
63
  mediawiki_api_url = wikibase_api_url
64
 
 
4
  from wikibaseintegrator.wbi_config import config
5
  from wikibaseintegrator.wbi_exceptions import MWApiError
6
  from wikibaseintegrator.wbi_helpers import mediawiki_api_call_helper, SearchError
7
+ from wikibaseintegrator import WikibaseIntegrator, wbi_login
8
+ login_wikibase = wbi_login.Login(user="Traopia", password="diqfiz-wodnI4-jafwax", mediawiki_api_url="https://fashionwiki.wikibase.cloud/w/api.php")
9
 
10
  wikibase_api_url = 'https://fashionwiki.wikibase.cloud/w/api.php'
11
  config = {
 
57
  :param dict_result: If True, the result will be a list of dictionaries with the keys 'id', 'label', 'match', 'description' and 'aliases'. If False, the result will be a list of strings with the entity IDs.
58
  :return: A list of dictionaries or strings with the search results
59
  """
60
+
61
+ if wiki == "wikibase":
 
 
62
  login = login_wikibase
63
  mediawiki_api_url = wikibase_api_url
64