Skip to content

New USPTO API Endpoints#131

Merged
dpieski merged 7 commits into
mainfrom
wip-oa-actions
Mar 30, 2026
Merged

New USPTO API Endpoints#131
dpieski merged 7 commits into
mainfrom
wip-oa-actions

Conversation

@dpieski
Copy link
Copy Markdown
Contributor

@dpieski dpieski commented Mar 27, 2026

Description

Adds three new API clients for USPTO Office Action data endpoints, each with full model, client, test, and documentation coverage:

  • OAActionsClient — Office Action Text Retrieval API (v1): full-text office action documents including body text and structured section data (§101/102/103/112 rejections, citations, etc.)
  • OARejectionsClient — Office Action Rejections API (v2): rejection-level records with rejection type indicators (hasRej101/102/103/112/DP), claim arrays, and examiner classification metadata
  • OACitationsClient — Office Action Citations API: enriched citation records from office actions including cited document identifiers, legal section codes, and examiner-cited indicators

All three are provided with convenience query parameters for common fields.

Type of Change

  • New feature (non-breaking change which adds functionality)
  • Documentation update

Testing

  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • I have tested this manually (if applicable)

912 unit tests passing, 100% coverage across all source files. Each new module includes unit tests for models, client, and integration tests (skipped by default; enabled via ENABLE_INTEGRATION_TESTS=true).

Checklist

  • My code follows the project's style guidelines
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • Any dependent changes have been merged and published

Related Issues

N/A

Additional Notes

Each client follows the established patterns from EnrichedCitationsClient. The base.py form-urlencoded branch in _get_model was extended to include all three new response types. Config and environment variable
support added for all three base URLs (USPTO_OA_ACTIONS_BASE_URL, USPTO_OA_REJECTIONS_BASE_URL, USPTO_OA_CITATIONS_BASE_URL).

Comment thread examples/oa_rejections_example.py Fixed
Comment thread examples/oa_actions_example.py Fixed
Comment thread examples/oa_citations_example.py Fixed
Comment thread examples/oa_rejections_example.py Fixed
This module contains comprehensive tests for all classes in pyUSPTO.models.oa_actions.
"""

from datetime import datetime, timezone

Check notice

Code scanning / CodeQL

Unused import Note test

Import of 'datetime' is not used.
Import of 'timezone' is not used.

Copilot Autofix

AI about 2 months ago

To fix an unused import, remove the unneeded names from the import statement so that only actually-used symbols are imported. This simplifies the code and removes an unnecessary dependency.

In this file (tests/models/test_oa_actions_models.py), the best fix is to delete the entire line from datetime import datetime, timezone at line 6, since neither datetime nor timezone appears in the provided tests. No additional methods, definitions, or replacement imports are needed. The neighboring imports (from typing import Any, import pytest, and the pyUSPTO.models.oa_actions imports) should remain untouched.

Suggested changeset 1
tests/models/test_oa_actions_models.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/tests/models/test_oa_actions_models.py b/tests/models/test_oa_actions_models.py
--- a/tests/models/test_oa_actions_models.py
+++ b/tests/models/test_oa_actions_models.py
@@ -3,7 +3,6 @@
 This module contains comprehensive tests for all classes in pyUSPTO.models.oa_actions.
 """
 
-from datetime import datetime, timezone
 from typing import Any
 
 import pytest
EOF
@@ -3,7 +3,6 @@
This module contains comprehensive tests for all classes in pyUSPTO.models.oa_actions.
"""

from datetime import datetime, timezone
from typing import Any

import pytest
Copilot is powered by AI and may make mistakes. Always verify output.
Comment thread tests/models/test_oa_citations_models.py Fixed
Comment thread examples/oa_actions_example.py Fixed
Comment thread examples/oa_citations_example.py Fixed
Comment thread examples/oa_rejections_example.py Fixed
This module contains comprehensive tests for all classes in pyUSPTO.models.oa_actions.
"""

from datetime import datetime, timezone
Comment thread tests/models/test_oa_citations_models.py Fixed
dpieski and others added 2 commits March 30, 2026 08:53
Refactor pagination loop and remove unused field retrieval example.
Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com>
@dpieski dpieski merged commit f70296e into main Mar 30, 2026
10 checks passed
@dpieski dpieski deleted the wip-oa-actions branch March 30, 2026 14:38
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.

2 participants