[ANN] Snail, a plugin for international mailing addresses

Howdy –

I couldn’t find any existing libraries to help format international
mailing addresses. Turns out it’s rather tedious. Not only do
different countries have different names for the components of an
address, but many countries have different formats for the city line.
And then there’s Great Britain, er England, er … yeah.

So I’ve started work on a plugin called Snail. My dream is that it
will grow to encapsulate the rules of international address formatting
and basic validation. It’s just quite a lot for any one person.

The first release is up on GitHub at GitHub - cainlevy/snail: A Ruby gem to assist with collecting and formatting international addresses.
If your application has anything to do with addresses, and you think
it may need to go international, I hope you’ll check it out!

-Lance

Lance,

I commend you on taking this on. This has been a huge pet peeve of
mine over the years, and only very expensive commercial solutions were
available to even do a fraction of the things necessary to manage
mailing addresses.

Have you thought about also creating parsers to help identify what the
address is, and which formatter to use? (like, identify which state/
province and country, then determine the rules around parsing and
formatting)

Also, I find that I often work with addresses that were inputted in
odd ways, and requires me to “scrub” them a lot. There are very
expensive commercial solutions for this, but no good open source
solutions, and especially no Ruby ones. Thought about putting in some
basic scrubbing rules as well (and possibly address verification
services)?

I’ll keep an eye on Snail, and help where I can.

-Kevin

Thanks Kevin! Looking forward to the assistance. :slight_smile:

I haven’t thought about scrubbers and parsers. Sounds like a good fit,
but
I’m not in a position to really know the best approach, nor do I have an
application requiring them that I could use for real-world test data.

My first priority with Snail is to make it easy for people to improve
the
areas that are most important to them. Right now I have a fixed
origination
country (USA) and no validation rules. I think the next step is to
sketch
out the validation system and make the origination country configurable,
even if it still only supports USA. From there I hope that people will
find
it easy to add rules for the countries they know best.

-Lance

On Wed, Jul 15, 2009 at 6:17 PM, Kevin E. [email protected] wrote:

province and country, then determine the rules around parsing and

different countries have different names for the components of an

-Lance


rails blog: http://codelevy.com

Lance wrote:

Howdy –

I couldn’t find any existing libraries to help format international
mailing addresses.
[…]
So I’ve started work on a plugin called Snail. My dream is that it
will grow to encapsulate the rules of international address formatting
and basic validation. It’s just quite a lot for any one person.

This sounds great. I’m currently considering what I need to do to
Quorum ( http://quorum2.sourceforge.net ) to handle international
addresses decently, and Snail may well play a role in that. In any
case, I’ll have a closer look at Snail, and perhaps find someplace that
I can contribute…

Best,

Marnen Laibow-Koser
http://www.marnen.org
[email protected]