Skip to main content

A Modern Python client for accessing United Stated Patent and Trademark Office (USPTO) Open Data Portal (ODP) APIs.

Project description

pyUSPTO

PyPI version License: MIT Python 3.10+ Read the Docs

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 API
  • BulkDataProduct: Information about a specific product
  • ProductFileBag: Container for file data elements
  • FileData: Information about an individual file

Patent Data API

  • PatentDataResponse: Top-level response from the API
  • PatentFileWrapper: Information about a patent application
  • ApplicationMetaData: Metadata about a patent application
  • Address: Represents an address in the patent data
  • Person, Applicant, Inventor, Attorney: Person-related data classes
  • Assignment, Assignor, Assignee: Assignment-related data classes
  • Continuity, ParentContinuity, ChildContinuity: Continuity-related data classes
  • PatentTermAdjustmentData: 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 API
  • PetitionDecision: Complete information about a petition decision
  • PetitionDecisionDocument: Document associated with a petition decision
  • DocumentDownloadOption: Download options for petition documents
  • DecisionTypeCode: Enum for petition decision types
  • DocumentDirectionCategory: 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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pyuspto-0.2.0.tar.gz (8.3 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pyuspto-0.2.0-py3-none-any.whl (51.9 kB view details)

Uploaded Python 3

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

Hashes for pyuspto-0.2.0.tar.gz
Algorithm Hash digest
SHA256 2fdd97118e4df263e4e12ebe26675ca547ed4baae8a7378d72bddfb40b2560c9
MD5 075e07ee19080747e69c788ee24a8093
BLAKE2b-256 b900f28016e1ce9798ccb067b0406012701bb905492543db86d263e35bf16c80

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyuspto-0.2.0.tar.gz:

Publisher: publish-to-test-pypi.yml on DunlapCoddingPC/pyUSPTO

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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

Hashes for pyuspto-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f6ad347c2ec059fc16caa74f0e748ce2552c83fcf273b036eccb380a7df48eaf
MD5 9d53677e2e5147d223addb3e5e95dd7e
BLAKE2b-256 03de4406f8e39b5505f76959cdf0585e4ff54d7d6acbddbad97403dc41b0bd9e

See more details on using hashes here.

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

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page