diff --git a/ippisite/ippidb/ws.py b/ippisite/ippidb/ws.py index 10332f73938de1dc73d07aefa7eadedef2fcdf6d..190c4ef13c30151ffb7e1f11fc3a67570ede063c 100644 --- a/ippisite/ippidb/ws.py +++ b/ippisite/ippidb/ws.py @@ -77,85 +77,6 @@ def get_pubmed_info(pmid): } -def get_epo_info(patent_number): - """ - Retrieve information about a patent using the EPO website - - WARNING: this is not to be used anymore, the 3.1 version of the EPO service is now - offline - - :param patent_number: patent number - :type patent_number: str - :return: patent metadata (title, journal name, publication year, authors list). - :rtype: dict - """ - resp = requests.get( - f"http://ops.epo.org/3.1/rest-services/published-data/publication/docdb/" - f"{patent_number}/biblio.json" - ) - data = resp.json() - exchange_doc = data["ops:world-patent-data"]["exchange-documents"][ - "exchange-document" - ] - if isinstance(exchange_doc, list): - exchange_doc = exchange_doc[0] - title = [ - el["$"] - for el in exchange_doc["bibliographic-data"]["invention-title"] - if el["@lang"] == "en" - ][0] - authors = [ - i["inventor-name"]["name"]["$"] - for i in exchange_doc["bibliographic-data"]["parties"]["inventors"]["inventor"] - if i["@data-format"] == "original" - ][0] - biblio_year = [ - el["date"]["$"][:4] - for el in exchange_doc["bibliographic-data"]["publication-reference"][ - "document-id" - ] - if el["@document-id-type"] == "epodoc" - ][0] - return { - "title": title, - "journal_name": None, - "biblio_year": biblio_year, - "authors_list": authors, - } - - -def get_google_patent_info_ris(patent_number): - """ - Retrieve information about a patent using the Google RIS web service - - WARNING: this is not to be used anymore, this Google Web service is now offline - - :param patent_number: patent number - :type patent_number: str - :return: patent metadata (title, journal name, publication year, authors list). - :rtype: dict - """ - url = "https://encrypted.google.com/patents/{}.ris".format(patent_number) - resp = requests.get(url) - title = None - authors = [] - biblio_year = None - for line_str in resp.text.split("\n"): - line = line_str.strip().split(" - ") - if line[0] == "A1": - authors.append(line[1]) - elif line[0] == "T1": - title = line[1] - elif line[0] == "Y1": - biblio_year = line[1].split("/")[0] - return { - "title": title, - "journal_name": None, - "biblio_year": biblio_year, - "authors_list": authors, - } - - def get_google_patent_info(patent_number): """ Retrieve information about a patent parsing Dublin Core info in the Google HTML