OPS Decsription and Claims using Python

This space is made available to users of Open Patent Services (OPS) web-service and now also to users of EPO’s bulk data subscription products such as 14. EPO worldwide bibliographic database (DOCDB), 14.11 EPO worldwide legal status database (INPADOC), 14.12 EP full text data, 14.1 EP bibliographic data (EBD)and more.

Users can ask each other questions, exchange experiences and solutions, post ideas. The moderator will use this space to announce changes or other relevant information.
Post Reply

Antonio
Posts: 1
Joined: Tue Dec 09, 2003 12:48 pm
Contact:

OPS Decsription and Claims using Python

Post by Antonio » Wed May 29, 2024 6:24 pm

Hi, team

I am trying to access full text and claims from patent document using OPS

I made this test code, but it is not working, Could you identify the error ?

Thanks

try:
client = epo_ops.Client(key=key, secret=secret) # Instantiate client
response = client.published_data( # Retrieve bibliography data
reference_type = 'publication', # publication, application, priority
input = epo_ops.models.Docdb('1000000', 'EP', 'A1'), # original, docdb, epodoc
endpoint = 'fulltext', # optional, defaults to biblio in case of published_data
constituents = [] # optional, list of constituents
)
except:
print(f'Número {numero} não identificado')

content = response.text
bs_content = bs(content, "xml")
print(bs_content)

abstract = bs_content.find("abstract",{'lang':'en'})
print(abstract)
title = bs_content.find("invention-title",{'lang':'en'})
print(title)
full_text = bs_content.find_all("ops:fulltext-instance",{'desc':'description'})
#print(full_text)
resultado=[]
i=0
for element in full_text:
if i>0:
#rint(element)
texto = element.find("ops:fulltext-format").text.strip()
#print(f'{country}{doc_number}{kind}')
resultado.append(f'{texto}')

i=i+1

print("DESCRIPTION")
print(resultado)

claims = bs_content.find_all("ops:fulltext-instance",{'desc':'claims'})
#print(claims)
resultado=[]
i=0
for element in claims:
if i>0:
#rint(element)
claims = element.find("ops:fulltext-format").text.strip()
#print(f'{country}{doc_number}{kind}')
resultado.append(f'{claims}')

i=i+1

print("CLAIMS")
print(resultado)


OPS support
Posts: 4
Joined: Mon Apr 22, 2024 9:40 am

Re: OPS Decsription and Claims using Python

Post by OPS support » Wed Jun 05, 2024 10:18 am

Hi,

/rest-services/published-data/publication/docdb/ep.1000000.a1./fulltext
/rest-services/published-data/publication/docdb/ep.1000000.a1./claims
/rest-services/published-data/publication/docdb/ep.1000000.a1./description

Here is how to call OPS for full text in XML data, where available.

Regards,
Vesna for OPS support


Post Reply