Python client for accessing USPTO OPD APIs
Project description
pyUSPTO
A Python client library for interacting with the USPTO APIs.
This package provides clients for interacting with both the USPTO Bulk Data API and the USPTO Patent Data API. It features comprehensive type hints and docstrings for improved developer experience.
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
There are multiple ways to configure the USPTO API clients:
from pyUSPTO import PatentDataClient
from pyUSPTO.config import USPTOConfig
import os
# Method 1: Direct API key initialization
client1 = PatentDataClient(api_key="your_api_key_here")
# Method 2: Using USPTOConfig with explicit parameters
config = USPTOConfig(
api_key="your_api_key_here",
bulk_data_base_url="https://api.uspto.gov/api/v1/datasets",
patent_data_base_url="https://api.uspto.gov/api/v1/patent"
)
client2 = PatentDataClient(config=config)
# Method 3: Using environment variables (recommended for production)
os.environ["USPTO_API_KEY"] = "your_api_key_here"
config_from_env = USPTOConfig.from_env()
client3 = PatentDataClient(config=config_from_env)
Patent Data API
# Search for applications by inventor name
inventor_search = client1.search_applications(inventor_name_q="Smith")
print(f"Found {inventor_search.count} applications with 'Smith' as inventor")
# > Found 104926 applications with 'Smith' as inventor.
Features
- Access to both USPTO Bulk Data API and Patent Data API
- Search for products and patents using various filters
- Download files and documents from the APIs
Data Models
The library uses Python dataclasses to represent API responses. All data models include proper 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
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.
For badges: You'll need to add these to the top of your README after the title:
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 Distributions
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.1.1-py3-none-any.whl.
File metadata
- Download URL: pyuspto-0.1.1-py3-none-any.whl
- Upload date:
- Size: 32.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bdbca12faac4aceaf92c4f237ea224bfb81c4e250aa760bc0a8e7e3848c40ea4
|
|
| MD5 |
7ee8a0c8567615c86bfc13bba1b9df10
|
|
| BLAKE2b-256 |
32982a57b07ed7eff9c2cbfd433bf10999ae86886f8435af79dbb41f948aaa7c
|
Provenance
The following attestation bundles were made for pyuspto-0.1.1-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.1.1-py3-none-any.whl -
Subject digest:
bdbca12faac4aceaf92c4f237ea224bfb81c4e250aa760bc0a8e7e3848c40ea4 - Sigstore transparency entry: 227673336
- Sigstore integration time:
-
Permalink:
DunlapCoddingPC/pyUSPTO@c018d4869d634a62a970cbdad1a64cbcb29a8451 -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/DunlapCoddingPC
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-to-test-pypi.yml@c018d4869d634a62a970cbdad1a64cbcb29a8451 -
Trigger Event:
push
-
Statement type: