Registry / communication / postgrid-python

postgrid-python

JSON →
library2.3.0pypypi✓ verified 85d ago

The official Python library for the PostGrid API. Provides convenient access to the PostGrid print-and-mail and address verification APIs. Current version 2.1.1, actively maintained with monthly releases.

pip install postgrid-python
INSTALL
IMPORT
SIG · POSTGRID-PYTHON
P
postgrid-python
communicationpythonv2.3.0
Install
4.4s avg
Import
—
Disk
34MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.9–3.13
musl
3.9–3.13
Install & Compatibility
Where this runs
tested against v2.3.0 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.10–3.95 runs
installs and imports cleanly · install 0.0s · import 0.000s · 36.1MB
glibc
py 3.10–3.95 runs
installs and imports cleanly · install 4.4s · import 0.000s · 36MB
34MB installed
● package 34MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

Client
✓ from postgrid import Client
✗ from postgrid import PostGridClient
AsyncClient
✓ from postgrid import AsyncClient
AsyncPostGrid
✓ from postgrid import AsyncPostGrid

Verify an address using the PostGrid API with environment variable for API key.

import os from postgrid import PostGridClient client = PostGridClient(api_key=os.environ.get('POSTGRID_API_KEY', '')) # Verify an address try: result = client.addresses.verify( firstLine='123 Main St', city='New York', provinceOrState='NY', zipOrPostalCode='10001', country='US' ) print(result.to_dict()) except Exception as e: print(f'Error: {e}')
Debug
Known issues
breakingIn v2.0.0, the entire API surface was redesigned. v1.x had different resource names and method signatures.
fix
Upgrade to v2.0.0+ and refactor to use the new client pattern. See migration guide at https://github.com/postgrid/postgrid-python/releases/tag/v2.0.0
affects: <2.0.0
gotchaAPI keys are passed to the client as `api_key` parameter, not `key` or `apikey`.
fix
Use `PostGridClient(api_key='...')` or set `POSTGRID_API_KEY` environment variable.
affects: >=2.0.0
deprecatedThe `letter.create()` method's `merge_variables` parameter is deprecated in favor of `to` block fields.
fix
Pass merge variables directly inside the `to` address dictionary (e.g., `to={'firstLine': '...', 'mergeVariables': {...}}`)
affects: >=2.0.0
gotchaAddress verification returns 422 if the address is invalid, not 404. Some users expect a 404.
fix
Handle `postgrid.errors.PostGridError` with status 422, not 404.
affects: >=2.0.0
Upgrade
Version history
2.3.0latest on PyPI · released Jun 15, 2026
Audit
Dependencies

No dependency data recorded yet.

Agent activity
27 hits · last 30 days
node
24
OpenAI (training)
1
Resources
postgrid-python — pip install postgrid-python · libregistry