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 both the USPTO Bulk Data API and the USPTO Patent Data API. The client for the Final Petition Decisions API is currently being developed.

[!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

# Method 1: Direct API key initialization
client1 = PatentDataClient(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/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)
import os
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 patent applications using various filters
  • Download files and documents from the APIs

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

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.1.4.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.1.4-py3-none-any.whl (41.5 kB view details)

Uploaded Python 3

File details

Details for the file pyuspto-0.1.4.tar.gz.

File metadata

  • Download URL: pyuspto-0.1.4.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.1.4.tar.gz
Algorithm Hash digest
SHA256 ea62ea217d5107eced39aefbda25a0c0e616a280e453f1bbe743948266fa57df
MD5 e33b5eb7fad24d14bafab8d604184192
BLAKE2b-256 5f061f956932cb08b6ed0b15c78512b7cf1f55fa0c34a51ce12ef75662640222

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyuspto-0.1.4.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.1.4-py3-none-any.whl.

File metadata

  • Download URL: pyuspto-0.1.4-py3-none-any.whl
  • Upload date:
  • Size: 41.5 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.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 6e4cb9b1b74d4f2087e20aa934d3920bd9aeba6900a9f2628521747e76e9d769
MD5 16ee07476751869f3cfa080498bb7409
BLAKE2b-256 78fa49c6b3ccb976bff442ce462384ab11f5001fdbcf8fa4cd5e55aed3c9004d

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyuspto-0.1.4-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