A Modern Python client for accessing United Stated Patent and Trademark Office (USPTO) Open Data Portal (ODP) APIs.
Project description
pyUSPTO
A Python client library for interacting with the United Stated Patent and Trademark Office (USPTO) Open Data Portal APIs.
This package provides clients for interacting with the USPTO Bulk Data API, the USPTO Patent Data API, and the USPTO Final Petition Decisions API.
[!IMPORTANT] The USPTO is in the process of moving their API. This package is only concerned with the new API. The old API will be retired at the end of 2025.
Quick Start
Installation
Requirements: Python ≥3.10
pip install pyUSPTO
Or install from source:
git clone https://github.com/DunlapCoddingPC/pyUSPTO.git
cd pyUSPTO
pip install -e .
Configuration Options
[!IMPORTANT] You must have an API key for the USPTO Open Data Portal API.
There are multiple ways to configure the USPTO API clients:
from pyUSPTO import PatentDataClient, FinalPetitionDecisionsClient
# Method 1: Direct API key initialization
patent_client = PatentDataClient(api_key="your_api_key_here")
petition_client = FinalPetitionDecisionsClient(api_key="your_api_key_here")
# Method 2: Using USPTOConfig with explicit parameters
from pyUSPTO.config import USPTOConfig
config = USPTOConfig(
api_key="your_api_key_here",
bulk_data_base_url="https://api.uspto.gov",
patent_data_base_url="https://api.uspto.gov",
petition_decisions_base_url="https://api.uspto.gov"
)
patent_client = PatentDataClient(config=config)
petition_client = FinalPetitionDecisionsClient(config=config)
# Method 3: Using environment variables (recommended for production)
import os
os.environ["USPTO_API_KEY"] = "your_api_key_here"
config_from_env = USPTOConfig.from_env()
patent_client = PatentDataClient(config=config_from_env)
petition_client = FinalPetitionDecisionsClient(config=config_from_env)
Patent Data API
# Search for applications by inventor name
inventor_search = patent_client.search_applications(inventor_name_q="Smith")
print(f"Found {inventor_search.count} applications with 'Smith' as inventor")
# > Found 104926 applications with 'Smith' as inventor.
Final Petition Decisions API
# Search for petition decisions by date range
decisions = petition_client.search_decisions(
decision_date_from_q="2023-01-01",
limit=10
)
print(f"Found {decisions.count} petition decisions since 2023")
# Get a specific decision by ID
decision = petition_client.get_decision_by_id("decision_id_here")
print(f"Decision Type: {decision.decision_type_code}")
print(f"Application: {decision.application_number_text}")
Features
- Access to USPTO Bulk Data API, Patent Data API, and Final Petition Decisions API
- Search for patent applications using various filters
- Search and retrieve petition decisions with detailed information
- Download files, documents, and petition decision documents from the APIs
- Pagination support for large result sets
- Full type annotations and comprehensive test coverage
Documentation
Full documentation may be found on Read the Docs.
Data Models
The library uses Python dataclasses to represent API responses. All data models include type annotations for attributes and methods, making them fully compatible with static type checkers.
Bulk Data API
BulkDataResponse: Top-level response from the APIBulkDataProduct: Information about a specific productProductFileBag: Container for file data elementsFileData: Information about an individual file
Patent Data API
PatentDataResponse: Top-level response from the APIPatentFileWrapper: Information about a patent applicationApplicationMetaData: Metadata about a patent applicationAddress: Represents an address in the patent dataPerson,Applicant,Inventor,Attorney: Person-related data classesAssignment,Assignor,Assignee: Assignment-related data classesContinuity,ParentContinuity,ChildContinuity: Continuity-related data classesPatentTermAdjustmentData: Patent term adjustment information- And many more specialized classes for different aspects of patent data
Final Petition Decisions API
PetitionDecisionResponse: Top-level response from the APIPetitionDecision: Complete information about a petition decisionPetitionDecisionDocument: Document associated with a petition decisionDocumentDownloadOption: Download options for petition documentsDecisionTypeCode: Enum for petition decision typesDocumentDirectionCategory: Enum for document direction categories
License
This project is licensed under the MIT License - see the LICENSE file for details.
Contributing
We welcome contributions! Please see CONTRIBUTING.md for guidelines on how to contribute to this project.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pyuspto-0.2.0.tar.gz.
File metadata
- Download URL: pyuspto-0.2.0.tar.gz
- Upload date:
- Size: 8.3 MB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2fdd97118e4df263e4e12ebe26675ca547ed4baae8a7378d72bddfb40b2560c9
|
|
| MD5 |
075e07ee19080747e69c788ee24a8093
|
|
| BLAKE2b-256 |
b900f28016e1ce9798ccb067b0406012701bb905492543db86d263e35bf16c80
|
Provenance
The following attestation bundles were made for pyuspto-0.2.0.tar.gz:
Publisher:
publish-to-test-pypi.yml on DunlapCoddingPC/pyUSPTO
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pyuspto-0.2.0.tar.gz -
Subject digest:
2fdd97118e4df263e4e12ebe26675ca547ed4baae8a7378d72bddfb40b2560c9 - Sigstore transparency entry: 683837216
- Sigstore integration time:
-
Permalink:
DunlapCoddingPC/pyUSPTO@1268129443938a612c8ecba8084297903ac9b351 -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/DunlapCoddingPC
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-to-test-pypi.yml@1268129443938a612c8ecba8084297903ac9b351 -
Trigger Event:
push
-
Statement type:
File details
Details for the file pyuspto-0.2.0-py3-none-any.whl.
File metadata
- Download URL: pyuspto-0.2.0-py3-none-any.whl
- Upload date:
- Size: 51.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f6ad347c2ec059fc16caa74f0e748ce2552c83fcf273b036eccb380a7df48eaf
|
|
| MD5 |
9d53677e2e5147d223addb3e5e95dd7e
|
|
| BLAKE2b-256 |
03de4406f8e39b5505f76959cdf0585e4ff54d7d6acbddbad97403dc41b0bd9e
|
Provenance
The following attestation bundles were made for pyuspto-0.2.0-py3-none-any.whl:
Publisher:
publish-to-test-pypi.yml on DunlapCoddingPC/pyUSPTO
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pyuspto-0.2.0-py3-none-any.whl -
Subject digest:
f6ad347c2ec059fc16caa74f0e748ce2552c83fcf273b036eccb380a7df48eaf - Sigstore transparency entry: 683837251
- Sigstore integration time:
-
Permalink:
DunlapCoddingPC/pyUSPTO@1268129443938a612c8ecba8084297903ac9b351 -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/DunlapCoddingPC
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-to-test-pypi.yml@1268129443938a612c8ecba8084297903ac9b351 -
Trigger Event:
push
-
Statement type: