-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathoa_rejections_example.py
More file actions
63 lines (54 loc) · 2.08 KB
/
oa_rejections_example.py
File metadata and controls
63 lines (54 loc) · 2.08 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
"""Examples for the OARejectionsClient.
This module demonstrates how to use the OARejectionsClient to search for
rejection-level data from USPTO Office Actions.
"""
from pyUSPTO import OARejectionsClient, USPTOConfig
config = USPTOConfig.from_env()
client = OARejectionsClient(config=config)
# --- Example 1: Search by application number ---
response = client.search(patent_application_number_q="12190351")
print(f"Found {response.count} records for application 12190351")
for record in response.docs:
print(f" {record.id}: {record.legacy_document_code_identifier}")
# --- Example 2: Search by document code and date range ---
response = client.search(
legacy_document_code_identifier_q="CTNF",
submission_date_from_q="2020-01-01",
submission_date_to_q="2020-12-31",
rows=5,
)
print(f"\nFound {response.count} CTNF rejections in 2020")
# --- Example 3: Search with a direct criteria string ---
response = client.search(
criteria="hasRej103:1 AND groupArtUnitNumber:1713",
rows=5,
)
print(f"\nFound {response.count} 103-rejection records in art unit 1713")
# --- Example 4: Inspect rejection flags ---
response = client.search(patent_application_number_q="12190351", rows=1)
if response.docs:
record = response.docs[0]
print(f"\nRecord: {record.id}")
print(f" 101 rejection: {record.has_rej_101}")
print(f" 102 rejection: {record.has_rej_102}")
print(f" 103 rejection: {record.has_rej_103}")
print(f" 112 rejection: {record.has_rej_112}")
print(f" Alice indicator: {record.alice_indicator}")
print(f" Claims: {record.claim_number_array_document}")
# --- Example 5: Search with POST body ---
response = client.search(
post_body={"criteria": "patentApplicationNumber:12190351", "rows": 10}
)
print(f"\nFound {response.count} records via POST body")
# --- Example 6: Paginate through results ---
count = 0
for _ in client.paginate(
legal_section_code_q="103",
submission_date_from_q="2020-01-01",
submission_date_to_q="2020-01-31",
rows=25,
):
count += 1
if count >= 50:
break
print(f"\nIterated through {count} records")