Skip to content
Switch branches/tags

Latest commit


Git stats


Failed to load latest commit information.
Latest commit message
Commit time

USPTO Patent Parser

Parse patent application, grant, assignment, and maintenance info from USPTO Bulk Data. This handles all patent formats and outputs to pure CSV. Clusters patents by firm name, first filtering using locality-sensitive hashing, then finding components induced by a Levenshtein distance threshhold.


For parsing, you'll need: numpy, pandas, and lxml. For firm clustering, you'll additionally need: xxhash, editdistance, networkx, and Cython. All of these are available through both pip and conda.


Below is the pipeline that you'll want to follow. The entire process is designed to idempotent, meaning you can rerun any step to propagate updates.

Downloading Data

You can download and extract the raw XML data files using the fetch_*.py files. These look in the respective meta/*_files.txt for the list of files to download and store them in the corresponding data/*. The fetch scripts by default will not overwrite existing files and will only download those that are absent.

Parsing Data

Parsing is done using the parse_*.py scripts. In the case of apply, grant, assign, this will output to separate files in parsed/* so as to allow for multi-threaded parsing. Running afterwards will combine these intermediate files into unified files in tables. Conversely, and output directly to tables.

Firm Clustering

If you're parsing patent assignments, run to flag assignments between the same entity. To cluster firms into common entities based on name similarity, run You can use the sources option to control which names are included. Run to aggregate citation information to the patent level and account for self citations.

Finally, run to merge all of the above into a firm-year panel. This last step requires applications, grants, assignments, and maintenance events to be used (Compustat is optional).


Suppose you just want to parse patent grants. To do this, you would go through the following steps:

  1. Fetch the grant data with
  2. Parse the grant data with
  3. Load the grant data with grant.
  4. Cluster firm names with grant.
  5. Process citations with


Parse and cluster USPTO patent data. Includes applications, grants, assignments, and maintenance.







No packages published