Skip to main content

A library for normalizing US addresses.

Project description

normalizer_usps

normalizer_usps is a Python library for normalizing US addresses by abbreviating street types and secondary address designations according to USPS standards.

Features

  • Street Type Abbreviation: Converts street types like "Street" to "ST", "Avenue" to "AVE", etc.
  • Secondary Address Abbreviation: Abbreviates secondary address units like "Apartment" to "APT", "Suite" to "STE".
  • Easy Integration: Designed to work seamlessly with Pandas Series for batch processing.

Installation

Install the package using pip:

pip install normalizer_usps

Usage

import pandas as pd from normalizer_usps.normalizer import abbreviate_address_series, street_type_abbreviations, secondary_address_abbreviations

Sample address data

addresses = pd.Series([ '123 Happy Street', '456 Elm Avenue', '789 Oak Boulevard', '101 Maple Apartment' ])

Normalize street types

normalized_addresses = abbreviate_address_series(addresses, street_type_abbreviations) print(normalized_addresses)

Normalize secondary address units

normalized_addresses = abbreviate_address_series(addresses, secondary_address_abbreviations) print(normalized_addresses)

0     123 Happy ST
1       456 Elm AVE
2    789 Oak BLVD
3    101 Maple Apartment
dtype: object

0     123 Happy Street
1       456 Elm Avenue
2    789 Oak Boulevard
3        101 Maple APT
dtype: object

Data Files

The package includes two JSON files containing abbreviation mappings:

street_type_abbreviations.json secondary_address_abbreviations.json Contributing Contributions are welcome! Please open an issue or submit a pull request on GitHub.

License

This project is licensed under the MIT License. See the LICENSE file for details.

Author

Larissa larissabeatrizlima@outlook.com

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

normalizer_usps-0.1.0.tar.gz (4.8 kB view details)

Uploaded Source

Built Distribution

normalizer_usps-0.1.0-py3-none-any.whl (5.6 kB view details)

Uploaded Python 3

File details

Details for the file normalizer_usps-0.1.0.tar.gz.

File metadata

  • Download URL: normalizer_usps-0.1.0.tar.gz
  • Upload date:
  • Size: 4.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.11.4

File hashes

Hashes for normalizer_usps-0.1.0.tar.gz
Algorithm Hash digest
SHA256 f3868c8aa971e5c48c62f68647226f7c2e0cf3de2ee9e666268a87125a1e7bc9
MD5 ee68863540c9ba761cb44039a535f664
BLAKE2b-256 e9987d3208dee6de39832306c85023b73fa70683aafb18ba1fc2ef54b1919ecf

See more details on using hashes here.

File details

Details for the file normalizer_usps-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for normalizer_usps-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 52692fdd74e6283b23681a5a043a3b237cb3d41291542c9d4162f8856ef51654
MD5 cdacbb7f7e70ebbde00bbd140c78410b
BLAKE2b-256 1e09fc600b96f2e2fe75ad51cbaedcacdf41e2d6b45c425d83ddc7af1a6ccef1

See more details on using hashes here.

Supported by

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