Patent Scraper
A python package to scrape patents from 'https://patents.google.com/'. The package is made up of a single python class, scraper_class. This scraper can be used both to retreive parsed html of a single patents page or a list of patents.
The main elements returned by the scraper class are:
application_number (str) : application number
inventor_name (json) : inventors of patent
assignee_name_orig (json) : original assignees to patent
assignee_name_current (json) : current assignees to patent
pub_date (str) : publication date
filing_date (str) : filing date
priority_date (str) : priority date
grant_date (str) : grant date
forward_cites_no_family (json) : forward citations that are not family-to-family cites
forward_cites_yes_family (json) : forward citations that are family-to-family cites
backward_cites_no_family (json) : backward citations that are not family-to-family cites
backward_cites_yes_family (json) : backward citations that are family-to-family cites
Package Installation
The package is available on PyPi, and can be installed using pip:
pip install google_patent_scraper
Main Use Cases
There are two primary ways to use this package:
- Scrape a single patent
# ~ Import packages ~ #
from google_patent_scraper import scraper_class
# ~ Initialize scraper class ~ #
scraper=scraper_class()
# ~~ Scrape patents individually ~~ #
patent_1 = 'US2668287A'
patent_2 = 'US266827A'
err_1, soup_1, url_1 = scraper.request_single_patent(patent_1)
err_2, soup_2, url_2 = scraper.request_single_patent(patent_2)
# ~ Parse results of scrape ~ #
patent_1_parsed = scraper.get_scraped_data(soup_1,patent_1,url_1)
patent_2_parsed = scraper.get_scraped_data(soup_2,patetn_2,url_2)
- Scrape a list of patents
# ~ Import packages ~ #
from google_patent_scraper import scraper_class
import json
# ~ Initialize scraper class ~ #
scraper=scraper_class()
# ~ Add patents to list ~ #
scraper.add_patents('US2668287A')
scraper.add_patents('US266827A')
# ~ Scrape all patents ~ #
scraper.scrape_all_patents()
# ~ Get results of scrape ~ #
patent_1_parsed = scraper.parsed_patents['US2668287A']
patent_2_parsed = scraper.parsed_patents['US266827A']
# ~ Print inventors of patent US2668287A ~ #
for inventor in json.loads(patent_1_parsed['inventor_name']):
print('Patent inventor : {0}'.format(inventor['inventor_name']))
Example Files
I have provided two seperate example scripts for usage of this package in the /example/ folder:
- Examples from this readme: readme_example
- Scrape multiple patents using Python's multiprocessing package: multiprocess_example
Metadata
Release files for google-patent-scraper 1.0.8
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| google_patent_scraper-1.0.8.tar.gz | 5.0 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| google_patent_scraper-1.0.8-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 11.9 kB
Release files / google_patent_scraper-1.0.8.tar.gz
| Download URL | google_patent_scraper-1.0.8.tar.gz |
|---|---|
| Size | 5.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
cfe6abade27867c94a4d3abb522f76d4a7da2827942c1c548fbd10608731ea48
|
|
BLAKE2b-256 checksum How to use checksums |
4165b791565a7dd1488142cc159222c285cad8dd63a6c9ece4ee8586f7c28e64
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/45.2.0.post20200210 requests-toolbelt/0.9.1 tqdm/4.42.1 CPython/3.7.6
|
Release files / google_patent_scraper-1.0.8-py3-none-any.whl
| Download URL | google_patent_scraper-1.0.8-py3-none-any.whl |
|---|---|
| Size | 6.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
26f9813ce2bf433285bdd756b9c7dc5501e9f0210e97019e3ee2a45ec85c3b2a
|
|
BLAKE2b-256 checksum How to use checksums |
4731552cd9979c17331be0ba66e1eb10c70a9c33d8aa323b93aef85295906708
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/45.2.0.post20200210 requests-toolbelt/0.9.1 tqdm/4.42.1 CPython/3.7.6
|
Security for google-patent-scraper 1.0.8
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.