• Stars
    star
    134
  • Rank 270,967 (Top 6 %)
  • Language
    Python
  • License
    MIT License
  • Created almost 14 years ago
  • Updated about 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Standalone ISO 3166-1 country definitions

python-iso3166 - Standalone ISO 3166-1 country definitions

Authors: Mike Spindel
Version: 2.1.1

ISO 3166-1 defines two-letter, three-letter, and three-digit country codes. python-iso3166 is a self-contained module that converts between these codes and the corresponding country name.

Installation

$ pip install iso3166

Usage

Country details

>>> from iso3166 import countries
>>>
>>> countries.get('us')
Country(name='United States', alpha2='US', alpha3='USA', numeric='840')
>>> countries.get('ala')
Country(name='Ã…land Islands', alpha2='AX', alpha3='ALA', numeric='248')
>>> countries.get(8)
Country(name='Albania', alpha2='AL', alpha3='ALB', numeric='008')

Country lists and indexes

>>> from iso3166 import countries

>>> for c in countries:
       print(c)
>>> Country(name='Afghanistan', alpha2='AF', alpha3='AFG', numeric='004')
Country(name='Ã…land Islands', alpha2='AX', alpha3='ALA', numeric='248')
Country(name='Albania', alpha2='AL', alpha3='ALB', numeric='008')
Country(name='Algeria', alpha2='DZ', alpha3='DZA', numeric='012')
>>> import iso3166

>>> iso3166.countries_by_name
>>> {'AFGHANISTAN': Country(name='Afghanistan', alpha2='AF', alpha3='AFG', numeric='004'),
'ALBANIA': Country(name='Albania', alpha2='AL', alpha3='ALB', numeric='008'),
'ALGERIA': Country(name='Algeria', alpha2='DZ', alpha3='DZA', numeric='012'),
...

>>> iso3166.countries_by_numeric
>>> {'004': Country(name='Afghanistan', alpha2='AF', alpha3='AFG', numeric='004'),
'008': Country(name='Albania', alpha2='AL', alpha3='ALB', numeric='008'),
'010': Country(name='Antarctica', alpha2='AQ', alpha3='ATA', numeric='010'),
...

>>> iso3166.countries_by_alpha2
>>> {'AD': Country(name='Andorra', alpha2='AD', alpha3='AND', numeric='020'),
'AE': Country(name='United Arab Emirates', alpha2='AE', alpha3='ARE', numeric='784'),
'AF': Country(name='Afghanistan', alpha2='AF', alpha3='AFG', numeric='004'),
...

>>> iso3166.countries_by_alpha3
>>> {'ABW': Country(name='Aruba', alpha2='AW', alpha3='ABW', numeric='533'),
'AFG': Country(name='Afghanistan', alpha2='AF', alpha3='AFG', numeric='004'),
'AGO': Country(name='Angola', alpha2='AO', alpha3='AGO', numeric='024'),
...

More Repositories

1

idaenv

IDA Pro plugin manager
Python
18
star
2

hl-tags-mode

Emacs minor mode for highlighting HTML start and end tags
Emacs Lisp
13
star
3

palette

Easy color manipulation for Python
Python
12
star
4

python-snss

Python
12
star
5

Devonmacs

Integrate DevonThink with an Emacs-driven workflow
Python
8
star
6

video-snapshot

Chrome extension for taking full resolution screenshots of YouTube videos
JavaScript
7
star
7

dash-docsets

Assorted docsets for Dash
Shell
6
star
8

collectd-graphite

Send data from collectd to graphite
Python
6
star
9

idaenv-plugins

IDA plugins packaged for idaenv
Python
6
star
10

sql-smie-mode

Better indentation for sql-mode in Emacs
Emacs Lisp
4
star
11

collectd-write-zmq

a collectd plugin that writes data via zeromq
C
4
star
12

multi-mode

Personal branch of Dave Love's excellent multi-mode.el
Emacs Lisp
4
star
13

proxifier

Easily write application-specific HTTP proxies in Python
Python
4
star
14

python-alfred

Python library for Alfred 2 script filters
Python
2
star
15

deblur-quora

A Chrome extension for deblurring Quora answer pages
JavaScript
2
star
16

pinterest-og

Expose OpenGraph image tags to Pinterest
JavaScript
2
star
17

edit-thing-el

narrow-to-region on steroids
Emacs Lisp
1
star
18

ctypes-pdfkit

An experiment in accessing PDFKit via ctypes.
Python
1
star
19

python-gzlog

Binary safe log files in python with crude support for concurrent access and rotation
Python
1
star
20

devuart

A Python module to probe IOKit for serial devices.
Python
1
star
21

chromescript

Python
1
star
22

watch-sql

Python
1
star
23

dedent-el

Add and remove indentation during copy and paste operations in Emacs
Emacs Lisp
1
star
24

ksync

Sync the Kindle document directory layout with its collections table
Python
1
star
25

auto-pep8.el

Emacs Lisp
1
star
26

dfonts

Some classic screen fonts converted to Mac OS dfont format
1
star
27

ezsocksproxy

Tunnel EZProxy requests via SOCKS
Python
1
star
28

mdfind.el

A basic interface to Spotlight for Emacs.
Emacs Lisp
1
star
29

choosify-links

A Chrome userscript to open links via Choosy automatically
JavaScript
1
star