Skip to content

Add Enriched Citations API Endpoint#130

Merged
dpieski merged 5 commits intomainfrom
wip-citations
Mar 27, 2026
Merged

Add Enriched Citations API Endpoint#130
dpieski merged 5 commits intomainfrom
wip-citations

Conversation

@dpieski
Copy link
Copy Markdown
Contributor

@dpieski dpieski commented Mar 27, 2026

Summary

  • Add EnrichedCitationsClient for the USPTO Enriched Cited Reference Metadata API (v3), with search_citations(), get_fields(), and paginate_citations() methods
  • Split BaseUSPTOClient.paginate_results() into two methods to support different pagination styles: paginate_results() for offset/limit (existing APIs) and paginate_solr_results() for start/rows (Solr-style APIs like Enriched Citations)

Details

  • The Enriched Citations API uses Solr-style start/rows pagination keys instead of the offset/limit keys used by other USPTO APIs.

New models: EnrichedCitation, EnrichedCitationResponse, EnrichedCitationFieldsResponse.


max_items = 30
count = 0
for citation in client.paginate_citations(

Check notice

Code scanning / CodeQL

Unused global variable Note

The global variable 'citation' is not used.

Copilot Autofix

AI 2 days ago

In general, when a loop or global variable is intentionally unused, it should be given a conventional “unused” name (such as _ or a name containing unused) so that both humans and static analysis tools recognize it as deliberate. Otherwise, the unused variable should be removed.

Here, the loop on lines 114–116 iterates over client.paginate_citations(...) but never uses citation. The best fix without changing functionality is to rename the loop variable from citation to _, which signals it is intentionally unused while leaving the logic (incrementing count, enforcing max_items, and breaking) unchanged. No imports or additional definitions are needed, and no other parts of the file reference this particular loop variable, so the change is localized to the for statement in examples/enriched_citations_example.py.

Suggested changeset 1
examples/enriched_citations_example.py

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/examples/enriched_citations_example.py b/examples/enriched_citations_example.py
--- a/examples/enriched_citations_example.py
+++ b/examples/enriched_citations_example.py
@@ -111,7 +111,7 @@
 
 max_items = 30
 count = 0
-for citation in client.paginate_citations(
+for _ in client.paginate_citations(
     tech_center_q="2800", rows=10
 ):
     count += 1
EOF
@@ -111,7 +111,7 @@

max_items = 30
count = 0
for citation in client.paginate_citations(
for _ in client.paginate_citations(
tech_center_q="2800", rows=10
):
count += 1
Copilot is powered by AI and may make mistakes. Always verify output.
@dpieski dpieski merged commit bd2e3b8 into main Mar 27, 2026
10 checks passed
@dpieski dpieski deleted the wip-citations branch March 27, 2026 18:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant