random-address
Retrieve real random US addresses, with coordinates, for tests and fixtures
What it is and what it does
Random-address retrieves real US addresses from the OpenAddresses public dataset, which aggregates address data published by government agencies. Each address includes latitude and longitude coordinates that resolve to actual map points without requiring a geocoding API call. The package is built specifically for testing: seeding test fixtures, exercising address form validation, and providing geolocation code with genuine data to work against.
The package offers both single and batch address retrieval with optional filtering by state, city, or postal code. Addresses can be made reproducible via a seed parameter, and the package provides inspection functions to explore what states, cities, and postal codes are available in the dataset. It includes both a Python API and a command-line interface for generating addresses in plain text, JSON, or CSV format.
Use it for:
- Seed test fixtures with real addresses to validate address form parsing and storage logic.
- Test geolocation and mapping code with genuine coordinates without hitting external geocoding services.
- Generate CSV files of test addresses for bulk testing address validation across multiple states.
- Reproduce test scenarios consistently by passing a seed to get the same address every time.
- Validate address filtering logic by narrowing results to specific states, cities, or postal codes.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Generates random real US addresses with coordinates from authoritative government sources, designed for testing address forms, geolocation code, and test fixtures.
Yes. The package solves a genuine testing need with zero dependencies, active maintenance, and a permissive MIT license. It is lightweight to install and use, requires only Python 3.10+, and has no known vulnerabilities. Install it if you need real address data for testing without external API calls.
Install
random-address on PyPI
pip
pip install random-addressuv
uv add random-addresspoetry
poetry add random-addressInstalling random-address
Before you install
Low friction installation with no runtime dependencies. Actively maintained with a recent release; supports current Python versions (3.10+).
License in practice
MIT license permits unrestricted use, modification, and distribution in both open and proprietary projects with minimal restrictions.
Quickstart
pip install random-address
from random_address import real_random_address
addr = real_random_address(state='CA')
print(addr['address1'], addr['city'], addr['postal_code'])
Requires Python 3.10 or newer.
Verify before relying
- Whether the dataset of 3300 addresses is sufficient for large-scale testing scenarios.
- Performance characteristics when filtering by state, city, or postal code with large result sets.
Package facts
| License | MIT (permissive) |
| Python support | supports the current Python release (>=3.10) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | none |
| Maintenance | actively maintained — 32 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 92,858/month — #13,418 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: random_address-2.1.0-py3-none-any.whl
Keywords: address, random, fake-data, test-data, fixtures, geocoding, openaddresses
Tags
More Python Modules packages
Converts domain names between Unicode and…
permissive · top 100 on PyPI
setuptoolsSetuptools is a Python build backend and…
permissive · top 100 on PyPI
PyYAMLPyYAML parses and emits YAML 1.1 data format,…
permissive · top 100 on PyPI
pydanticPydantic validates Python data structures…
permissive · top 100 on PyPI
annotated-typesProvides reusable metadata objects for use with…
permissive · top 100 on PyPI
typing-inspectionProvides runtime tools to inspect and…
permissive · top 100 on PyPI
pytest-rngProvides pytest fixtures that make random…
permissive · top 15,000 on PyPI
google-i18n-addressValidates, normalizes, and formats postal…
permissive · top 15,000 on PyPI
randmacGenerates random 12-digit MAC addresses in…
permissive · top 15,000 on PyPI
usaddress-scourgifyCleans and normalizes US addresses to USPS and…
unclear · top 5,000 on PyPI
reverse-geocodeReverse Geocode converts latitude/longitude…
copyleft · top 15,000 on PyPI
reverse_geocoderReverse Geocoder converts latitude/longitude…
copyleft · top 15,000 on PyPI
usaddressusaddress parses unstructured US address…
permissive · top 5,000 on PyPI
pytest-randomlyA pytest plugin that randomly shuffles test…
permissive · top 5,000 on PyPI
pgeocodepgeocode queries postal codes to retrieve GPS…
permissive · top 5,000 on PyPI
rstrGenerates random strings from custom alphabets,…
permissive · top 5,000 on PyPI