Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Bug#1030572: ITP: python-countrynames -- Map country names to ISO codes

6 views
Skip to first unread message

Edward Betts

unread,
Feb 5, 2023, 4:50:04 AM2/5/23
to
Package: wnpp
Severity: wishlist
Owner: Edward Betts <edw...@4angle.com>
X-Debbugs-Cc: debian...@lists.debian.org, debian...@lists.debian.org

* Package name : python-countrynames
Version : 1.14.1
Upstream Author : Friedrich Lindenberg <frie...@pudo.org>
* URL : https://github.com/occrp/countrynames
* License : MIT
Programming Lang: Python
Description : Map country names to ISO codes

This library helps with the mapping of country names to their respective
two or three letter codes. The idea is to incorporate common names for
countries, and even some limited misspellings, as they occur in source data.
.
There is also support for fuzzy matching, which uses a heuristic based on
Levenshtein distance.

I plan to maintain this package as part of the Python team.

Stuart Prescott

unread,
Feb 5, 2023, 8:00:06 AM2/5/23
to

On 05/02/2023 20:46, Edward Betts wrote:
> * Package name : python-countrynames
> Version : 1.14.1
> Upstream Author : Friedrich Lindenberg <frie...@pudo.org>
> * URL : https://github.com/occrp/countrynames
> * License : MIT
> Programming Lang: Python
> Description : Map country names to ISO codes
>
> This library helps with the mapping of country names to their respective
> two or three letter codes. The idea is to incorporate common names for
> countries, and even some limited misspellings, as they occur in source data.
> .
> There is also support for fuzzy matching, which uses a heuristic based on
> Levenshtein distance.
>
> I plan to maintain this package as part of the Python team.

I wonder if this upstream and pycountry would be interested in
cooperating. Keeping multiple databases like these up to date is awkward.

https://github.com/flyingcircusio/pycountry

(pycountry uses Debian's iso-codes package for its data)

regards
Stuart

--
Stuart Prescott http://www.nanonanonano.net/ stu...@nanonanonano.net
Debian Developer http://www.debian.org/ stu...@debian.org
GPG fingerprint 90E2 D2C1 AD14 6A1B 7EBB 891D BBC1 7EBB 1396 F2F7

Edward Betts

unread,
Jun 12, 2023, 8:30:04 AM6/12/23
to
Stuart Prescott <stu...@debian.org> wrote:
> I wonder if this upstream and pycountry would be interested in cooperating.
> Keeping multiple databases like these up to date is awkward.
>
> https://github.com/flyingcircusio/pycountry
>
> (pycountry uses Debian's iso-codes package for its data)

Sorry for not replying sooner.

You make a good point, and is best if we can make packages like this
cooperate.

I don't think pycountry and countrynames are solving the same problem.

The countrynames module is used for normalising a place name into an ISO
country code. Here's an example, the entry for Northern Island.

GB-NIR:
- Northern Ireland
- N Irish
- Northern Irish
- North Ireland
- Ulsterman
- N.Ireland
- GBNIR
- Tuaisceart Éireann
- Norlin Airlann
- Antrim
- Armagh
- Belfast
- Down
- Fermanagh
- Londonderry
- Derry
- Tyrone
- Irlanda del Norte

The data in the iso-codes package includes some of these names, but not all of
them.

The rest of the data is here:

https://github.com/alephdata/countrynames/blob/master/countrynames/data.yaml
--
Edward
0 new messages