The Python Wrapper

This has nothing to do with a snake in a hoodie laying down rhythmic rhymes, that would be Python The Rapper :-) The same people who wrote the patentsview api also wrote a python wrapper that produces a csv file. All you need to do is download their code and dependencies (instructions provided in the link) and write a configuration file for your query or queries (more than one query can be specified in a configuration file)..

They have a bug in their version where it only retrieves the first 25 rows of your query's result set which may be fine depending on your query. (Probably not fine if you ask for patents assigned to IBM- your csv file would only contain the first 25!) I submitted a pull request to fix it but it hasn't been accepted yet. My version is here.

Say you wanted to know what patents are assigned to companies in China. This configuration file would generate a csv file for you.
entity = "patents"
input_file = "countries.txt"
directory = "/Users/Russ/mygit/PatentsView-APIWrapper" 
input_type = "assignee_country"
fields = ["patent_number", "assignee_organization", "assignee_city", "assignee_country"]
criteria = {"_not":{"assignee_organization":""}}

where countries.txt contains:
The day I ran this, my version generated a 79,901 row csv file while the patentview version produced a 26 line csv file. (Counts include a header line.)