skillfed

postgrid-python

The official Python library for the PostGrid API

postgrid-python v2.3.0 249.8K downloads/30d#8,645 on PyPI11
Permissive license Apache-2.0 Active released

What it is and what it does

PostGrid Python is the official client library for accessing PostGrid's REST API from Python applications. It wraps the PostGrid print mail, address verification, and bulk verification services behind a typed, developer-friendly interface. The library provides both synchronous and asynchronous clients powered by httpx, with full type hints for request parameters and response objects using Pydantic models and TypedDicts.

The package is designed to handle common API patterns automatically: paginated list responses are wrapped in auto-iterating objects so you can loop through results without manually fetching pages, file uploads accept bytes or path-like objects, and errors are categorized into specific exception types (authentication, rate limit, connection, etc.) for granular error handling. It supports modern Python versions from 3.9 onward and includes optional aiohttp support for improved async concurrency.

Use it for:

  • Integrate print mail services into a Python application to create and manage postal contacts and letters programmatically.
  • Verify postal addresses in bulk or individually before sending physical mail to reduce delivery failures.
  • Build async-first applications that need to batch address verification requests without blocking.
  • Automate postal mail workflows with typed, IDE-assisted API calls and built-in pagination handling.
  • Handle API errors gracefully with specific exception types for rate limits, authentication, and connection issues.

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

Provides a typed Python client for the PostGrid REST API, supporting both synchronous and asynchronous access to print mail, address verification, and bulk verification services.

Yes. The package is actively maintained, has no known vulnerabilities, low install friction, and provides a well-typed interface to a specific service. Install it if you need to integrate PostGrid's print mail or address verification APIs into a Python application; skip it if you don't use PostGrid or prefer direct HTTP calls.

Install

postgrid-python on PyPI

pip

pip install postgrid-python

uv

uv add postgrid-python

poetry

poetry add postgrid-python

Installing postgrid-python

Before you install

Low install friction with a pure-Python wheel and six common dependencies. Active maintenance with a recent release 60 days ago and current commit activity.

License in practice

Apache-2.0 permissive license allows commercial and private use with minimal restrictions; suitable for most projects.

Quickstart

pip install postgrid-python

import os
from postgrid import PostGrid

client = PostGrid(print_mail_api_key=os.environ.get("POSTGRID_PRINT_MAIL_API_KEY"))
contact = client.print_mail.contacts.create(
    address_line1="addressLine1",
    country_code="countryCode",
    first_name="firstName",
)
print(contact.id)

Requires Python 3.9 or later and a valid PostGrid API key set via environment variable or constructor argument.

Verify before relying

  • Whether the library handles all PostGrid API endpoints or only a subset of the service.
  • Performance characteristics of auto-pagination and whether it suits high-volume list operations.
  • Specifics of retry behavior mentioned as '2 times' in the description excerpt.

Package facts

License Apache-2.0 (permissive)
Python support supports the current Python release (>=3.9)
Install friction low — pure-Python wheel
Runtime dependencies 6 — anyio, distro, httpx, pydantic, sniffio, typing-extensions
Maintenance actively maintained — 60 days since the last release
Last repo commit
First released
Downloads 249,796/month — #8,645 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: postgrid_python-2.3.0-py3-none-any.whl

Intended Audience :: DevelopersLicense :: OSI Approved :: Apache Software LicenseOperating System :: MacOSOperating System :: Microsoft :: WindowsOperating System :: OS IndependentOperating System :: POSIXOperating System :: POSIX :: LinuxProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Programming Language :: Python :: 3.9Topic :: Software Development :: Libraries :: Python ModulesTyping :: Typed

Tags

postgrid api client pythonprint mail api libraryaddress verification pythonasync http client wrapperrest api client generatortyped api bindingspostal service integration
rest-api-clientasync-supporttyped-bindings

More Python Modules packages