daneads / pypatent Goto Github PK
View Code? Open in Web Editor NEWSearch for and retrieve US Patent and Trademark Office Patent Data
License: GNU General Public License v3.0
Search for and retrieve US Patent and Trademark Office Patent Data
License: GNU General Public License v3.0
My script iterates through a list of patents I want to collect information on.
I initially received this error:
Exception is: ('Connection aborted.', error(10054, ''))
I introduced a time.sleep(2) between calls of pypatent.Search function and remediated this error.
In the 5th iteration of pypatent.Search() , I received this error:
ConnectionError: ('Connection aborted.', BadStatusLine('Error #2000\n',))
Any suggestions on remediating this error? Thank you for your help in advance!
pypatent.Search('rocket', results_limit=2).as_dataframe()
The function returns the information - but I want to collect it in a separate file. How can I gather the information?
Similarly, I am unable to recover the output of the code:
pypatent.Search('rocket', results_limit=2).as_list()
The function returns a box 'Squeeze Text' which I can open, but it stalls Idle. And, I am unable to right click the box to copy it. Ultimately I am trying to get the return results from the search in a file. Any advice would be appreciated.
Hi,
I've been testing pypatent lately and tried to retrieve USPTO patents containing the term "melting point". USPTO is recording 270,000+ of them in their USPTO Patent Full-Text and Image Database. When running pypatent I could only get 2290. I ran this code : pypatent.Search('melting point', results_limit=300000).as_dataframe()
Is there a subtility I did not understand?
Thank you in advance,
Best
Error when running your example:
pypatent.Search('TTL/(tennis AND (racquet OR racket))')
AttributeError Traceback (most recent call last)
<ipython-input-2-a7c0dc5b3207> in <module>
----> 1 pypatent.Search('TTL/(tennis AND (racquet OR racket))')
/usr/local/lib/python3.7/site-packages/pypatent/__init__.py in __init__(self, string, results_limit, get_patent_details, pn, isd, ttl, abst, aclm, spec, ccl, cpc, cpcl, icl, apn, apd, apt, govt, fmid, parn, rlap, rlfd, prir, prad, pct, ptad, pt3d, pppd, reis, rpaf, afff, afft, in_, ic, is_, icn, aanm, aaci, aast, aaco, aaat, lrep, an, ac, as_, acn, exp, exa, ref, fref, oref, cofc, reex, ptab, sec, ilrn, ilrd, ilpd, ilfd)
245 r = requests.get(url, headers=Constants.request_header).text
246 s = BeautifulSoup(r, 'html.parser')
--> 247 total_results = int(s.find(string=re.compile('out of')).find_next().text.strip())
248
249 patents = self.get_patents_from_results_url(url, limit=results_limit)
AttributeError: 'NoneType' object has no attribute 'find_next'
Is this repo still connected to USPTO? Probably not, as connections take a ton of time without any response.
I setup a virtual env, and ran:
pip install pypatent
But, when I ran:
pypatent.Search('microsoft')
I received the following error:
-bash: syntax error near unexpected token
microsoft'`
I am not sure why the search won't work because I don't know what 'unexpected token' means. Indeed, I am not sure how to proceed and would appreciate any advice or suggestions.
I run the search with below code, what I want is get 5 items , but it seems like the library still will load the first page (50 items). It's too slow to get data.
import pypatent
from selenium import webdriver
with webdriver.Firefox() as driver:
conn = pypatent.WebConnection(use_selenium=True, selenium_driver=driver)
res = pypatent.Search('microsoft', results_limit=5,
web_connection=conn)
print(res)
In July 2018, these two examples worked well:
pypatent.search("microsoft)
this_patent = patent('http://patft.uspto.gov/netacgi/nph-Parser?Sect1=PTO2&Sect2=HITOFF&u=%2Fnetahtml%2FPTO%2Fsearch-adv.htm&r=4&p=1&f=G&l=50&d=PTXT&S1=aaa&OS=aaa&RS=aaa')
November 2018 I am receiving the following error:
ConnectionError: ('Connection aborted.', TimeoutError(10060, 'A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond', None, 10060, None))
Dependent package meet requirements:
Python 3, BeautifulSoup, requests, re
Loved using this package over the summer :) I tried the script from the summer that worked well, but received the same error. Looking for help with connecting to the server. Thank you for your help in advance! Much appreciated! Any suggestions @daneads ?
Some patents have very long descriptions and they are being truncated with the typical python ... to indicate that the string has been truncated. I set pandas max_colwidth to None and it had no effect on this behavior. This is causing me to lose a portion of the description. Any thoughts on how to correct this?
Hi, it seems that the pypatent can only handle the patent issued after 1976.
When I want to search the patent issued before 1975, and specify ISD/1/$/1975, it always return error.
I noticed that in the USPTO website, user can manually chooose the after 1976 database or the 1790 full datebase.
Can we manually choose the full database in the pypatent?
Hey! This is the only way I can see to contact you, so here I go!
I'm the author and maintainer of patent_client
, a library with a similar scope and feature set as your own. patent_client
is under active development, and growing, so if you'd like, I'd love to have you contribute, or add a note on your readme pointing to it!
Thanks!
Parker
When I try to search two key words, i found the result is zero. I checked code, and found it's more reasonale if
searchstring = searchstring.replace(' ', '+') is changed to searchstring = searchstring.replace('-', '+')
I am using the 1.1.0 version and I found whatever 1.2.0 or 1.1.0 will report error after download some patents.
When installing using "pip install pypatent" the following error occurs:
"Could not find a version that satisfies the requirement re (from pypatent) (from version: )
No matching distribution found for re (from pypatent)"
However, re already comes with python (at least in the Anaconda distribution)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.