From d4d09b56b6e7c5cc51b681eb8d8a35dab661ae36 Mon Sep 17 00:00:00 2001 From: j <0x006A@0x2620.org> Date: Tue, 30 Sep 2014 21:04:46 +0200 Subject: [PATCH] use six to support python 2 and 3 --- ox/__init__.py | 44 +- ox/api.py | 14 +- ox/cache.py | 61 +- ox/file.py | 18 +- ox/fixunicode.py | 54 +- ox/form.py | 21 +- ox/format.py | 8 +- ox/geo.py | 2957 ++++++++++++++++++++------------------- ox/html.py | 16 +- ox/jsonc.py | 8 +- ox/movie.py | 6 +- ox/net.py | 53 +- ox/oembed.py | 7 +- ox/srt.py | 4 +- ox/torrent/__init__.py | 7 +- ox/web/__init__.py | 10 +- ox/web/allmovie.py | 1 - ox/web/amazon.py | 2 +- ox/web/arsenalberlin.py | 7 +- ox/web/criterion.py | 2 +- ox/web/dailymotion.py | 2 +- ox/web/duckduckgo.py | 8 +- ox/web/google.py | 6 +- ox/web/imdb.py | 58 +- ox/web/piratecinema.py | 4 +- ox/web/siteparser.py | 14 +- ox/web/wikipedia.py | 11 +- setup.py | 5 +- 28 files changed, 1730 insertions(+), 1678 deletions(-) diff --git a/ox/__init__.py b/ox/__init__.py index c767960..18a2a91 100644 --- a/ox/__init__.py +++ b/ox/__init__.py @@ -3,28 +3,32 @@ # GPL 2011 __version__ = '2.1.1' -import cache -import js -import jsonc -import net -import srt -import utils +from . import cache +from . import js +from . import jsonc +from . import net +from . import srt +from . import utils -from api import * -from file import * -from form import * -from format import * -from geo import * -from html import * +from .api import * +from .file import * +from .form import * +from .format import * +from .geo import * +from .html import * #image depends on PIL, not easy enough to instal on osx try: - from image import * + from .image import * except: pass -from location import * -from movie import * -from normalize import * -from oembed import * -from text import * -from torrent import * -from fixunicode import * +from .location import * +from .movie import * +from .normalize import * +from .oembed import * +from .text import * +#currently broken in python3 +try: + from .torrent import * +except: + pass +from .fixunicode import * diff --git a/ox/api.py b/ox/api.py index 5447b42..2f6d3e5 100644 --- a/ox/api.py +++ b/ox/api.py @@ -3,10 +3,10 @@ # GPL 2011 from __future__ import with_statement -import cookielib +from six.moves import http_cookiejar as cookielib import gzip -import StringIO -import urllib2 +from six import StringIO +from six.moves import urllib from types import MethodType from . import __version__ @@ -29,8 +29,8 @@ class API(object): self._cj = cj else: self._cj = cookielib.CookieJar() - self._opener = urllib2.build_opener(urllib2.HTTPCookieProcessor(self._cj), - urllib2.HTTPHandler(debuglevel=self.debuglevel)) + self._opener = urllib.request.build_opener(urllib.request.HTTPCookieProcessor(self._cj), + urllib.HTTPHandler(debuglevel=self.debuglevel)) self._opener.addheaders = [ ('User-Agent', '%s/%s' % (self.__name__, self.__version__)) ] @@ -64,7 +64,7 @@ class API(object): result = {} try: body = str(form) - request = urllib2.Request(str(url)) + request = urllib.reuqest.Request(str(url)) request.add_header('Content-type', form.get_content_type()) request.add_header('Content-Length', str(len(body))) request.add_header('Accept-Encoding', 'gzip, deflate') @@ -75,7 +75,7 @@ class API(object): result = gzip.GzipFile(fileobj=StringIO.StringIO(result)).read() result = result.decode('utf-8') return json.loads(result) - except urllib2.HTTPError, e: + except urllib.error.HTTPError as e: if self.DEBUG: import webbrowser if e.code >= 500: diff --git a/ox/cache.py b/ox/cache.py index 6186326..5b92452 100644 --- a/ox/cache.py +++ b/ox/cache.py @@ -1,24 +1,22 @@ # -*- coding: utf-8 -*- # vi:si:et:sw=4:sts=4:ts=4 # GPL 2011 -from __future__ import with_statement +from __future__ import with_statement, print_function import gzip import zlib import hashlib import os -import StringIO +from six import BytesIO import time -import urlparse -import urllib2 +from six.moves import urllib import sqlite3 -import chardet -from utils import json +from .utils import json from .file import makedirs -import net -from net import DEFAULT_HEADERS, detect_encoding +from . import net +from .net import DEFAULT_HEADERS, detect_encoding cache_timeout = 30*24*60*60 # default is 30 days @@ -69,7 +67,7 @@ class InvalidResult(Exception): self.headers = headers def _fix_unicode_url(url): - if isinstance(url, unicode): + if not isinstance(url, bytes): url = url.encode('utf-8') return url @@ -83,25 +81,31 @@ def read_url(url, data=None, headers=DEFAULT_HEADERS, timeout=cache_timeout, val if this function fails, InvalidResult will be raised deal with it in your code ''' if net.DEBUG: - print 'ox.cache.read_url', url + print('ox.cache.read_url', url) #FIXME: send last-modified / etag from cache and only update if needed - url = _fix_unicode_url(url) + #url = _fix_unicode_url(url) result = store.get(url, data, headers, timeout) + url_headers = {} if not result: try: url_headers, result = net.read_url(url, data, headers, return_headers=True) - except urllib2.HTTPError, e: + except urllib.error.HTTPError as e: e.headers['Status'] = "%s" % e.code - url_headers = dict(e.headers) + for key in e.headers: + url_headers[key.lower()] = e.headers[key] result = e.read() if url_headers.get('content-encoding', None) == 'gzip': - result = gzip.GzipFile(fileobj=StringIO.StringIO(result)).read() + result = gzip.GzipFile(fileobj=BytesIO(result)).read() if not valid or valid(result, url_headers): store.set(url, post_data=data, data=result, headers=url_headers) else: raise InvalidResult(result, url_headers) if unicode: - encoding = detect_encoding(result) + ctype = url_headers.get('content-type', '').lower() + if 'charset' in ctype: + encoding = ctype.split('charset=')[-1] + else: + encoding = detect_encoding(result) if not encoding: encoding = 'latin-1' result = result.decode(encoding) @@ -143,9 +147,8 @@ class SQLiteCache(Cache): self.create() def connect(self): - conn = sqlite3.connect(self.db, timeout=10) - conn.text_factory = str - return conn + self.conn = sqlite3.connect(self.db, timeout=10) + return self.conn def create(self): conn = self.connect() @@ -177,9 +180,9 @@ class SQLiteCache(Cache): if timeout == 0: return r if data: - url_hash = hashlib.sha1(url + '?' + data).hexdigest() + url_hash = hashlib.sha1((url + '?' + data).encode('utf-8')).hexdigest() else: - url_hash = hashlib.sha1(url).hexdigest() + url_hash = hashlib.sha1(url.encode('utf-8')).hexdigest() conn = self.connect() c = conn.cursor() @@ -210,11 +213,11 @@ class SQLiteCache(Cache): def set(self, url, post_data, data, headers): if post_data: - url_hash = hashlib.sha1(url + '?' + post_data).hexdigest() + url_hash = hashlib.sha1((url + '?' + post_data).encode('utf-8')).hexdigest() else: - url_hash = hashlib.sha1(url).hexdigest() + url_hash = hashlib.sha1(url.encode('utf-8')).hexdigest() - domain = ".".join(urlparse.urlparse(url)[1].split('.')[-2:]) + domain = ".".join(urllib.parse.urlparse(url)[1].split('.')[-2:]) conn = self.connect() c = conn.cursor() @@ -266,11 +269,11 @@ class FileCache(Cache): return r if data: - url_hash = hashlib.sha1(url + '?' + data).hexdigest() + url_hash = hashlib.sha1((url + '?' + data).encode('utf-8')).hexdigest() else: - url_hash = hashlib.sha1(url).hexdigest() + url_hash = hashlib.sha1(url.encode('utf-8')).hexdigest() - domain = ".".join(urlparse.urlparse(url)[1].split('.')[-2:]) + domain = ".".join(urllib.parse.urlparse(url)[1].split('.')[-2:]) prefix, i, f = self.files(domain, url_hash) if os.path.exists(i): with open(i) as _i: @@ -295,11 +298,11 @@ class FileCache(Cache): def set(self, url, post_data, data, headers): if post_data: - url_hash = hashlib.sha1(url + '?' + post_data).hexdigest() + url_hash = hashlib.sha1((url + '?' + post_data).encode('utf-8')).hexdigest() else: - url_hash = hashlib.sha1(url).hexdigest() + url_hash = hashlib.sha1(url.encode('utf-8')).hexdigest() - domain = ".".join(urlparse.urlparse(url)[1].split('.')[-2:]) + domain = ".".join(urllib.parse.urlparse(url)[1].split('.')[-2:]) prefix, i, f = self.files(domain, url_hash) makedirs(prefix) diff --git a/ox/file.py b/ox/file.py index 353b652..2a562b6 100644 --- a/ox/file.py +++ b/ox/file.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- # vi:si:et:sw=4:sts=4:ts=4 # GPL 2008 -from __future__ import division, with_statement +from __future__ import division, with_statement, print_function import os import hashlib import re @@ -10,7 +10,7 @@ import struct import subprocess import sqlite3 -from ox.utils import json +from .utils import json __all__ = ['sha1sum', 'oshash', 'avinfo', 'makedirs'] @@ -283,19 +283,19 @@ def makedirs(path): if not os.path.exists(path): try: os.makedirs(path) - except OSError, e: + except OSError as e: if e.errno != 17: raise def copy_file(source, target, verbose=False): if verbose: - print 'copying', source, 'to', target + print('copying', source, 'to', target) write_path(target) shutil.copyfile(source, target) def read_file(file, verbose=False): if verbose: - print 'reading', file + print('reading', file) f = open(file) data = f.read() f.close() @@ -303,14 +303,14 @@ def read_file(file, verbose=False): def read_json(file, verbose=False): if verbose: - print 'reading', file + print('reading', file) with open(file) as fd: data = json.load(fd) return data def write_file(file, data, verbose=False): if verbose: - print 'writing', file + print('writing', file) write_path(file) f = open(file, 'w') f.write(data) @@ -319,7 +319,7 @@ def write_file(file, data, verbose=False): def write_image(file, image, verbose=False): if verbose: - print 'writing', file + print('writing', file) write_path(file) image.save(file) @@ -329,7 +329,7 @@ def write_json(file, data, ensure_ascii=True, indent=0, sort_keys=False, verbose def write_link(source, target, verbose=False): if verbose: - print 'linking', source, 'to', target + print('linking', source, 'to', target) write_path(target) if os.path.exists(target): os.unlink(target) diff --git a/ox/fixunicode.py b/ox/fixunicode.py index 332684b..3d8d1e8 100644 --- a/ox/fixunicode.py +++ b/ox/fixunicode.py @@ -2,13 +2,16 @@ # -*- coding: utf-8 -*- # from http://blog.lumino.so/2012/08/20/fix-unicode-mistakes-with-python/ # MIT +from __future__ import print_function import unicodedata +from six import unichr + __all__ = ['fix_bad_unicode'] def fix_bad_unicode(text): - u""" + """ Something you will find all over the place, in real-world text, is text that's mistakenly encoded as utf-8, decoded in some ugly format like latin-1 or even Windows codepage 1252, and encoded as utf-8 again. @@ -26,52 +29,53 @@ def fix_bad_unicode(text): auto-decode bytes for you -- then it would just create the problems it's supposed to fix. - >>> print fix_bad_unicode(u'único') - único + >>> fix_bad_unicode(u'único') + 'único' + + >>> fix_bad_unicode('This text is fine already :þ') + 'This text is fine already :þ' - >>> print fix_bad_unicode(u'This text is fine already :þ') - This text is fine already :þ Because these characters often come from Microsoft products, we allow for the possibility that we get not just Unicode characters 128-255, but also Windows's conflicting idea of what characters 128-160 are. - >>> print fix_bad_unicode(u'This — should be an em dash') - This — should be an em dash + >>> fix_bad_unicode('This — should be an em dash') + 'This — should be an em dash' We might have to deal with both Windows characters and raw control characters at the same time, especially when dealing with characters like \x81 that have no mapping in Windows. - >>> print fix_bad_unicode(u'This text is sad .â\x81”.') - This text is sad .⁔. + >>> fix_bad_unicode('This text is sad .â\x81”.') + 'This text is sad .⁔.' This function even fixes multiple levels of badness: - >>> wtf = u'\xc3\xa0\xc2\xb2\xc2\xa0_\xc3\xa0\xc2\xb2\xc2\xa0' - >>> print fix_bad_unicode(wtf) - ಠ_ಠ + >>> wtf = '\xc3\xa0\xc2\xb2\xc2\xa0_\xc3\xa0\xc2\xb2\xc2\xa0' + >>> fix_bad_unicode(wtf) + 'ಠ_ಠ' However, it has safeguards against fixing sequences of letters and punctuation that can occur in valid text: - >>> print fix_bad_unicode(u'not such a fan of Charlotte Brontë…”') - not such a fan of Charlotte Brontë…” + >>> fix_bad_unicode('not such a fan of Charlotte Brontë…”') + 'not such a fan of Charlotte Brontë…”' Cases of genuine ambiguity can sometimes be addressed by finding other characters that are not double-encoding, and expecting the encoding to be consistent: - >>> print fix_bad_unicode(u'AHÅ™, the new sofa from IKEA®') - AHÅ™, the new sofa from IKEA® + >>> fix_bad_unicode('AHÅ™, the new sofa from IKEA®') + 'AHÅ™, the new sofa from IKEA®' Finally, we handle the case where the text is in a single-byte encoding that was intended as Windows-1252 all along but read as Latin-1: - >>> print fix_bad_unicode(u'This text was never Unicode at all\x85') - This text was never Unicode at all… + >>> fix_bad_unicode('This text was never Unicode at all\x85') + 'This text was never Unicode at all…' """ - if not isinstance(text, unicode): + if not isinstance(text, str): raise TypeError("This isn't even decoded into Unicode yet. " "Decode it first.") if len(text) == 0: @@ -118,7 +122,7 @@ def reinterpret_windows1252_as_utf8(wrongtext): altered_bytes.append(char.encode('WINDOWS_1252')) else: altered_bytes.append(char.encode('latin-1', 'replace')) - return ''.join(altered_bytes).decode('utf-8', 'replace') + return b''.join(altered_bytes).decode('utf-8', 'replace') def reinterpret_latin1_as_windows1252(wrongtext): @@ -130,7 +134,7 @@ def reinterpret_latin1_as_windows1252(wrongtext): def text_badness(text): - u''' + ''' Look for red flags that text is encoded incorrectly: Obvious problems: @@ -147,12 +151,12 @@ def text_badness(text): - Improbable single-byte characters, such as ƒ or ¬ - Letters in somewhat rare scripts ''' - assert isinstance(text, unicode) + assert isinstance(text, str) errors = 0 very_weird_things = 0 weird_things = 0 prev_letter_script = None - for pos in xrange(len(text)): + for pos in range(len(text)): char = text[pos] index = ord(char) if index < 256: @@ -241,7 +245,7 @@ WINDOWS_1252_GREMLINS = [ ] # a list of Unicode characters that might appear in Windows-1252 text -WINDOWS_1252_CODEPOINTS = range(256) + WINDOWS_1252_GREMLINS +WINDOWS_1252_CODEPOINTS = list(range(256)) + WINDOWS_1252_GREMLINS # Rank the characters typically represented by a single byte -- that is, in # Latin-1 or Windows-1252 -- by how weird it would be to see them in running @@ -286,7 +290,7 @@ SINGLE_BYTE_WEIRDNESS = ( # letters. We'll need it often. SINGLE_BYTE_LETTERS = [ unicodedata.category(unichr(i)).startswith('L') - for i in xrange(256) + for i in range(256) ] # A table telling us how to interpret the first word of a letter's Unicode diff --git a/ox/form.py b/ox/form.py index 8c51fc3..10d17ab 100644 --- a/ox/form.py +++ b/ox/form.py @@ -1,17 +1,34 @@ +# -*- coding: utf-8 -*- +# vi:si:et:sw=4:sts=4:ts=4 +# GPL 2014 +from __future__ import with_statement, print_function + import itertools -import mimetools import mimetypes +import random +import sys __all__ = ['MultiPartForm'] +# from /usr/lib/python3.4/email/generator.py +# Helper used by Generator._make_boundary +_width = len(repr(sys.maxsize-1)) +_fmt = '%%0%dd' % _width + +def _make_boundary(): + # Craft a random boundary. + token = random.randrange(sys.maxsize) + boundary = ('=' * 15) + (_fmt % token) + '==' + return boundary + class MultiPartForm(object): """Accumulate the data to be used when posting a form.""" def __init__(self): self.form_fields = [] self.files = [] - self.boundary = mimetools.choose_boundary() + self.boundary = _make_boundary() return def get_content_type(self): diff --git a/ox/format.py b/ox/format.py index 784557b..a06c311 100644 --- a/ox/format.py +++ b/ox/format.py @@ -20,7 +20,7 @@ def toAZ(num): >>> toAZ(1234567890) 'CYWOQVJ' """ - if num < 1: raise ValueError, "must supply a positive integer" + if num < 1: raise ValueError("must supply a positive integer") digits = string.ascii_uppercase az = '' while num != 0: @@ -62,7 +62,7 @@ def to26(q): >>> to26(347485647) 'BDGKMAP' """ - if q < 0: raise ValueError, "must supply a positive integer" + if q < 0: raise ValueError("must supply a positive integer") base26 = string.ascii_uppercase converted = [] while q != 0: @@ -119,7 +119,7 @@ def to32(q): ValueError: must supply a positive integer """ - if q < 0: raise ValueError, "must supply a positive integer" + if q < 0: raise ValueError("must supply a positive integer") letters = "0123456789ABCDEFGHJKMNPQRSTVWXYZ" converted = [] while q != 0: @@ -206,7 +206,7 @@ def to36(q): ... ValueError: must supply a positive integer """ - if q < 0: raise ValueError, "must supply a positive integer" + if q < 0: raise ValueError("must supply a positive integer") letters = "0123456789abcdefghijklmnopqrstuvwxyz" converted = [] while q != 0: diff --git a/ox/geo.py b/ox/geo.py index b952dd0..56733f6 100644 --- a/ox/geo.py +++ b/ox/geo.py @@ -1,6 +1,7 @@ # -*- coding: utf-8 -*- # vi:si:et:sw=4:sts=4:ts=4 # GPL 2008 +from __future__ import with_statement, print_function import math @@ -41,1852 +42,1852 @@ def update_countries(): with open('ox/geo.py', 'w') as f: f.write(pydata) - print 'ox/geo.py updated' + print('ox/geo.py updated') COUNTRIES = { - "GE-AB": { - "region": "Western Asia", - "name": "Abkhazia", - "continent": "Asia" + u"GE-AB": { + u"region": u"Western Asia", + u"name": u"Abkhazia", + u"continent": u"Asia" }, - "CW": { - "region": "Caribbean", - "name": "Curaçao", - "continent": "South America" + u"CW": { + u"region": u"Caribbean", + u"name": u"Curaçao", + u"continent": u"South America" }, - "GW": { - "region": "Western Africa", - "name": "Guinea-Bissau", - "continent": "Africa" + u"GW": { + u"region": u"Western Africa", + u"name": u"Guinea-Bissau", + u"continent": u"Africa" }, - "GU": { - "region": "Micronesia", - "name": "Guam", - "continent": "Oceania" + u"GU": { + u"region": u"Micronesia", + u"name": u"Guam", + u"continent": u"Oceania" }, - "GT": { - "region": "Central America", - "name": "Guatemala", - "continent": "South America" + u"GT": { + u"region": u"Central America", + u"name": u"Guatemala", + u"continent": u"South America" }, - "GS": { - "region": "Antarctica", - "name": "South Georgia and the South Sandwich Islands", - "continent": "Antarctica" + u"GS": { + u"region": u"Antarctica", + u"name": u"South Georgia and the South Sandwich Islands", + u"continent": u"Antarctica" }, - "GR": { - "region": "Southern Europe", - "name": "Greece", - "continent": "Europe" + u"GR": { + u"region": u"Southern Europe", + u"name": u"Greece", + u"continent": u"Europe" }, - "GQ": { - "region": "Middle Africa", - "name": "Equatorial Guinea", - "continent": "Africa" + u"GQ": { + u"region": u"Middle Africa", + u"name": u"Equatorial Guinea", + u"continent": u"Africa" }, - "GP": { - "region": "Caribbean", - "name": "Guadeloupe", - "continent": "South America" + u"GP": { + u"region": u"Caribbean", + u"name": u"Guadeloupe", + u"continent": u"South America" }, - "KAKH": { - "region": "South-Eastern Asia", - "name": "Kampuchea", - "continent": "Asia" + u"KAKH": { + u"region": u"South-Eastern Asia", + u"name": u"Kampuchea", + u"continent": u"Asia" }, - "GY": { - "region": "Southern America", - "name": "Guyana", - "continent": "South America" + u"GY": { + u"region": u"Southern America", + u"name": u"Guyana", + u"continent": u"South America" }, - "GG": { - "region": "Northern Europe", - "name": "Guernsey", - "continent": "Europe" + u"GG": { + u"region": u"Northern Europe", + u"name": u"Guernsey", + u"continent": u"Europe" }, - "BYAA": { - "region": "Eastern Europe", - "name": "Byelorussian Soviet Socialist Republic", - "continent": "Europe" + u"BYAA": { + u"region": u"Eastern Europe", + u"name": u"Byelorussian Soviet Socialist Republic", + u"continent": u"Europe" }, - "GE": { - "region": "Western Asia", - "name": "Georgia", - "continent": "Asia" + u"GE": { + u"region": u"Western Asia", + u"name": u"Georgia", + u"continent": u"Asia" }, - "GD": { - "region": "Caribbean", - "name": "Grenada", - "continent": "South America" + u"GD": { + u"region": u"Caribbean", + u"name": u"Grenada", + u"continent": u"South America" }, - "GB": { - "region": "Northern Europe", - "aliases": [ - "UK" + u"GB": { + u"region": u"Northern Europe", + u"aliases": [ + u"UK" ], - "name": "United Kingdom", - "continent": "Europe" + u"name": u"United Kingdom", + u"continent": u"Europe" }, - "GA": { - "region": "Middle Africa", - "name": "Gabon", - "continent": "Africa" + u"GA": { + u"region": u"Middle Africa", + u"name": u"Gabon", + u"continent": u"Africa" }, - "YEYE": { - "region": "Western Asia", - "name": "North Yemen", - "continent": "Asia" + u"YEYE": { + u"region": u"Western Asia", + u"name": u"North Yemen", + u"continent": u"Asia" }, - "GN": { - "region": "Western Africa", - "name": "Guinea", - "continent": "Africa" + u"GN": { + u"region": u"Western Africa", + u"name": u"Guinea", + u"continent": u"Africa" }, - "GM": { - "region": "Western Africa", - "aliases": [ - "The Gambia" + u"GM": { + u"region": u"Western Africa", + u"aliases": [ + u"The Gambia" ], - "name": "Gambia", - "continent": "Africa" + u"name": u"Gambia", + u"continent": u"Africa" }, - "GL": { - "region": "Northern America", - "name": "Greenland", - "continent": "North America" + u"GL": { + u"region": u"Northern America", + u"name": u"Greenland", + u"continent": u"North America" }, - "GI": { - "region": "Southern Europe", - "name": "Gibraltar", - "continent": "Europe" + u"GI": { + u"region": u"Southern Europe", + u"name": u"Gibraltar", + u"continent": u"Europe" }, - "GH": { - "region": "Western Africa", - "name": "Ghana", - "continent": "Africa" + u"GH": { + u"region": u"Western Africa", + u"name": u"Ghana", + u"continent": u"Africa" }, - "SUHH": { - "region": "Eastern Europe", - "name": "Soviet Union", - "continent": "Europe" + u"SUHH": { + u"region": u"Eastern Europe", + u"name": u"Soviet Union", + u"continent": u"Europe" }, - "JTUM": { - "region": "Polynesia", - "name": "Johnston Island", - "continent": "Oceania" + u"JTUM": { + u"region": u"Polynesia", + u"name": u"Johnston Island", + u"continent": u"Oceania" }, - "EH": { - "region": "Northern Africa", - "aliases": [ - "Western Sahara" + u"EH": { + u"region": u"Northern Africa", + u"aliases": [ + u"Western Sahara" ], - "name": "Sahrawi", - "continent": "Africa" + u"name": u"Sahrawi", + u"continent": u"Africa" }, - "ANHH": { - "region": "Caribbean", - "name": "Netherlands Antilles", - "continent": "South America" + u"ANHH": { + u"region": u"Caribbean", + u"name": u"Netherlands Antilles", + u"continent": u"South America" }, - "AE-RK": { - "region": "Western Asia", - "name": "Ras al-Khaimah", - "continent": "Asia" + u"AE-RK": { + u"region": u"Western Asia", + u"name": u"Ras al-Khaimah", + u"continent": u"Asia" }, - "ZA": { - "region": "Southern Africa", - "name": "South Africa", - "continent": "Africa" + u"ZA": { + u"region": u"Southern Africa", + u"name": u"South Africa", + u"continent": u"Africa" }, - "GB-WLS": { - "region": "Northern Europe", - "name": "Wales", - "continent": "Europe" + u"GB-WLS": { + u"region": u"Northern Europe", + u"name": u"Wales", + u"continent": u"Europe" }, - "ZW": { - "region": "Eastern Africa", - "name": "Zimbabwe", - "continent": "Africa" + u"ZW": { + u"region": u"Eastern Africa", + u"name": u"Zimbabwe", + u"continent": u"Africa" }, - "YUCS": { - "region": "Southern Europe", - "aliases": [ - "Federal Republic of Yugoslavia" + u"YUCS": { + u"region": u"Southern Europe", + u"aliases": [ + u"Federal Republic of Yugoslavia" ], - "name": "Yugoslavia", - "continent": "Europe" + u"name": u"Yugoslavia", + u"continent": u"Europe" }, - "ME": { - "region": "Southern Europe", - "name": "Montenegro", - "continent": "Europe" + u"ME": { + u"region": u"Southern Europe", + u"name": u"Montenegro", + u"continent": u"Europe" }, - "MD": { - "region": "Eastern Europe", - "name": "Moldova", - "continent": "Europe" + u"MD": { + u"region": u"Eastern Europe", + u"name": u"Moldova", + u"continent": u"Europe" }, - "MG": { - "region": "Eastern Africa", - "name": "Madagascar", - "continent": "Africa" + u"MG": { + u"region": u"Eastern Africa", + u"name": u"Madagascar", + u"continent": u"Africa" }, - "MF": { - "region": "Caribbean", - "aliases": [ - "Saint Martin (French part)" + u"MF": { + u"region": u"Caribbean", + u"aliases": [ + u"Saint Martin (French part)" ], - "name": "Saint Martin", - "continent": "South America" + u"name": u"Saint Martin", + u"continent": u"South America" }, - "MA": { - "region": "Northern Africa", - "name": "Morocco", - "continent": "Africa" + u"MA": { + u"region": u"Northern Africa", + u"name": u"Morocco", + u"continent": u"Africa" }, - "MC": { - "region": "Western Europe", - "name": "Monaco", - "continent": "Europe" + u"MC": { + u"region": u"Western Europe", + u"name": u"Monaco", + u"continent": u"Europe" }, - "MM": { - "region": "South-Eastern Asia", - "aliases": [ - "Burma" + u"MM": { + u"region": u"South-Eastern Asia", + u"aliases": [ + u"Burma" ], - "name": "Myanmar", - "continent": "Asia" + u"name": u"Myanmar", + u"continent": u"Asia" }, - "ML": { - "region": "Western Africa", - "name": "Mali", - "continent": "Africa" + u"ML": { + u"region": u"Western Africa", + u"name": u"Mali", + u"continent": u"Africa" }, - "MO": { - "region": "Eastern Asia", - "aliases": [ - "Macao" + u"MO": { + u"region": u"Eastern Asia", + u"aliases": [ + u"Macao" ], - "name": "Macau", - "continent": "Asia" + u"name": u"Macau", + u"continent": u"Asia" }, - "MN": { - "region": "Eastern Asia", - "name": "Mongolia", - "continent": "Asia" + u"MN": { + u"region": u"Eastern Asia", + u"name": u"Mongolia", + u"continent": u"Asia" }, - "AE-UQ": { - "region": "Western Asia", - "name": "Umm al-Quwain", - "continent": "Asia" + u"AE-UQ": { + u"region": u"Western Asia", + u"name": u"Umm al-Quwain", + u"continent": u"Asia" }, - "MH": { - "region": "Micronesia", - "name": "Marshall Islands", - "continent": "Oceania" + u"MH": { + u"region": u"Micronesia", + u"name": u"Marshall Islands", + u"continent": u"Oceania" }, - "MK": { - "region": "Southern Europe", - "aliases": [ - "Former Yugoslav Republic of Macedonia", - "Republic of Macedonia" + u"MK": { + u"region": u"Southern Europe", + u"aliases": [ + u"Former Yugoslav Republic of Macedonia", + u"Republic of Macedonia" ], - "name": "Macedonia", - "continent": "Europe" + u"name": u"Macedonia", + u"continent": u"Europe" }, - "MU": { - "region": "Eastern Africa", - "name": "Mauritius", - "continent": "Africa" + u"MU": { + u"region": u"Eastern Africa", + u"name": u"Mauritius", + u"continent": u"Africa" }, - "MT": { - "region": "Southern Europe", - "name": "Malta", - "continent": "Europe" + u"MT": { + u"region": u"Southern Europe", + u"name": u"Malta", + u"continent": u"Europe" }, - "MW": { - "region": "Eastern Africa", - "name": "Malawi", - "continent": "Africa" + u"MW": { + u"region": u"Eastern Africa", + u"name": u"Malawi", + u"continent": u"Africa" }, - "MV": { - "region": "Southern Asia", - "name": "Maldives", - "continent": "Asia" + u"MV": { + u"region": u"Southern Asia", + u"name": u"Maldives", + u"continent": u"Asia" }, - "MQ": { - "region": "Caribbean", - "name": "Martinique", - "continent": "South America" + u"MQ": { + u"region": u"Caribbean", + u"name": u"Martinique", + u"continent": u"South America" }, - "MP": { - "region": "Micronesia", - "name": "Northern Mariana Islands", - "continent": "Oceania" + u"MP": { + u"region": u"Micronesia", + u"name": u"Northern Mariana Islands", + u"continent": u"Oceania" }, - "MS": { - "region": "Caribbean", - "name": "Montserrat", - "continent": "South America" + u"MS": { + u"region": u"Caribbean", + u"name": u"Montserrat", + u"continent": u"South America" }, - "MR": { - "region": "Western Africa", - "name": "Mauritania", - "continent": "Africa" + u"MR": { + u"region": u"Western Africa", + u"name": u"Mauritania", + u"continent": u"Africa" }, - "MY": { - "region": "South-Eastern Asia", - "name": "Malaysia", - "continent": "Asia" + u"MY": { + u"region": u"South-Eastern Asia", + u"name": u"Malaysia", + u"continent": u"Asia" }, - "MX": { - "region": "Central America", - "name": "Mexico", - "continent": "South America" + u"MX": { + u"region": u"Central America", + u"name": u"Mexico", + u"continent": u"South America" }, - "MZ": { - "region": "Eastern Africa", - "name": "Mozambique", - "continent": "Africa" + u"MZ": { + u"region": u"Eastern Africa", + u"name": u"Mozambique", + u"continent": u"Africa" }, - "FR": { - "region": "Western Europe", - "name": "France", - "continent": "Europe" + u"FR": { + u"region": u"Western Europe", + u"name": u"France", + u"continent": u"Europe" }, - "ZRCD": { - "region": "Middle Africa", - "name": "Zaire", - "continent": "Africa" + u"ZRCD": { + u"region": u"Middle Africa", + u"name": u"Zaire", + u"continent": u"Africa" }, - "ZA-BO": { - "region": "Southern Africa", - "name": "Bophuthatswana", - "continent": "Africa" + u"ZA-BO": { + u"region": u"Southern Africa", + u"name": u"Bophuthatswana", + u"continent": u"Africa" }, - "FI": { - "region": "Northern Europe", - "name": "Finland", - "continent": "Europe" + u"FI": { + u"region": u"Northern Europe", + u"name": u"Finland", + u"continent": u"Europe" }, - "FJ": { - "region": "Melanesia", - "name": "Fiji", - "continent": "Oceania" + u"FJ": { + u"region": u"Melanesia", + u"name": u"Fiji", + u"continent": u"Oceania" }, - "FK": { - "region": "Southern America", - "name": "Falkland Islands", - "continent": "South America" + u"FK": { + u"region": u"Southern America", + u"name": u"Falkland Islands", + u"continent": u"South America" }, - "FM": { - "region": "Micronesia", - "aliases": [ - "Federated States of Micronesia" + u"FM": { + u"region": u"Micronesia", + u"aliases": [ + u"Federated States of Micronesia" ], - "name": "Micronesia", - "continent": "Oceania" + u"name": u"Micronesia", + u"continent": u"Oceania" }, - "FO": { - "region": "Northern Europe", - "name": "Faroe Islands", - "continent": "Europe" + u"FO": { + u"region": u"Northern Europe", + u"name": u"Faroe Islands", + u"continent": u"Europe" }, - "SITH": { - "region": "South-Eastern Asia", - "name": "Siam", - "continent": "Asia" + u"SITH": { + u"region": u"South-Eastern Asia", + u"name": u"Siam", + u"continent": u"Asia" }, - "NHVU": { - "region": "Melanesia", - "name": "New Hebrides", - "continent": "Oceania" + u"NHVU": { + u"region": u"Melanesia", + u"name": u"New Hebrides", + u"continent": u"Oceania" }, - "AR-AQ": { - "region": "Antarctica", - "name": "Argentine Antarctica", - "continent": "Antarctica" + u"AR-AQ": { + u"region": u"Antarctica", + u"name": u"Argentine Antarctica", + u"continent": u"Antarctica" }, - "FR-AQ": { - "region": "Antarctica", - "name": "Adélie Land", - "continent": "Antarctica" + u"FR-AQ": { + u"region": u"Antarctica", + u"name": u"Adélie Land", + u"continent": u"Antarctica" }, - "NHVU-VE": { - "region": "Melanesia", - "name": "Vemerana", - "continent": "Oceania" + u"NHVU-VE": { + u"region": u"Melanesia", + u"name": u"Vemerana", + u"continent": u"Oceania" }, - "SZ": { - "region": "Southern Africa", - "name": "Swaziland", - "continent": "Africa" + u"SZ": { + u"region": u"Southern Africa", + u"name": u"Swaziland", + u"continent": u"Africa" }, - "SY": { - "region": "Western Asia", - "name": "Syria", - "continent": "Asia" + u"SY": { + u"region": u"Western Asia", + u"name": u"Syria", + u"continent": u"Asia" }, - "SX": { - "region": "Caribbean", - "name": "Sint Maarten", - "continent": "South America" + u"SX": { + u"region": u"Caribbean", + u"name": u"Sint Maarten", + u"continent": u"South America" }, - "SS": { - "region": "Northern Africa", - "name": "South Sudan", - "continent": "Africa" + u"SS": { + u"region": u"Northern Africa", + u"name": u"South Sudan", + u"continent": u"Africa" }, - "SR": { - "region": "Southern America", - "name": "Suriname", - "continent": "South America" + u"SR": { + u"region": u"Southern America", + u"name": u"Suriname", + u"continent": u"South America" }, - "SV": { - "region": "Central America", - "name": "El Salvador", - "continent": "South America" + u"SV": { + u"region": u"Central America", + u"name": u"El Salvador", + u"continent": u"South America" }, - "ST": { - "region": "Middle Africa", - "aliases": [ - "Sao Tome and Principe" + u"ST": { + u"region": u"Middle Africa", + u"aliases": [ + u"Sao Tome and Principe" ], - "name": "São Tomé and Príncipe", - "continent": "Africa" + u"name": u"São Tomé and Príncipe", + u"continent": u"Africa" }, - "SK": { - "region": "Eastern Europe", - "name": "Slovakia", - "continent": "Europe" + u"SK": { + u"region": u"Eastern Europe", + u"name": u"Slovakia", + u"continent": u"Europe" }, - "SJ": { - "region": "Northern Europe", - "name": "Svalbard and Jan Mayen", - "continent": "Europe" + u"SJ": { + u"region": u"Northern Europe", + u"name": u"Svalbard and Jan Mayen", + u"continent": u"Europe" }, - "SI": { - "region": "Southern Europe", - "name": "Slovenia", - "continent": "Europe" + u"SI": { + u"region": u"Southern Europe", + u"name": u"Slovenia", + u"continent": u"Europe" }, - "SH": { - "region": "Western Africa", - "aliases": [ - "Saint Helena" + u"SH": { + u"region": u"Western Africa", + u"aliases": [ + u"Saint Helena" ], - "name": "Saint Helena, Ascension and Tristan da Cunha", - "continent": "Africa" + u"name": u"Saint Helena, Ascension and Tristan da Cunha", + u"continent": u"Africa" }, - "SO": { - "region": "Eastern Africa", - "name": "Somalia", - "continent": "Africa" + u"SO": { + u"region": u"Eastern Africa", + u"name": u"Somalia", + u"continent": u"Africa" }, - "SN": { - "region": "Western Africa", - "name": "Senegal", - "continent": "Africa" + u"SN": { + u"region": u"Western Africa", + u"name": u"Senegal", + u"continent": u"Africa" }, - "SM": { - "region": "Southern Europe", - "name": "San Marino", - "continent": "Europe" + u"SM": { + u"region": u"Southern Europe", + u"name": u"San Marino", + u"continent": u"Europe" }, - "SL": { - "region": "Western Africa", - "name": "Sierra Leone", - "continent": "Africa" + u"SL": { + u"region": u"Western Africa", + u"name": u"Sierra Leone", + u"continent": u"Africa" }, - "SC": { - "region": "Eastern Africa", - "name": "Seychelles", - "continent": "Africa" + u"SC": { + u"region": u"Eastern Africa", + u"name": u"Seychelles", + u"continent": u"Africa" }, - "SB": { - "region": "Melanesia", - "name": "Solomon Islands", - "continent": "Oceania" + u"SB": { + u"region": u"Melanesia", + u"name": u"Solomon Islands", + u"continent": u"Oceania" }, - "SA": { - "region": "Western Asia", - "name": "Saudi Arabia", - "continent": "Asia" + u"SA": { + u"region": u"Western Asia", + u"name": u"Saudi Arabia", + u"continent": u"Asia" }, - "SG": { - "region": "South-Eastern Asia", - "name": "Singapore", - "continent": "Asia" + u"SG": { + u"region": u"South-Eastern Asia", + u"name": u"Singapore", + u"continent": u"Asia" }, - "SE": { - "region": "Northern Europe", - "name": "Sweden", - "continent": "Europe" + u"SE": { + u"region": u"Northern Europe", + u"name": u"Sweden", + u"continent": u"Europe" }, - "SD": { - "region": "Northern Africa", - "name": "Sudan", - "continent": "Africa" + u"SD": { + u"region": u"Northern Africa", + u"name": u"Sudan", + u"continent": u"Africa" }, - "YE": { - "region": "Western Asia", - "name": "Yemen", - "continent": "Asia" + u"YE": { + u"region": u"Western Asia", + u"name": u"Yemen", + u"continent": u"Asia" }, - "YT": { - "region": "Eastern Africa", - "name": "Mayotte", - "continent": "Africa" + u"YT": { + u"region": u"Eastern Africa", + u"name": u"Mayotte", + u"continent": u"Africa" }, - "LB": { - "region": "Western Asia", - "name": "Lebanon", - "continent": "Asia" + u"LB": { + u"region": u"Western Asia", + u"name": u"Lebanon", + u"continent": u"Asia" }, - "LC": { - "region": "Caribbean", - "name": "Saint Lucia", - "continent": "South America" + u"LC": { + u"region": u"Caribbean", + u"name": u"Saint Lucia", + u"continent": u"South America" }, - "LA": { - "region": "South-Eastern Asia", - "name": "Laos", - "continent": "Asia" + u"LA": { + u"region": u"South-Eastern Asia", + u"name": u"Laos", + u"continent": u"Asia" }, - "ZA-TR": { - "region": "Southern Africa", - "name": "Transkei", - "continent": "Africa" + u"ZA-TR": { + u"region": u"Southern Africa", + u"name": u"Transkei", + u"continent": u"Africa" }, - "LK": { - "region": "Southern Asia", - "name": "Sri Lanka", - "continent": "Asia" + u"LK": { + u"region": u"Southern Asia", + u"name": u"Sri Lanka", + u"continent": u"Asia" }, - "LI": { - "region": "Western Europe", - "name": "Liechtenstein", - "continent": "Europe" + u"LI": { + u"region": u"Western Europe", + u"name": u"Liechtenstein", + u"continent": u"Europe" }, - "LV": { - "region": "Northern Europe", - "name": "Latvia", - "continent": "Europe" + u"LV": { + u"region": u"Northern Europe", + u"name": u"Latvia", + u"continent": u"Europe" }, - "LT": { - "region": "Northern Europe", - "name": "Lithuania", - "continent": "Europe" + u"LT": { + u"region": u"Northern Europe", + u"name": u"Lithuania", + u"continent": u"Europe" }, - "LU": { - "region": "Western Europe", - "name": "Luxembourg", - "continent": "Europe" + u"LU": { + u"region": u"Western Europe", + u"name": u"Luxembourg", + u"continent": u"Europe" }, - "PG-NSA": { - "region": "Melanesia", - "name": "Bougainville", - "continent": "Oceania" + u"PG-NSA": { + u"region": u"Melanesia", + u"name": u"Bougainville", + u"continent": u"Oceania" }, - "LS": { - "region": "Southern Africa", - "name": "Lesotho", - "continent": "Africa" + u"LS": { + u"region": u"Southern Africa", + u"name": u"Lesotho", + u"continent": u"Africa" }, - "LY": { - "region": "Northern Africa", - "name": "Libya", - "continent": "Africa" + u"LY": { + u"region": u"Northern Africa", + u"name": u"Libya", + u"continent": u"Africa" }, - "DEDE": { - "region": "Western Europe", - "name": "West Germany", - "continent": "Europe" + u"DEDE": { + u"region": u"Western Europe", + u"name": u"West Germany", + u"continent": u"Europe" }, - "GF": { - "region": "Southern America", - "name": "French Guiana", - "continent": "South America" + u"GF": { + u"region": u"Southern America", + u"name": u"French Guiana", + u"continent": u"South America" }, - "AU-CS": { - "region": "Australia and New Zealand", - "name": "Coral Sea Islands", - "continent": "Oceania" + u"AU-CS": { + u"region": u"Australia and New Zealand", + u"name": u"Coral Sea Islands", + u"continent": u"Oceania" }, - "WKUM": { - "region": "Micronesia", - "name": "Wake Island", - "continent": "Oceania" + u"WKUM": { + u"region": u"Micronesia", + u"name": u"Wake Island", + u"continent": u"Oceania" }, - "UAUA": { - "region": "Eastern Europe", - "name": "Ukrainian Soviet Socialist Republic", - "continent": "Europe" + u"UAUA": { + u"region": u"Eastern Europe", + u"name": u"Ukrainian Soviet Socialist Republic", + u"continent": u"Europe" }, - "CTKI": { - "region": "Micronesia", - "name": "Canton and Enderbury Islands", - "continent": "Oceania" + u"CTKI": { + u"region": u"Micronesia", + u"name": u"Canton and Enderbury Islands", + u"continent": u"Oceania" }, - "RU": { - "region": "Eastern Europe", - "name": "Russia", - "continent": "Europe" + u"RU": { + u"region": u"Eastern Europe", + u"name": u"Russia", + u"continent": u"Europe" }, - "RW": { - "region": "Eastern Africa", - "name": "Rwanda", - "continent": "Africa" + u"RW": { + u"region": u"Eastern Africa", + u"name": u"Rwanda", + u"continent": u"Africa" }, - "RS": { - "region": "Southern Europe", - "name": "Serbia", - "continent": "Europe" + u"RS": { + u"region": u"Southern Europe", + u"name": u"Serbia", + u"continent": u"Europe" }, - "RE": { - "region": "Eastern Africa", - "name": "Réunion", - "continent": "Africa" + u"RE": { + u"region": u"Eastern Africa", + u"name": u"Réunion", + u"continent": u"Africa" }, - "LR": { - "region": "Western Africa", - "name": "Liberia", - "continent": "Africa" + u"LR": { + u"region": u"Western Africa", + u"name": u"Liberia", + u"continent": u"Africa" }, - "RO": { - "region": "Eastern Europe", - "name": "Romania", - "continent": "Europe" + u"RO": { + u"region": u"Eastern Europe", + u"name": u"Romania", + u"continent": u"Europe" }, - "PK-NA": { - "region": "Southern Asia", - "name": "Gilgit-Baltistan", - "continent": "Asia" + u"PK-NA": { + u"region": u"Southern Asia", + u"name": u"Gilgit-Baltistan", + u"continent": u"Asia" }, - "GG-HE": { - "region": "Northern Europe", - "name": "Herm", - "continent": "Europe" + u"GG-HE": { + u"region": u"Northern Europe", + u"name": u"Herm", + u"continent": u"Europe" }, - "CSXX": { - "region": "Southern Europe", - "name": "Serbia and Montenegro", - "continent": "Europe" + u"CSXX": { + u"region": u"Southern Europe", + u"name": u"Serbia and Montenegro", + u"continent": u"Europe" }, - "AU-AC": { - "region": "Australia and New Zealand", - "name": "Ashmore and Cartier Islands", - "continent": "Oceania" + u"AU-AC": { + u"region": u"Australia and New Zealand", + u"name": u"Ashmore and Cartier Islands", + u"continent": u"Oceania" }, - "AU-AQ": { - "region": "Antarctica", - "name": "Australian Antarctic Territory", - "continent": "Antarctica" + u"AU-AQ": { + u"region": u"Antarctica", + u"name": u"Australian Antarctic Territory", + u"continent": u"Antarctica" }, - "TPTL": { - "region": "South-Eastern Asia", - "name": "East Timor", - "continent": "Asia" + u"TPTL": { + u"region": u"South-Eastern Asia", + u"name": u"East Timor", + u"continent": u"Asia" }, - "GEKI": { - "region": "Micronesia", - "name": "Gilbert Islands", - "continent": "Oceania" + u"GEKI": { + u"region": u"Micronesia", + u"name": u"Gilbert Islands", + u"continent": u"Oceania" }, - "NQAQ": { - "region": "Antarctica", - "name": "Queen Maud Land", - "continent": "Antarctica" + u"NQAQ": { + u"region": u"Antarctica", + u"name": u"Queen Maud Land", + u"continent": u"Antarctica" }, - "EE": { - "region": "Northern Europe", - "name": "Estonia", - "continent": "Europe" + u"EE": { + u"region": u"Northern Europe", + u"name": u"Estonia", + u"continent": u"Europe" }, - "EG": { - "region": "Northern Africa", - "name": "Egypt", - "continent": "Africa" + u"EG": { + u"region": u"Northern Africa", + u"name": u"Egypt", + u"continent": u"Africa" }, - "EA": { - "region": "Northern Africa", - "name": "Ceuta and Melilla", - "continent": "Africa" + u"EA": { + u"region": u"Northern Africa", + u"name": u"Ceuta and Melilla", + u"continent": u"Africa" }, - "EC": { - "region": "Southern America", - "name": "Ecuador", - "continent": "South America" + u"EC": { + u"region": u"Southern America", + u"name": u"Ecuador", + u"continent": u"South America" }, - "EU": { - "region": "Western Europe", - "name": "European Union", - "continent": "Europe" + u"EU": { + u"region": u"Western Europe", + u"name": u"European Union", + u"continent": u"Europe" }, - "ET": { - "region": "Eastern Africa", - "name": "Ethiopia", - "continent": "Africa" + u"ET": { + u"region": u"Eastern Africa", + u"name": u"Ethiopia", + u"continent": u"Africa" }, - "ES": { - "region": "Southern Europe", - "name": "Spain", - "continent": "Europe" + u"ES": { + u"region": u"Southern Europe", + u"name": u"Spain", + u"continent": u"Europe" }, - "ER": { - "region": "Eastern Africa", - "name": "Eritrea", - "continent": "Africa" + u"ER": { + u"region": u"Eastern Africa", + u"name": u"Eritrea", + u"continent": u"Africa" }, - "RU-CE": { - "region": "Eastern Europe", - "name": "Chechnia", - "continent": "Europe" + u"RU-CE": { + u"region": u"Eastern Europe", + u"name": u"Chechnia", + u"continent": u"Europe" }, - "VU": { - "region": "Melanesia", - "name": "Vanuatu", - "continent": "Oceania" + u"VU": { + u"region": u"Melanesia", + u"name": u"Vanuatu", + u"continent": u"Oceania" }, - "AIDJ": { - "region": "Eastern Africa", - "name": "French Afar and Issas", - "continent": "Africa" + u"AIDJ": { + u"region": u"Eastern Africa", + u"name": u"French Afar and Issas", + u"continent": u"Africa" }, - "IN": { - "region": "Southern Asia", - "name": "India", - "continent": "Asia" + u"IN": { + u"region": u"Southern Asia", + u"name": u"India", + u"continent": u"Asia" }, - "XK": { - "region": "Southern Europe", - "aliases": [ - "Kosova (Kosovo)" + u"XK": { + u"region": u"Southern Europe", + u"aliases": [ + u"Kosova (Kosovo)" ], - "name": "Kosovo", - "continent": "Europe" + u"name": u"Kosovo", + u"continent": u"Europe" }, - "PK-JK": { - "region": "Southern Asia", - "name": "Azad Kashmir", - "continent": "Asia" + u"PK-JK": { + u"region": u"Southern Asia", + u"name": u"Azad Kashmir", + u"continent": u"Asia" }, - "BUMM": { - "region": "South-Eastern Asia", - "name": "Burma", - "continent": "Asia" + u"BUMM": { + u"region": u"South-Eastern Asia", + u"name": u"Burma", + u"continent": u"Asia" }, - "NR": { - "region": "Micronesia", - "name": "Nauru", - "continent": "Oceania" + u"NR": { + u"region": u"Micronesia", + u"name": u"Nauru", + u"continent": u"Oceania" }, - "KG": { - "region": "Central Asia", - "name": "Kyrgyzstan", - "continent": "Asia" + u"KG": { + u"region": u"Central Asia", + u"name": u"Kyrgyzstan", + u"continent": u"Asia" }, - "KE": { - "region": "Eastern Africa", - "name": "Kenya", - "continent": "Africa" + u"KE": { + u"region": u"Eastern Africa", + u"name": u"Kenya", + u"continent": u"Africa" }, - "KI": { - "region": "Micronesia", - "name": "Kiribati", - "continent": "Oceania" + u"KI": { + u"region": u"Micronesia", + u"name": u"Kiribati", + u"continent": u"Oceania" }, - "KH": { - "region": "South-Eastern Asia", - "name": "Cambodia", - "continent": "Asia" + u"KH": { + u"region": u"South-Eastern Asia", + u"name": u"Cambodia", + u"continent": u"Asia" }, - "KN": { - "region": "Caribbean", - "name": "Saint Kitts and Nevis", - "continent": "South America" + u"KN": { + u"region": u"Caribbean", + u"name": u"Saint Kitts and Nevis", + u"continent": u"South America" }, - "KM": { - "region": "Eastern Africa", - "name": "Comoros", - "continent": "Africa" + u"KM": { + u"region": u"Eastern Africa", + u"name": u"Comoros", + u"continent": u"Africa" }, - "KR": { - "region": "Eastern Asia", - "name": "South Korea", - "continent": "Asia" + u"KR": { + u"region": u"Eastern Asia", + u"name": u"South Korea", + u"continent": u"Asia" }, - "KP": { - "region": "Eastern Asia", - "name": "North Korea", - "continent": "Asia" + u"KP": { + u"region": u"Eastern Asia", + u"name": u"North Korea", + u"continent": u"Asia" }, - "KW": { - "region": "Western Asia", - "name": "Kuwait", - "continent": "Asia" + u"KW": { + u"region": u"Western Asia", + u"name": u"Kuwait", + u"continent": u"Asia" }, - "KZ": { - "region": "Central Asia", - "name": "Kazakhstan", - "continent": "Asia" + u"KZ": { + u"region": u"Central Asia", + u"name": u"Kazakhstan", + u"continent": u"Asia" }, - "KY": { - "region": "Caribbean", - "name": "Cayman Islands", - "continent": "South America" + u"KY": { + u"region": u"Caribbean", + u"name": u"Cayman Islands", + u"continent": u"South America" }, - "DO": { - "region": "Caribbean", - "name": "Dominican Republic", - "continent": "South America" + u"DO": { + u"region": u"Caribbean", + u"name": u"Dominican Republic", + u"continent": u"South America" }, - "DM": { - "region": "Caribbean", - "name": "Dominica", - "continent": "South America" + u"DM": { + u"region": u"Caribbean", + u"name": u"Dominica", + u"continent": u"South America" }, - "DJ": { - "region": "Eastern Africa", - "name": "Djibouti", - "continent": "Africa" + u"DJ": { + u"region": u"Eastern Africa", + u"name": u"Djibouti", + u"continent": u"Africa" }, - "DK": { - "region": "Northern Europe", - "name": "Denmark", - "continent": "Europe" + u"DK": { + u"region": u"Northern Europe", + u"name": u"Denmark", + u"continent": u"Europe" }, - "DG": { - "region": "Southern Asia", - "name": "Diego Garcia", - "continent": "Asia" + u"DG": { + u"region": u"Southern Asia", + u"name": u"Diego Garcia", + u"continent": u"Asia" }, - "DE": { - "region": "Western Europe", - "name": "Germany", - "continent": "Europe" + u"DE": { + u"region": u"Western Europe", + u"name": u"Germany", + u"continent": u"Europe" }, - "DZ": { - "region": "Northern Africa", - "name": "Algeria", - "continent": "Africa" + u"DZ": { + u"region": u"Northern Africa", + u"name": u"Algeria", + u"continent": u"Africa" }, - "BQAQ": { - "region": "Antarctica", - "name": "British Antarctic Territory", - "continent": "Antarctica" + u"BQAQ": { + u"region": u"Antarctica", + u"name": u"British Antarctic Territory", + u"continent": u"Antarctica" }, - "ZA-CI": { - "region": "Southern Africa", - "name": "Ciskei", - "continent": "Africa" + u"ZA-CI": { + u"region": u"Southern Africa", + u"name": u"Ciskei", + u"continent": u"Africa" }, - "GB-SL": { - "region": "Northern Europe", - "name": "Sealand", - "continent": "Europe" + u"GB-SL": { + u"region": u"Northern Europe", + u"name": u"Sealand", + u"continent": u"Europe" }, - "MD-SN": { - "region": "Eastern Europe", - "name": "Transnistria", - "continent": "Europe" + u"MD-SN": { + u"region": u"Eastern Europe", + u"name": u"Transnistria", + u"continent": u"Europe" }, - "SKIN": { - "region": "Southern Asia", - "name": "Sikkim", - "continent": "Asia" + u"SKIN": { + u"region": u"Southern Asia", + u"name": u"Sikkim", + u"continent": u"Asia" }, - "FXFR": { - "region": "Western Europe", - "name": "Metropolitan France", - "continent": "Europe" + u"FXFR": { + u"region": u"Western Europe", + u"name": u"Metropolitan France", + u"continent": u"Europe" }, - "AE-FU": { - "region": "Western Asia", - "name": "Fujairah", - "continent": "Asia" + u"AE-FU": { + u"region": u"Western Asia", + u"name": u"Fujairah", + u"continent": u"Asia" }, - "QA": { - "region": "Western Asia", - "name": "Qatar", - "continent": "Asia" + u"QA": { + u"region": u"Western Asia", + u"name": u"Qatar", + u"continent": u"Asia" }, - "WF": { - "region": "Polynesia", - "name": "Wallis and Futuna", - "continent": "Oceania" + u"WF": { + u"region": u"Polynesia", + u"name": u"Wallis and Futuna", + u"continent": u"Oceania" }, - "JP": { - "region": "Eastern Asia", - "name": "Japan", - "continent": "Asia" + u"JP": { + u"region": u"Eastern Asia", + u"name": u"Japan", + u"continent": u"Asia" }, - "JM": { - "region": "Caribbean", - "name": "Jamaica", - "continent": "South America" + u"JM": { + u"region": u"Caribbean", + u"name": u"Jamaica", + u"continent": u"South America" }, - "JO": { - "region": "Western Asia", - "name": "Jordan", - "continent": "Asia" + u"JO": { + u"region": u"Western Asia", + u"name": u"Jordan", + u"continent": u"Asia" }, - "WS": { - "region": "Polynesia", - "name": "Samoa", - "continent": "Oceania" + u"WS": { + u"region": u"Polynesia", + u"name": u"Samoa", + u"continent": u"Oceania" }, - "JE": { - "region": "Northern Europe", - "name": "Jersey", - "continent": "Europe" + u"JE": { + u"region": u"Northern Europe", + u"name": u"Jersey", + u"continent": u"Europe" }, - "KM-M": { - "region": "Eastern Africa", - "name": "Mohéli", - "continent": "Africa" + u"KM-M": { + u"region": u"Eastern Africa", + u"name": u"Mohéli", + u"continent": u"Africa" }, - "KM-A": { - "region": "Eastern Africa", - "name": "Anjouan", - "continent": "Africa" + u"KM-A": { + u"region": u"Eastern Africa", + u"name": u"Anjouan", + u"continent": u"Africa" }, - "PZPA": { - "region": "Central America", - "name": "Panama Canal Zone", - "continent": "South America" + u"PZPA": { + u"region": u"Central America", + u"name": u"Panama Canal Zone", + u"continent": u"South America" }, - "MIUM": { - "region": "Polynesia", - "name": "Midway Islands", - "continent": "Oceania" + u"MIUM": { + u"region": u"Polynesia", + u"name": u"Midway Islands", + u"continent": u"Oceania" }, - "GEHH": { - "region": "Micronesia", - "name": "Gilbert and Ellice Islands", - "continent": "Oceania" + u"GEHH": { + u"region": u"Micronesia", + u"name": u"Gilbert and Ellice Islands", + u"continent": u"Oceania" }, - "NZ-AQ": { - "region": "Antarctica", - "name": "Ross Dependency", - "continent": "Antarctica" + u"NZ-AQ": { + u"region": u"Antarctica", + u"name": u"Ross Dependency", + u"continent": u"Antarctica" }, - "HVBF": { - "region": "Western Africa", - "name": "Upper Volta", - "continent": "Africa" + u"HVBF": { + u"region": u"Western Africa", + u"name": u"Upper Volta", + u"continent": u"Africa" }, - "GB-AD": { - "region": "Western Asia", - "name": "Akrotiri and Dhekelia", - "continent": "Asia" + u"GB-AD": { + u"region": u"Western Asia", + u"name": u"Akrotiri and Dhekelia", + u"continent": u"Asia" }, - "UG-RW": { - "region": "Eastern Africa", - "name": "Rwenzururu", - "continent": "Africa" + u"UG-RW": { + u"region": u"Eastern Africa", + u"name": u"Rwenzururu", + u"continent": u"Africa" }, - "ZM": { - "region": "Eastern Africa", - "name": "Zambia", - "continent": "Africa" + u"ZM": { + u"region": u"Eastern Africa", + u"name": u"Zambia", + u"continent": u"Africa" }, - "NTHH": { - "region": "Western Asia", - "name": "Neutral Zone", - "continent": "Asia" + u"NTHH": { + u"region": u"Western Asia", + u"name": u"Neutral Zone", + u"continent": u"Asia" }, - "PR": { - "region": "Caribbean", - "name": "Puerto Rico", - "continent": "South America" + u"PR": { + u"region": u"Caribbean", + u"name": u"Puerto Rico", + u"continent": u"South America" }, - "PS": { - "region": "Western Asia", - "aliases": [ - "Palestinian Territories", - "Occupied Palestinian Territory" + u"PS": { + u"region": u"Western Asia", + u"aliases": [ + u"Palestinian Territories", + u"Occupied Palestinian Territory" ], - "name": "Palestine", - "continent": "Asia" + u"name": u"Palestine", + u"continent": u"Asia" }, - "PW": { - "region": "Micronesia", - "name": "Palau", - "continent": "Oceania" + u"PW": { + u"region": u"Micronesia", + u"name": u"Palau", + u"continent": u"Oceania" }, - "PT": { - "region": "Southern Europe", - "name": "Portugal", - "continent": "Europe" + u"PT": { + u"region": u"Southern Europe", + u"name": u"Portugal", + u"continent": u"Europe" }, - "PY": { - "region": "Southern America", - "name": "Paraguay", - "continent": "South America" + u"PY": { + u"region": u"Southern America", + u"name": u"Paraguay", + u"continent": u"South America" }, - "PA": { - "region": "Central America", - "name": "Panama", - "continent": "South America" + u"PA": { + u"region": u"Central America", + u"name": u"Panama", + u"continent": u"South America" }, - "PF": { - "region": "Polynesia", - "name": "French Polynesia", - "continent": "Oceania" + u"PF": { + u"region": u"Polynesia", + u"name": u"French Polynesia", + u"continent": u"Oceania" }, - "PG": { - "region": "Melanesia", - "name": "Papua New Guinea", - "continent": "Oceania" + u"PG": { + u"region": u"Melanesia", + u"name": u"Papua New Guinea", + u"continent": u"Oceania" }, - "PE": { - "region": "Southern America", - "name": "Peru", - "continent": "South America" + u"PE": { + u"region": u"Southern America", + u"name": u"Peru", + u"continent": u"South America" }, - "PK": { - "region": "Southern Asia", - "name": "Pakistan", - "continent": "Asia" + u"PK": { + u"region": u"Southern Asia", + u"name": u"Pakistan", + u"continent": u"Asia" }, - "PH": { - "region": "South-Eastern Asia", - "name": "Philippines", - "continent": "Asia" + u"PH": { + u"region": u"South-Eastern Asia", + u"name": u"Philippines", + u"continent": u"Asia" }, - "PN": { - "region": "Polynesia", - "aliases": [ - "Pitcairn" + u"PN": { + u"region": u"Polynesia", + u"aliases": [ + u"Pitcairn" ], - "name": "Pitcairn Islands", - "continent": "Oceania" + u"name": u"Pitcairn Islands", + u"continent": u"Oceania" }, - "PL": { - "region": "Eastern Europe", - "name": "Poland", - "continent": "Europe" + u"PL": { + u"region": u"Eastern Europe", + u"name": u"Poland", + u"continent": u"Europe" }, - "PM": { - "region": "Northern America", - "name": "Saint Pierre and Miquelon", - "continent": "North America" + u"PM": { + u"region": u"Northern America", + u"name": u"Saint Pierre and Miquelon", + u"continent": u"North America" }, - "VDVN": { - "region": "South-Eastern Asia", - "name": "North Vietnam", - "continent": "Asia" + u"VDVN": { + u"region": u"South-Eastern Asia", + u"name": u"North Vietnam", + u"continent": u"Asia" }, - "NO-PI": { - "region": "Antarctica", - "name": "Peter I Island", - "continent": "Antarctica" + u"NO-PI": { + u"region": u"Antarctica", + u"name": u"Peter I Island", + u"continent": u"Antarctica" }, - "KOJP": { - "region": "Eastern Asia", - "name": "Korea", - "continent": "Asia" + u"KOJP": { + u"region": u"Eastern Asia", + u"name": u"Korea", + u"continent": u"Asia" }, - "GBBZ": { - "region": "Central America", - "name": "British Honduras", - "continent": "South America" + u"GBBZ": { + u"region": u"Central America", + u"name": u"British Honduras", + u"continent": u"South America" }, - "RHZW-ZR": { - "region": "Eastern Africa", - "name": "Zimbabwe Rhodesia", - "continent": "Africa" + u"RHZW-ZR": { + u"region": u"Eastern Africa", + u"name": u"Zimbabwe Rhodesia", + u"continent": u"Africa" }, - "GB-NIR": { - "region": "Northern Europe", - "name": "Northern Ireland", - "continent": "Europe" + u"GB-NIR": { + u"region": u"Northern Europe", + u"name": u"Northern Ireland", + u"continent": u"Europe" }, - "NG-BI": { - "region": "Western Africa", - "name": "Biafra", - "continent": "Africa" + u"NG-BI": { + u"region": u"Western Africa", + u"name": u"Biafra", + u"continent": u"Africa" }, - "CK": { - "region": "Polynesia", - "name": "Cook Islands", - "continent": "Oceania" + u"CK": { + u"region": u"Polynesia", + u"name": u"Cook Islands", + u"continent": u"Oceania" }, - "CI": { - "region": "Western Africa", - "aliases": [ - "Ivory Coast" + u"CI": { + u"region": u"Western Africa", + u"aliases": [ + u"Ivory Coast" ], - "name": "Côte d'Ivoire", - "continent": "Africa" + u"name": u"Côte d'Ivoire", + u"continent": u"Africa" }, - "CH": { - "region": "Western Europe", - "name": "Switzerland", - "continent": "Europe" + u"CH": { + u"region": u"Western Europe", + u"name": u"Switzerland", + u"continent": u"Europe" }, - "CO": { - "region": "Southern America", - "name": "Colombia", - "continent": "South America" + u"CO": { + u"region": u"Southern America", + u"name": u"Colombia", + u"continent": u"South America" }, - "CN": { - "region": "Eastern Asia", - "name": "China", - "continent": "Asia" + u"CN": { + u"region": u"Eastern Asia", + u"name": u"China", + u"continent": u"Asia" }, - "CM": { - "region": "Middle Africa", - "name": "Cameroon", - "continent": "Africa" + u"CM": { + u"region": u"Middle Africa", + u"name": u"Cameroon", + u"continent": u"Africa" }, - "CL-AQ": { - "region": "Antarctica", - "name": "Chilean Antarctic Territory", - "continent": "Antarctica" + u"CL-AQ": { + u"region": u"Antarctica", + u"name": u"Chilean Antarctic Territory", + u"continent": u"Antarctica" }, - "CC": { - "region": "South-Eastern Asia", - "aliases": [ - "Cocos (Keeling) Islands" + u"CC": { + u"region": u"South-Eastern Asia", + u"aliases": [ + u"Cocos (Keeling) Islands" ], - "name": "Cocos Islands", - "continent": "Asia" + u"name": u"Cocos Islands", + u"continent": u"Asia" }, - "CA": { - "region": "Northern America", - "name": "Canada", - "continent": "North America" + u"CA": { + u"region": u"Northern America", + u"name": u"Canada", + u"continent": u"North America" }, - "CG": { - "region": "Middle Africa", - "aliases": [ - "Congo" + u"CG": { + u"region": u"Middle Africa", + u"aliases": [ + u"Congo" ], - "name": "Republic of the Congo", - "continent": "Africa" + u"name": u"Republic of the Congo", + u"continent": u"Africa" }, - "CF": { - "region": "Middle Africa", - "name": "Central African Republic", - "continent": "Africa" + u"CF": { + u"region": u"Middle Africa", + u"name": u"Central African Republic", + u"continent": u"Africa" }, - "CD": { - "region": "Middle Africa", - "aliases": [ - "Democratic Republic of Congo" + u"CD": { + u"region": u"Middle Africa", + u"aliases": [ + u"Democratic Republic of Congo" ], - "name": "Democratic Republic of the Congo", - "continent": "Africa" + u"name": u"Democratic Republic of the Congo", + u"continent": u"Africa" }, - "CZ": { - "region": "Eastern Europe", - "name": "Czech Republic", - "continent": "Europe" + u"CZ": { + u"region": u"Eastern Europe", + u"name": u"Czech Republic", + u"continent": u"Europe" }, - "CY": { - "region": "Western Asia", - "name": "Cyprus", - "continent": "Asia" + u"CY": { + u"region": u"Western Asia", + u"name": u"Cyprus", + u"continent": u"Asia" }, - "CX": { - "region": "South-Eastern Asia", - "name": "Christmas Island", - "continent": "Asia" + u"CX": { + u"region": u"South-Eastern Asia", + u"name": u"Christmas Island", + u"continent": u"Asia" }, - "CR": { - "region": "Central America", - "name": "Costa Rica", - "continent": "South America" + u"CR": { + u"region": u"Central America", + u"name": u"Costa Rica", + u"continent": u"South America" }, - "CP": { - "region": "Central America", - "name": "Clipperton Island", - "continent": "South America" + u"CP": { + u"region": u"Central America", + u"name": u"Clipperton Island", + u"continent": u"South America" }, - "VNVN": { - "region": "South-Eastern Asia", - "name": "South Vietnam", - "continent": "Asia" + u"VNVN": { + u"region": u"South-Eastern Asia", + u"name": u"South Vietnam", + u"continent": u"Asia" }, - "CV": { - "region": "Western Africa", - "name": "Cape Verde", - "continent": "Africa" + u"CV": { + u"region": u"Western Africa", + u"name": u"Cape Verde", + u"continent": u"Africa" }, - "CU": { - "region": "Caribbean", - "name": "Cuba", - "continent": "South America" + u"CU": { + u"region": u"Caribbean", + u"name": u"Cuba", + u"continent": u"South America" }, - "AO-CAB": { - "region": "Middle Africa", - "name": "Cabinda", - "continent": "Africa" + u"AO-CAB": { + u"region": u"Middle Africa", + u"name": u"Cabinda", + u"continent": u"Africa" }, - "GBKN": { - "region": "Caribbean", - "name": "Saint Christopher-Nevis-Anguilla", - "continent": "South America" + u"GBKN": { + u"region": u"Caribbean", + u"name": u"Saint Christopher-Nevis-Anguilla", + u"continent": u"South America" }, - "LKLK": { - "region": "Southern Asia", - "name": "Ceylon", - "continent": "Asia" + u"LKLK": { + u"region": u"Southern Asia", + u"name": u"Ceylon", + u"continent": u"Asia" }, - "CSHH": { - "region": "Eastern Europe", - "name": "Czechoslovakia", - "continent": "Europe" + u"CSHH": { + u"region": u"Eastern Europe", + u"name": u"Czechoslovakia", + u"continent": u"Europe" }, - "AE-AZ": { - "region": "Western Asia", - "name": "Abu Dhabi", - "continent": "Asia" + u"AE-AZ": { + u"region": u"Western Asia", + u"name": u"Abu Dhabi", + u"continent": u"Asia" }, - "SO-SO": { - "region": "Eastern Africa", - "name": "Somaliland", - "continent": "Africa" + u"SO-SO": { + u"region": u"Eastern Africa", + u"name": u"Somaliland", + u"continent": u"Africa" }, - "AE-AJ": { - "region": "Western Asia", - "name": "Ajman", - "continent": "Asia" + u"AE-AJ": { + u"region": u"Western Asia", + u"name": u"Ajman", + u"continent": u"Asia" }, - "VA": { - "region": "Southern Europe", - "aliases": [ - "Holy See (Vatican City State)" + u"VA": { + u"region": u"Southern Europe", + u"aliases": [ + u"Holy See (Vatican City State)" ], - "name": "Vatican City", - "continent": "Europe" + u"name": u"Vatican City", + u"continent": u"Europe" }, - "VC": { - "region": "Caribbean", - "name": "Saint Vincent and the Grenadines", - "continent": "South America" + u"VC": { + u"region": u"Caribbean", + u"name": u"Saint Vincent and the Grenadines", + u"continent": u"South America" }, - "VE": { - "region": "Southern America", - "name": "Venezuela", - "continent": "South America" + u"VE": { + u"region": u"Southern America", + u"name": u"Venezuela", + u"continent": u"South America" }, - "VG": { - "region": "Caribbean", - "name": "British Virgin Islands", - "continent": "South America" + u"VG": { + u"region": u"Caribbean", + u"name": u"British Virgin Islands", + u"continent": u"South America" }, - "IQ": { - "region": "Western Asia", - "name": "Iraq", - "continent": "Asia" + u"IQ": { + u"region": u"Western Asia", + u"name": u"Iraq", + u"continent": u"Asia" }, - "VI": { - "region": "Caribbean", - "aliases": [ - "US Virgin Islands" + u"VI": { + u"region": u"Caribbean", + u"aliases": [ + u"US Virgin Islands" ], - "name": "United States Virgin Islands", - "continent": "South America" + u"name": u"United States Virgin Islands", + u"continent": u"South America" }, - "IS": { - "region": "Northern Europe", - "name": "Iceland", - "continent": "Europe" + u"IS": { + u"region": u"Northern Europe", + u"name": u"Iceland", + u"continent": u"Europe" }, - "IR": { - "region": "Southern Asia", - "name": "Iran", - "continent": "Asia" + u"IR": { + u"region": u"Southern Asia", + u"name": u"Iran", + u"continent": u"Asia" }, - "IT": { - "region": "Southern Europe", - "name": "Italy", - "continent": "Europe" + u"IT": { + u"region": u"Southern Europe", + u"name": u"Italy", + u"continent": u"Europe" }, - "VN": { - "region": "South-Eastern Asia", - "name": "Vietnam", - "continent": "Asia" + u"VN": { + u"region": u"South-Eastern Asia", + u"name": u"Vietnam", + u"continent": u"Asia" }, - "IM": { - "region": "Northern Europe", - "name": "Isle of Man", - "continent": "Europe" + u"IM": { + u"region": u"Northern Europe", + u"name": u"Isle of Man", + u"continent": u"Europe" }, - "IL": { - "region": "Western Asia", - "name": "Israel", - "continent": "Asia" + u"IL": { + u"region": u"Western Asia", + u"name": u"Israel", + u"continent": u"Asia" }, - "IO": { - "region": "Southern Asia", - "name": "British Indian Ocean Territory", - "continent": "Asia" + u"IO": { + u"region": u"Southern Asia", + u"name": u"British Indian Ocean Territory", + u"continent": u"Asia" }, - "NHVU-TF": { - "region": "Melanesia", - "name": "Tafea", - "continent": "Oceania" + u"NHVU-TF": { + u"region": u"Melanesia", + u"name": u"Tafea", + u"continent": u"Oceania" }, - "IC": { - "region": "Northern Africa", - "name": "Canary Islands", - "continent": "Africa" + u"IC": { + u"region": u"Northern Africa", + u"name": u"Canary Islands", + u"continent": u"Africa" }, - "IE": { - "region": "Northern Europe", - "name": "Ireland", - "continent": "Europe" + u"IE": { + u"region": u"Northern Europe", + u"name": u"Ireland", + u"continent": u"Europe" }, - "ID": { - "region": "South-Eastern Asia", - "name": "Indonesia", - "continent": "Asia" + u"ID": { + u"region": u"South-Eastern Asia", + u"name": u"Indonesia", + u"continent": u"Asia" }, - "NHVU-TN": { - "region": "Melanesia", - "name": "Tanna", - "continent": "Oceania" + u"NHVU-TN": { + u"region": u"Melanesia", + u"name": u"Tanna", + u"continent": u"Oceania" }, - "GB-ENG": { - "region": "Northern Europe", - "name": "England", - "continent": "Europe" + u"GB-ENG": { + u"region": u"Northern Europe", + u"name": u"England", + u"continent": u"Europe" }, - "GG-AL": { - "region": "Northern Europe", - "name": "Alderney", - "continent": "Europe" + u"GG-AL": { + u"region": u"Northern Europe", + u"name": u"Alderney", + u"continent": u"Europe" }, - "BD": { - "region": "Southern Asia", - "name": "Bangladesh", - "continent": "Asia" + u"BD": { + u"region": u"Southern Asia", + u"name": u"Bangladesh", + u"continent": u"Asia" }, - "BE": { - "region": "Western Europe", - "name": "Belgium", - "continent": "Europe" + u"BE": { + u"region": u"Western Europe", + u"name": u"Belgium", + u"continent": u"Europe" }, - "BF": { - "region": "Western Africa", - "name": "Burkina Faso", - "continent": "Africa" + u"BF": { + u"region": u"Western Africa", + u"name": u"Burkina Faso", + u"continent": u"Africa" }, - "BG": { - "region": "Eastern Europe", - "name": "Bulgaria", - "continent": "Europe" + u"BG": { + u"region": u"Eastern Europe", + u"name": u"Bulgaria", + u"continent": u"Europe" }, - "BA": { - "region": "Southern Europe", - "name": "Bosnia and Herzegovina", - "continent": "Europe" + u"BA": { + u"region": u"Southern Europe", + u"name": u"Bosnia and Herzegovina", + u"continent": u"Europe" }, - "BB": { - "region": "Caribbean", - "name": "Barbados", - "continent": "South America" + u"BB": { + u"region": u"Caribbean", + u"name": u"Barbados", + u"continent": u"South America" }, - "AE-SH": { - "region": "Western Asia", - "name": "Sharjah", - "continent": "Asia" + u"AE-SH": { + u"region": u"Western Asia", + u"name": u"Sharjah", + u"continent": u"Asia" }, - "BL": { - "region": "Caribbean", - "name": "Saint Barthélemy", - "continent": "South America" + u"BL": { + u"region": u"Caribbean", + u"name": u"Saint Barthélemy", + u"continent": u"South America" }, - "BM": { - "region": "Northern America", - "name": "Bermuda", - "continent": "North America" + u"BM": { + u"region": u"Northern America", + u"name": u"Bermuda", + u"continent": u"North America" }, - "BN": { - "region": "South-Eastern Asia", - "aliases": [ - "Brunei Darussalam" + u"BN": { + u"region": u"South-Eastern Asia", + u"aliases": [ + u"Brunei Darussalam" ], - "name": "Brunei", - "continent": "Asia" + u"name": u"Brunei", + u"continent": u"Asia" }, - "BO": { - "region": "Southern America", - "name": "Bolivia", - "continent": "South America" + u"BO": { + u"region": u"Southern America", + u"name": u"Bolivia", + u"continent": u"South America" }, - "BH": { - "region": "Western Asia", - "name": "Bahrain", - "continent": "Asia" + u"BH": { + u"region": u"Western Asia", + u"name": u"Bahrain", + u"continent": u"Asia" }, - "BI": { - "region": "Eastern Africa", - "name": "Burundi", - "continent": "Africa" + u"BI": { + u"region": u"Eastern Africa", + u"name": u"Burundi", + u"continent": u"Africa" }, - "BJ": { - "region": "Western Africa", - "name": "Benin", - "continent": "Africa" + u"BJ": { + u"region": u"Western Africa", + u"name": u"Benin", + u"continent": u"Africa" }, - "BT": { - "region": "Southern Asia", - "name": "Bhutan", - "continent": "Asia" + u"BT": { + u"region": u"Southern Asia", + u"name": u"Bhutan", + u"continent": u"Asia" }, - "BV": { - "region": "Antarctica", - "name": "Bouvet Island", - "continent": "Antarctica" + u"BV": { + u"region": u"Antarctica", + u"name": u"Bouvet Island", + u"continent": u"Antarctica" }, - "BW": { - "region": "Southern Africa", - "name": "Botswana", - "continent": "Africa" + u"BW": { + u"region": u"Southern Africa", + u"name": u"Botswana", + u"continent": u"Africa" }, - "BQ": { - "region": "Caribbean", - "name": "Bonaire, Sint Eustatius and Saba", - "continent": "South America" + u"BQ": { + u"region": u"Caribbean", + u"name": u"Bonaire, Sint Eustatius and Saba", + u"continent": u"South America" }, - "BR": { - "region": "Southern America", - "name": "Brazil", - "continent": "South America" + u"BR": { + u"region": u"Southern America", + u"name": u"Brazil", + u"continent": u"South America" }, - "BS": { - "region": "Caribbean", - "aliases": [ - "The Bahamas" + u"BS": { + u"region": u"Caribbean", + u"aliases": [ + u"The Bahamas" ], - "name": "Bahamas", - "continent": "South America" + u"name": u"Bahamas", + u"continent": u"South America" }, - "BY": { - "region": "Eastern Europe", - "name": "Belarus", - "continent": "Europe" + u"BY": { + u"region": u"Eastern Europe", + u"name": u"Belarus", + u"continent": u"Europe" }, - "BZ": { - "region": "Central America", - "name": "Belize", - "continent": "South America" + u"BZ": { + u"region": u"Central America", + u"name": u"Belize", + u"continent": u"South America" }, - "DYBJ": { - "region": "Western Africa", - "name": "Dahomey", - "continent": "Africa" + u"DYBJ": { + u"region": u"Western Africa", + u"name": u"Dahomey", + u"continent": u"Africa" }, - "IN-JK": { - "region": "Southern Asia", - "name": "Jammu and Kashmir", - "continent": "Asia" + u"IN-JK": { + u"region": u"Southern Asia", + u"name": u"Jammu and Kashmir", + u"continent": u"Asia" }, - "GG-SA": { - "region": "Northern Europe", - "name": "Sark", - "continent": "Europe" + u"GG-SA": { + u"region": u"Northern Europe", + u"name": u"Sark", + u"continent": u"Europe" }, - "CY-NC": { - "region": "Western Asia", - "name": "Northern Cyprus", - "continent": "Asia" + u"CY-NC": { + u"region": u"Western Asia", + u"name": u"Northern Cyprus", + u"continent": u"Asia" }, - "ML-AZ": { - "region": "Western Africa", - "name": "Azawad", - "continent": "Africa" + u"ML-AZ": { + u"region": u"Western Africa", + u"name": u"Azawad", + u"continent": u"Africa" }, - "OM": { - "region": "Western Asia", - "name": "Oman", - "continent": "Asia" + u"OM": { + u"region": u"Western Asia", + u"name": u"Oman", + u"continent": u"Asia" }, - "DDDE": { - "region": "Western Europe", - "name": "East Germany", - "continent": "Europe" + u"DDDE": { + u"region": u"Western Europe", + u"name": u"East Germany", + u"continent": u"Europe" }, - "PCHH": { - "region": "Micronesia", - "name": "Pacific Islands", - "continent": "Oceania" + u"PCHH": { + u"region": u"Micronesia", + u"name": u"Pacific Islands", + u"continent": u"Oceania" }, - "HR": { - "region": "Southern Europe", - "name": "Croatia", - "continent": "Europe" + u"HR": { + u"region": u"Southern Europe", + u"name": u"Croatia", + u"continent": u"Europe" }, - "AC": { - "region": "Western Africa", - "name": "Ascension", - "continent": "Africa" + u"AC": { + u"region": u"Western Africa", + u"name": u"Ascension", + u"continent": u"Africa" }, - "HT": { - "region": "Caribbean", - "name": "Haiti", - "continent": "South America" + u"HT": { + u"region": u"Caribbean", + u"name": u"Haiti", + u"continent": u"South America" }, - "FQHH": { - "region": "Antarctica", - "name": "French Southern and Antarctic Territories", - "continent": "Antarctica" + u"FQHH": { + u"region": u"Antarctica", + u"name": u"French Southern and Antarctic Territories", + u"continent": u"Antarctica" }, - "HK": { - "region": "Eastern Asia", - "name": "Hong Kong", - "continent": "Asia" + u"HK": { + u"region": u"Eastern Asia", + u"name": u"Hong Kong", + u"continent": u"Asia" }, - "HN": { - "region": "Central America", - "name": "Honduras", - "continent": "South America" + u"HN": { + u"region": u"Central America", + u"name": u"Honduras", + u"continent": u"South America" }, - "HM": { - "region": "Antarctica", - "name": "Heard Island and McDonald Islands", - "continent": "Antarctica" + u"HM": { + u"region": u"Antarctica", + u"name": u"Heard Island and McDonald Islands", + u"continent": u"Antarctica" }, - "PUUM": { - "region": "Polynesia", - "name": "United States Miscellaneous Pacific Islands", - "continent": "Oceania" + u"PUUM": { + u"region": u"Polynesia", + u"name": u"United States Miscellaneous Pacific Islands", + u"continent": u"Oceania" }, - "GETV": { - "region": "Polynesia", - "name": "Ellice Islands", - "continent": "Oceania" + u"GETV": { + u"region": u"Polynesia", + u"name": u"Ellice Islands", + u"continent": u"Oceania" }, - "ZA-VE": { - "region": "Southern Africa", - "name": "Venda", - "continent": "Africa" + u"ZA-VE": { + u"region": u"Southern Africa", + u"name": u"Venda", + u"continent": u"Africa" }, - "GBAE": { - "region": "Western Asia", - "name": "Trucial States", - "continent": "Asia" + u"GBAE": { + u"region": u"Western Asia", + u"name": u"Trucial States", + u"continent": u"Asia" }, - "KHKA": { - "region": "South-Eastern Asia", - "name": "Khmer Republic", - "continent": "Asia" + u"KHKA": { + u"region": u"South-Eastern Asia", + u"name": u"Khmer Republic", + u"continent": u"Asia" }, - "UY": { - "region": "Southern America", - "name": "Uruguay", - "continent": "South America" + u"UY": { + u"region": u"Southern America", + u"name": u"Uruguay", + u"continent": u"South America" }, - "UZ": { - "region": "Central Asia", - "name": "Uzbekistan", - "continent": "Asia" + u"UZ": { + u"region": u"Central Asia", + u"name": u"Uzbekistan", + u"continent": u"Asia" }, - "US": { - "region": "Northern America", - "aliases": [ - "USA" + u"US": { + u"region": u"Northern America", + u"aliases": [ + u"USA" ], - "name": "United States", - "continent": "North America" + u"name": u"United States", + u"continent": u"North America" }, - "UM": { - "region": "Polynesia", - "name": "United States Minor Outlying Islands", - "continent": "Oceania" + u"UM": { + u"region": u"Polynesia", + u"name": u"United States Minor Outlying Islands", + u"continent": u"Oceania" }, - "UK": { - "region": "Northern Europe", - "aliases": [ - "UK" + u"UK": { + u"region": u"Northern Europe", + u"aliases": [ + u"UK" ], - "name": "United Kingdom", - "continent": "Europe" + u"name": u"United Kingdom", + u"continent": u"Europe" }, - "AU": { - "region": "Australia and New Zealand", - "name": "Australia", - "continent": "Oceania" + u"AU": { + u"region": u"Australia and New Zealand", + u"name": u"Australia", + u"continent": u"Oceania" }, - "UG": { - "region": "Eastern Africa", - "name": "Uganda", - "continent": "Africa" + u"UG": { + u"region": u"Eastern Africa", + u"name": u"Uganda", + u"continent": u"Africa" }, - "UA": { - "region": "Eastern Europe", - "name": "Ukraine", - "continent": "Europe" + u"UA": { + u"region": u"Eastern Europe", + u"name": u"Ukraine", + u"continent": u"Europe" }, - "RHZW-RH": { - "region": "Eastern Africa", - "name": "Rhodesia", - "continent": "Africa" + u"RHZW-RH": { + u"region": u"Eastern Africa", + u"name": u"Rhodesia", + u"continent": u"Africa" }, - "NI": { - "region": "Central America", - "name": "Nicaragua", - "continent": "South America" + u"NI": { + u"region": u"Central America", + u"name": u"Nicaragua", + u"continent": u"South America" }, - "NL": { - "region": "Western Europe", - "name": "Netherlands", - "continent": "Europe" + u"NL": { + u"region": u"Western Europe", + u"name": u"Netherlands", + u"continent": u"Europe" }, - "NO": { - "region": "Northern Europe", - "name": "Norway", - "continent": "Europe" + u"NO": { + u"region": u"Northern Europe", + u"name": u"Norway", + u"continent": u"Europe" }, - "NA": { - "region": "Southern Africa", - "name": "Namibia", - "continent": "Africa" + u"NA": { + u"region": u"Southern Africa", + u"name": u"Namibia", + u"continent": u"Africa" }, - "NC": { - "region": "Melanesia", - "name": "New Caledonia", - "continent": "Oceania" + u"NC": { + u"region": u"Melanesia", + u"name": u"New Caledonia", + u"continent": u"Oceania" }, - "NE": { - "region": "Western Africa", - "name": "Niger", - "continent": "Africa" + u"NE": { + u"region": u"Western Africa", + u"name": u"Niger", + u"continent": u"Africa" }, - "NF": { - "region": "Australia and New Zealand", - "name": "Norfolk Island", - "continent": "Oceania" + u"NF": { + u"region": u"Australia and New Zealand", + u"name": u"Norfolk Island", + u"continent": u"Oceania" }, - "NG": { - "region": "Western Africa", - "name": "Nigeria", - "continent": "Africa" + u"NG": { + u"region": u"Western Africa", + u"name": u"Nigeria", + u"continent": u"Africa" }, - "NZ": { - "region": "Australia and New Zealand", - "name": "New Zealand", - "continent": "Oceania" + u"NZ": { + u"region": u"Australia and New Zealand", + u"name": u"New Zealand", + u"continent": u"Oceania" }, - "NP": { - "region": "Southern Asia", - "name": "Nepal", - "continent": "Asia" + u"NP": { + u"region": u"Southern Asia", + u"name": u"Nepal", + u"continent": u"Asia" }, - "AZ-NK": { - "region": "Western Asia", - "name": "Nagorno-Karabakh", - "continent": "Asia" + u"AZ-NK": { + u"region": u"Western Asia", + u"name": u"Nagorno-Karabakh", + u"continent": u"Asia" }, - "NU": { - "region": "Polynesia", - "name": "Niue", - "continent": "Oceania" + u"NU": { + u"region": u"Polynesia", + u"name": u"Niue", + u"continent": u"Oceania" }, - "HU": { - "region": "Eastern Europe", - "name": "Hungary", - "continent": "Europe" + u"HU": { + u"region": u"Eastern Europe", + u"name": u"Hungary", + u"continent": u"Europe" }, - "RHZW": { - "region": "Eastern Africa", - "name": "Southern Rhodesia", - "continent": "Africa" + u"RHZW": { + u"region": u"Eastern Africa", + u"name": u"Southern Rhodesia", + u"continent": u"Africa" }, - "AE-DU": { - "region": "Western Asia", - "name": "Dubai", - "continent": "Asia" + u"AE-DU": { + u"region": u"Western Asia", + u"name": u"Dubai", + u"continent": u"Asia" }, - "GB-SCT": { - "region": "Northern Europe", - "name": "Scotland", - "continent": "Europe" + u"GB-SCT": { + u"region": u"Northern Europe", + u"name": u"Scotland", + u"continent": u"Europe" }, - "TZ": { - "region": "Eastern Africa", - "name": "Tanzania", - "continent": "Africa" + u"TZ": { + u"region": u"Eastern Africa", + u"name": u"Tanzania", + u"continent": u"Africa" }, - "TV": { - "region": "Polynesia", - "name": "Tuvalu", - "continent": "Oceania" + u"TV": { + u"region": u"Polynesia", + u"name": u"Tuvalu", + u"continent": u"Oceania" }, - "TW": { - "region": "Eastern Asia", - "name": "Taiwan", - "continent": "Asia" + u"TW": { + u"region": u"Eastern Asia", + u"name": u"Taiwan", + u"continent": u"Asia" }, - "TT": { - "region": "Caribbean", - "name": "Trinidad and Tobago", - "continent": "South America" + u"TT": { + u"region": u"Caribbean", + u"name": u"Trinidad and Tobago", + u"continent": u"South America" }, - "CL": { - "region": "Southern America", - "name": "Chile", - "continent": "South America" + u"CL": { + u"region": u"Southern America", + u"name": u"Chile", + u"continent": u"South America" }, - "TR": { - "region": "Western Asia", - "name": "Turkey", - "continent": "Asia" + u"TR": { + u"region": u"Western Asia", + u"name": u"Turkey", + u"continent": u"Asia" }, - "TN": { - "region": "Northern Africa", - "name": "Tunisia", - "continent": "Africa" + u"TN": { + u"region": u"Northern Africa", + u"name": u"Tunisia", + u"continent": u"Africa" }, - "TO": { - "region": "Polynesia", - "name": "Tonga", - "continent": "Oceania" + u"TO": { + u"region": u"Polynesia", + u"name": u"Tonga", + u"continent": u"Oceania" }, - "TL": { - "region": "South-Eastern Asia", - "name": "Timor-Leste", - "continent": "Asia" + u"TL": { + u"region": u"South-Eastern Asia", + u"name": u"Timor-Leste", + u"continent": u"Asia" }, - "TM": { - "region": "Central Asia", - "name": "Turkmenistan", - "continent": "Asia" + u"TM": { + u"region": u"Central Asia", + u"name": u"Turkmenistan", + u"continent": u"Asia" }, - "TJ": { - "region": "Central Asia", - "name": "Tajikistan", - "continent": "Asia" + u"TJ": { + u"region": u"Central Asia", + u"name": u"Tajikistan", + u"continent": u"Asia" }, - "TK": { - "region": "Polynesia", - "name": "Tokelau", - "continent": "Oceania" + u"TK": { + u"region": u"Polynesia", + u"name": u"Tokelau", + u"continent": u"Oceania" }, - "TH": { - "region": "South-Eastern Asia", - "name": "Thailand", - "continent": "Asia" + u"TH": { + u"region": u"South-Eastern Asia", + u"name": u"Thailand", + u"continent": u"Asia" }, - "TF": { - "region": "Antarctica", - "name": "French Southern Territories", - "continent": "Antarctica" + u"TF": { + u"region": u"Antarctica", + u"name": u"French Southern Territories", + u"continent": u"Antarctica" }, - "TG": { - "region": "Western Africa", - "name": "Togo", - "continent": "Africa" + u"TG": { + u"region": u"Western Africa", + u"name": u"Togo", + u"continent": u"Africa" }, - "TD": { - "region": "Middle Africa", - "name": "Chad", - "continent": "Africa" + u"TD": { + u"region": u"Middle Africa", + u"name": u"Chad", + u"continent": u"Africa" }, - "TC": { - "region": "Caribbean", - "name": "Turks and Caicos Islands", - "continent": "South America" + u"TC": { + u"region": u"Caribbean", + u"name": u"Turks and Caicos Islands", + u"continent": u"South America" }, - "TA": { - "region": "Western Africa", - "name": "Tristan da Cunha", - "continent": "Africa" + u"TA": { + u"region": u"Western Africa", + u"name": u"Tristan da Cunha", + u"continent": u"Africa" }, - "GE-SK": { - "region": "Western Asia", - "name": "South Ossetia", - "continent": "Asia" + u"GE-SK": { + u"region": u"Western Asia", + u"name": u"South Ossetia", + u"continent": u"Asia" }, - "AE": { - "region": "Western Asia", - "name": "United Arab Emirates", - "continent": "Asia" + u"AE": { + u"region": u"Western Asia", + u"name": u"United Arab Emirates", + u"continent": u"Asia" }, - "AD": { - "region": "Southern Europe", - "name": "Andorra", - "continent": "Europe" + u"AD": { + u"region": u"Southern Europe", + u"name": u"Andorra", + u"continent": u"Europe" }, - "AG": { - "region": "Caribbean", - "name": "Antigua and Barbuda", - "continent": "South America" + u"AG": { + u"region": u"Caribbean", + u"name": u"Antigua and Barbuda", + u"continent": u"South America" }, - "AF": { - "region": "Southern Asia", - "name": "Afghanistan", - "continent": "Asia" + u"AF": { + u"region": u"Southern Asia", + u"name": u"Afghanistan", + u"continent": u"Asia" }, - "AI": { - "region": "Caribbean", - "name": "Anguilla", - "continent": "South America" + u"AI": { + u"region": u"Caribbean", + u"name": u"Anguilla", + u"continent": u"South America" }, - "AM": { - "region": "Western Asia", - "name": "Armenia", - "continent": "Asia" + u"AM": { + u"region": u"Western Asia", + u"name": u"Armenia", + u"continent": u"Asia" }, - "AL": { - "region": "Southern Europe", - "name": "Albania", - "continent": "Europe" + u"AL": { + u"region": u"Southern Europe", + u"name": u"Albania", + u"continent": u"Europe" }, - "AO": { - "region": "Middle Africa", - "name": "Angola", - "continent": "Africa" + u"AO": { + u"region": u"Middle Africa", + u"name": u"Angola", + u"continent": u"Africa" }, - "AQ": { - "region": "Antarctica", - "name": "Antarctica", - "continent": "Antarctica" + u"AQ": { + u"region": u"Antarctica", + u"name": u"Antarctica", + u"continent": u"Antarctica" }, - "AS": { - "region": "Polynesia", - "name": "American Samoa", - "continent": "Oceania" + u"AS": { + u"region": u"Polynesia", + u"name": u"American Samoa", + u"continent": u"Oceania" }, - "AR": { - "region": "Southern America", - "name": "Argentina", - "continent": "South America" + u"AR": { + u"region": u"Southern America", + u"name": u"Argentina", + u"continent": u"South America" }, - "EGEG": { - "region": "Northern Africa", - "name": "United Arab Republic", - "continent": "Africa" + u"EGEG": { + u"region": u"Northern Africa", + u"name": u"United Arab Republic", + u"continent": u"Africa" }, - "AT": { - "region": "Western Europe", - "name": "Austria", - "continent": "Europe" + u"AT": { + u"region": u"Western Europe", + u"name": u"Austria", + u"continent": u"Europe" }, - "AW": { - "region": "Caribbean", - "name": "Aruba", - "continent": "South America" + u"AW": { + u"region": u"Caribbean", + u"name": u"Aruba", + u"continent": u"South America" }, - "AX": { - "region": "Northern Europe", - "name": "Åland Islands", - "continent": "Europe" + u"AX": { + u"region": u"Northern Europe", + u"name": u"Åland Islands", + u"continent": u"Europe" }, - "AZ": { - "region": "Western Asia", - "name": "Azerbaijan", - "continent": "Asia" + u"AZ": { + u"region": u"Western Asia", + u"name": u"Azerbaijan", + u"continent": u"Asia" }, - "YDYE": { - "region": "Western Asia", - "name": "South Yemen", - "continent": "Asia" + u"YDYE": { + u"region": u"Western Asia", + u"name": u"South Yemen", + u"continent": u"Asia" } } @@ -1911,13 +1912,13 @@ def get_area(southwest, northeast): ) * abs(southwest['lng'] - northeast['lng']); def get_country(code_or_name): - if isinstance(code_or_name, unicode): - code_or_name = code_or_name.encode('utf-8') + if isinstance(code_or_name, bytes): + code_or_name = code_or_name.decode('utf-8') if len(code_or_name) == 2: code_or_name = code_or_name.upper() return COUNTRIES[code_or_name] if code_or_name in COUNTRIES else {} else: - for code, country in COUNTRIES.iteritems(): + for code, country in COUNTRIES.items(): if code_or_name == country['name'] or ( 'aliases' in country and code_or_name in country['aliases'] ): @@ -1929,23 +1930,23 @@ def get_country_name(country_code): return COUNTRIES[country_code]['name'] if country_code in COUNTRIES else '' def normalize_country_name(country_name): - if isinstance(country_name, unicode): - country_name = country_name.encode('utf-8') + if isinstance(country_name, bytes): + country_name = country_name.decode('utf-8') name = None - for code, country in COUNTRIES.iteritems(): + for code, country in COUNTRIES.items(): if country_name == country['name'] or ( 'aliases' in country and country_name in country['aliases'] ): name = country['name'] break - return name and name.decode('utf-8') + return name def split_geoname(geoname): - if isinstance(geoname, unicode): - geoname = geoname.encode('utf-8') + if isinstance(geoname, bytes): + geoname = geoname.decode('utf-8') countries = [ - 'Bonaire, Sint Eustatius and Saba', - 'Saint Helena, Ascension and Tristan da Cunha' + u'Bonaire, Sint Eustatius and Saba', + u'Saint Helena, Ascension and Tristan da Cunha' ] for country in countries: if geoname.endswith(country): diff --git a/ox/html.py b/ox/html.py index 549e32f..2ba6179 100644 --- a/ox/html.py +++ b/ox/html.py @@ -1,9 +1,11 @@ # -*- coding: utf-8 -*- # vi:si:et:sw=4:sts=4:ts=4 # GPL 2008 +import sys import re import string -from htmlentitydefs import name2codepoint +from six.moves.html_entities import name2codepoint +from six import unichr # Configuration for add_links() function @@ -23,7 +25,8 @@ link_target_attribute_re = re.compile(r'(]*?)target=[^\s>]+') html_gunk_re = re.compile(r'(?:
|<\/i>|<\/b>|<\/em>|<\/strong>|<\/?smallcaps>|<\/?uppercase>)', re.IGNORECASE) hard_coded_bullets_re = re.compile(r'((?:

(?:%s).*?[a-zA-Z].*?

\s*)+)' % '|'.join([re.escape(x) for x in DOTS]), re.DOTALL) trailing_empty_content_re = re.compile(r'(?:

(?: |\s|
)*?

\s*)+\Z') -del x # Temporary variable +if sys.version[0] == 2: + del x # Temporary variable def escape(html): ''' @@ -146,12 +149,9 @@ def decode_html(html): >>> decode_html('Anniversary of Daoud's Republic') u"Anniversary of Daoud's Republic" """ - if type(html) != unicode: - html = unicode(html)[:] - if type(html) is unicode: - uchr = unichr - else: - uchr = lambda value: value > 255 and unichr(value) or chr(value) + if isinstance(html, bytes): + html = html.decode('utf-8') + uchr = unichr def entitydecode(match, uchr=uchr): entity = match.group(1) if entity == '#x80': diff --git a/ox/jsonc.py b/ox/jsonc.py index 0090244..9006d5c 100644 --- a/ox/jsonc.py +++ b/ox/jsonc.py @@ -1,10 +1,10 @@ #!/usr/bin/python # -*- coding: utf-8 -*- # vi:si:et:sw=4:sts=4:ts=4 -from __future__ import with_statement +from __future__ import with_statement, print_function -from js import minify -from utils import json +from .js import minify +from .utils import json def load(f): @@ -14,7 +14,7 @@ def loads(source): try: minified = minify(source) return json.loads(minified) - except json.JSONDecodeError, e: + except json.JSONDecodeError as e: s = minified.split('\n') context = s[e.lineno-1][max(0, e.colno-1):e.colno+30] msg = e.msg + ' at ' + context diff --git a/ox/movie.py b/ox/movie.py index 4ee95a1..e74b8a6 100644 --- a/ox/movie.py +++ b/ox/movie.py @@ -9,9 +9,9 @@ import os import re import unicodedata -from normalize import normalize_name -from text import get_sort_name, find_re -from file import EXTENSIONS +from .normalize import normalize_name +from .text import get_sort_name, find_re +from .file import EXTENSIONS __all__ = ['parse_movie_path', 'create_movie_path', 'get_oxid'] diff --git a/ox/net.py b/ox/net.py index 819a34e..a598d2f 100644 --- a/ox/net.py +++ b/ox/net.py @@ -1,13 +1,13 @@ # -*- coding: utf-8 -*- # vi:si:et:sw=4:sts=4:ts=4 # GPL 2008 +from __future__ import with_statement, print_function import os import gzip import re -import StringIO +from six import BytesIO import struct -import urllib -import urllib2 +from six.moves import urllib from chardet.universaldetector import UniversalDetector @@ -26,7 +26,7 @@ def status(url, data=None, headers=DEFAULT_HEADERS): try: f = open_url(url, data, headers) s = f.code - except urllib2.HTTPError, e: + except urllib.error.HTTPError as e: s = e.code return s @@ -42,46 +42,59 @@ def get_headers(url, data=None, headers=DEFAULT_HEADERS): f.headers['Status'] = "%s" % f.code headers = f.headers f.close() - except urllib2.HTTPError, e: + except urllib.error.HTTPError as e: e.headers['Status'] = "%s" % e.code headers = e.headers return dict(headers) def open_url(url, data=None, headers=DEFAULT_HEADERS): + if isinstance(url, bytes): + url = url.decode('utf-8') url = url.replace(' ', '%20') - req = urllib2.Request(url, data, headers) - return urllib2.urlopen(req) + req = urllib.request.Request(url, data, headers) + return urllib.request.urlopen(req) def read_url(url, data=None, headers=DEFAULT_HEADERS, return_headers=False, unicode=False): if DEBUG: - print 'ox.net.read_url', url + print('ox.net.read_url', url) f = open_url(url, data, headers) result = f.read() f.close() if f.headers.get('content-encoding', None) == 'gzip': - result = gzip.GzipFile(fileobj=StringIO.StringIO(result)).read() + result = gzip.GzipFile(fileobj=BytesIO(result)).read() if unicode: - encoding = detect_encoding(result) + ctype = f.headers.get('content-type', '').lower() + if 'charset' in ctype: + encoding = ctype.split('charset=')[-1] + else: + encoding = detect_encoding(result) if not encoding: encoding = 'latin-1' result = result.decode(encoding) if return_headers: f.headers['Status'] = "%s" % f.code - return dict(f.headers), result + headers = {} + for key in f.headers: + headers[key.lower()] = f.headers[key] + return headers, result return result def detect_encoding(data): - data_lower = data.lower() - charset = re.compile('content="text/html; charset=(.*?)"').findall(data) + data_lower = data.lower().decode('utf-8', 'ignore') + charset = re.compile('content="text/html; charset=(.*?)"').findall(data_lower) if not charset: - charset = re.compile('meta charset="(.*?)"').findall(data) + charset = re.compile('meta charset="(.*?)"').findall(data_lower) if charset: return charset[0].lower() detector = UniversalDetector() - for line in data.split('\n'): - detector.feed(line) + p = 0 + l = len(data) + s = 1024 + while p < l: + detector.feed(data[p:p+s]) if detector.done: break + p += s detector.close() return detector.result['encoding'] @@ -97,9 +110,9 @@ def save_url(url, filename, overwrite=False): def oshash(url): def get_size(url): - req = urllib2.Request(url, headers=DEFAULT_HEADERS.copy()) + req = urllib.request.Request(url, headers=DEFAULT_HEADERS.copy()) req.get_method = lambda : 'HEAD' - u = urllib2.urlopen(req) + u = urllib.request.urlopen(req) if u.code != 200 or not 'Content-Length' in u.headers: raise IOError return int(u.headers['Content-Length']) @@ -107,8 +120,8 @@ def oshash(url): def get_range(url, start, end): headers = DEFAULT_HEADERS.copy() headers['Range'] = 'bytes=%s-%s' % (start, end) - req = urllib2.Request(url, headers=headers) - u = urllib2.urlopen(req) + req = urllib.request.Request(url, headers=headers) + u = urllib.request.urlopen(req) return u.read() try: diff --git a/ox/oembed.py b/ox/oembed.py index 5bdcbd9..f9f1717 100644 --- a/ox/oembed.py +++ b/ox/oembed.py @@ -1,9 +1,10 @@ # -*- coding: utf-8 -*- # ci:si:et:sw=4:sts=4:ts=4 import re -from text import find_re -import cache -from utils import json, ET + +from . import cache +from .text import find_re +from .utils import json, ET def get_embed_code(url, maxwidth=None, maxheight=None): embed = {} diff --git a/ox/srt.py b/ox/srt.py index 32f893a..ee5a982 100644 --- a/ox/srt.py +++ b/ox/srt.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # vi:si:et:sw=4:sts=4:ts=4 -from __future__ import with_statement, division +from __future__ import with_statement, division, print_function import chardet import re import codecs @@ -71,7 +71,7 @@ def load(filename, offset=0): try: data = unicode(data, 'latin-1') except: - print "failed to detect encoding, giving up" + print("failed to detect encoding, giving up") return srt data = data.replace('\r\n', '\n') diff --git a/ox/torrent/__init__.py b/ox/torrent/__init__.py index 992e8d5..ce8b0de 100644 --- a/ox/torrent/__init__.py +++ b/ox/torrent/__init__.py @@ -6,7 +6,7 @@ from threading import Event from hashlib import sha1 import os -from bencode import bencode, bdecode +from .bencode import bencode, bdecode __all__ = ['create_torrent', 'get_info_hash', 'get_torrent_info', 'get_files', 'get_torrent_size'] @@ -24,9 +24,8 @@ def get_info_hash(torrentFile): return sha1(bencode(info)).hexdigest() def get_torrent_info(data=None, file=None): - from bencode import bencode if file: - if isinstance(file, unicode): + if not isinstance(file, bytes): file = file.encode('utf-8') with open(file, 'rb') as f: data = f.read() @@ -36,7 +35,7 @@ def get_torrent_info(data=None, file=None): metainfo = bdecode(data) info = metainfo['info'] piece_length = info['piece length'] - if info.has_key('length'): + if 'length' in info: # let's assume we just have one file file_length = info['length'] else: diff --git a/ox/web/__init__.py b/ox/web/__init__.py index 1b94046..5db29d8 100644 --- a/ox/web/__init__.py +++ b/ox/web/__init__.py @@ -2,8 +2,8 @@ # encoding: utf-8 __version__ = '1.0.0' -import imdb -import wikipedia -import google -import piratecinema -import oxdb +from . import imdb +from . import wikipedia +from . import google +from . import piratecinema +from . import oxdb diff --git a/ox/web/allmovie.py b/ox/web/allmovie.py index 879d1e4..3839cf7 100644 --- a/ox/web/allmovie.py +++ b/ox/web/allmovie.py @@ -1,7 +1,6 @@ # -*- coding: utf-8 -*- # vi:si:et:sw=4:sts=4:ts=4 import re -import time from ox import strip_tags, find_re from ox.cache import read_url diff --git a/ox/web/amazon.py b/ox/web/amazon.py index c4490ff..59f65f0 100644 --- a/ox/web/amazon.py +++ b/ox/web/amazon.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- # vi:si:et:sw=4:sts=4:ts=4 import re -from urllib import quote +from six.moves.urllib.parse import quote from ox import find_re, strip_tags, decode_html from ox.cache import read_url diff --git a/ox/web/arsenalberlin.py b/ox/web/arsenalberlin.py index 64112ac..647c821 100644 --- a/ox/web/arsenalberlin.py +++ b/ox/web/arsenalberlin.py @@ -1,14 +1,11 @@ # -*- coding: utf-8 -*- # vi:si:et:sw=4:sts=4:ts=4 -from datetime import datetime -from urllib import urlencode import json import os import re -from ox import find_re, strip_tags, decode_html +from ox import find_re, strip_tags from ox.cache import read_url -from ox.net import open_url def get_data(id, language='en'): if language == 'de': @@ -57,7 +54,7 @@ def backup(filename): data = json.load(f) else: data = {} - start = ids and max(map(int, data)) or 1 + start = max(map(int, data)) or 1 for i in range(start, 11872): info = get_data(i) if info: diff --git a/ox/web/criterion.py b/ox/web/criterion.py index 539663a..3d8ec07 100644 --- a/ox/web/criterion.py +++ b/ox/web/criterion.py @@ -5,7 +5,7 @@ import re import ox.cache from ox.cache import read_url from ox.html import strip_tags -from ox.text import find_re, remove_special_characters +from ox.text import find_re import imdb diff --git a/ox/web/dailymotion.py b/ox/web/dailymotion.py index 9417275..90a3fff 100644 --- a/ox/web/dailymotion.py +++ b/ox/web/dailymotion.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- # vi:si:et:sw=4:sts=4:ts=4 import re -from urllib import unquote +from six.moves.urllib.parse import unquote from ox.cache import read_url diff --git a/ox/web/duckduckgo.py b/ox/web/duckduckgo.py index d60578a..a8f7869 100644 --- a/ox/web/duckduckgo.py +++ b/ox/web/duckduckgo.py @@ -1,17 +1,17 @@ # -*- coding: utf-8 -*- # vi:si:et:sw=4:sts=4:ts=4 import re -import urllib + +from six.moves import urllib import ox from ox import strip_tags, decode_html -from ox.utils import json from ox.cache import read_url def find(query, timeout=ox.cache.cache_timeout): - if isinstance(query, unicode): + if not isinstance(query, bytes): query = query.encode('utf-8') - params = urllib.urlencode({'q': query}) + params = urllib.parse.urlencode({'q': query}) url = 'http://duckduckgo.com/html/?' + params data = read_url(url, timeout=timeout).decode('utf-8') results = [] diff --git a/ox/web/google.py b/ox/web/google.py index c247ad6..fc1f420 100644 --- a/ox/web/google.py +++ b/ox/web/google.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- # vi:si:et:sw=4:sts=4:ts=4 import re -import urllib +from six.moves import urllib import ox from ox import strip_tags, decode_html @@ -13,9 +13,9 @@ def read_url(url, data=None, headers=ox.net.DEFAULT_HEADERS, timeout=DEFAULT_TIM return ox.cache.read_url(url, data, headers, timeout, unicode=True) def quote_plus(s): - if not isinstance(s, str): + if not isinstance(s, bytes): s = s.encode('utf-8') - return urllib.quote_plus(s) + return urllib.parse.quote_plus(s) def find(query, max_results=DEFAULT_MAX_RESULTS, timeout=DEFAULT_TIMEOUT): """ diff --git a/ox/web/imdb.py b/ox/web/imdb.py index 0423d46..af65154 100644 --- a/ox/web/imdb.py +++ b/ox/web/imdb.py @@ -1,23 +1,27 @@ # -*- coding: utf-8 -*- # vi:si:et:sw=4:sts=4:ts=4 -import urllib +from __future__ import print_function + import re import time import unicodedata -import ox -from ox import find_re, strip_tags -import ox.cache +from six.moves import urllib +from six import string_types -from siteparser import SiteParser -import duckduckgo +from .. import find_re, strip_tags, decode_html +from .. import cache + + +from . siteparser import SiteParser +from . import duckduckgo from ..utils import datetime from ..geo import normalize_country_name -def read_url(url, data=None, headers=ox.cache.DEFAULT_HEADERS, timeout=ox.cache.cache_timeout, valid=None, unicode=False): +def read_url(url, data=None, headers=cache.DEFAULT_HEADERS, timeout=cache.cache_timeout, valid=None, unicode=False): headers = headers.copy() - return ox.cache.read_url(url, data, headers, timeout, unicode=unicode) + return cache.read_url(url, data, headers, timeout, unicode=unicode) def get_url(id): return "http://www.imdb.com/title/tt%s/" % id @@ -49,7 +53,7 @@ class Imdb(SiteParser): 'page': 'business', 're': [ '
Budget
\s*?\$(.*?)(.*?)', - ox.strip_tags, + strip_tags, ], 'type': 'list' }, @@ -326,7 +330,7 @@ class Imdb(SiteParser): if 'alternativeTitles' in self: if len(self['alternativeTitles']) == 2 and \ - isinstance(self['alternativeTitles'][0], basestring): + isinstance(self['alternativeTitles'][0], string_types): self['alternativeTitles'] = [self['alternativeTitles']] #normalize country names @@ -472,7 +476,7 @@ class Imdb(SiteParser): if c: alt[title].append(c) self['alternativeTitles'] = [] - for t in sorted(alt, lambda a, b: cmp(sorted(alt[a]), sorted(alt[b]))): + for t in sorted(alt, key=lambda a: sorted(alt[a])): if alt[t]: countries = sorted([normalize_country_name(c) or c for c in alt[t]]) self['alternativeTitles'].append((t, countries)) @@ -492,7 +496,7 @@ class Imdb(SiteParser): if 'votes' in self: self['votes'] = self['votes'].replace(',', '') if 'cast' in self: - if isinstance(self['cast'][0], basestring): + if isinstance(self['cast'][0], string_types): self['cast'] = [self['cast']] self['actor'] = [c[0] for c in self['cast']] def cleanup_character(c): @@ -503,10 +507,12 @@ class Imdb(SiteParser): if 'connections' in self: cc={} - if len(self['connections']) == 3 and isinstance(self['connections'][0], basestring): + if len(self['connections']) == 3 and isinstance(self['connections'][0], string_types): self['connections'] = [self['connections']] for rel, data, _ in self['connections']: - #cc[unicode(rel)] = re.compile('
(.*?)').findall(data) + if isinstance(rel, bytes): + rel = rel.decode('utf-8') + #cc[rel] = re.compile('(.*?)').findall(data) def get_conn(c): r = { 'id': c[0], @@ -516,14 +522,14 @@ class Imdb(SiteParser): if len(description) == 2 and description[-1].strip() != '-': r['description'] = description[-1].strip() return r - cc[unicode(rel)] = map(get_conn, re.compile('(.*?)(.*?)<\/div', re.DOTALL).findall(data)) + cc[rel] = list(map(get_conn, re.compile('(.*?)(.*?)<\/div', re.DOTALL).findall(data))) self['connections'] = cc for key in ('country', 'genre'): if key in self: - self[key] = filter(lambda x: x.lower() != 'home', self[key]) + self[key] = list(filter(lambda x: x.lower() != 'home', self[key])) #0092999 if '_director' in self: if 'series' in self or 'isSeries' in self: @@ -590,8 +596,8 @@ class Imdb(SiteParser): if key in self: if isinstance(self[key][0], list): self[key] = [i[0] for i in self[key] if i] - self[key] = sorted(list(set(self[key])), - lambda a, b: self[key].index(a) - self[key].index(b)) + self[key] = sorted(list(set(self[key])), key=lambda a: self[key].index(a)) + if 'budget' in self and 'gross' in self: self['profit'] = self['gross'] - self['budget'] @@ -655,7 +661,7 @@ def get_movie_by_title(title, timeout=-1): u'0866567' ''' params = {'s':'tt','q': title} - if isinstance(title, unicode): + if not isinstance(title, bytes): try: params['q'] = unicodedata.normalize('NFKC', params['q']).encode('latin-1') except: @@ -731,7 +737,7 @@ def get_movie_id(title, director='', year='', timeout=-1): if year: params['q'] = u'"%s (%s)" %s' % (title, year, director) google_query = "site:imdb.com %s" % params['q'] - if isinstance(params['q'], unicode): + if not isinstance(params['q'], bytes): try: params['q'] = unicodedata.normalize('NFKC', params['q']).encode('latin-1') except: @@ -775,7 +781,7 @@ def get_movie_poster(imdbId): info = ImdbCombined(imdbId) if 'posterId' in info: url = "http://www.imdb.com/media/rm%s/tt%s" % (info['posterId'], imdbId) - data = read_url(url) + data = read_url(url).decode('utf-8', 'ignore') poster = find_re(data, 'img.*?id="primary-img".*?src="(.*?)"') return poster elif 'series' in info: @@ -787,11 +793,11 @@ def get_episodes(imdbId, season=None): url = 'http://www.imdb.com/title/tt%s/episodes' % imdbId if season: url += '?season=%d' % season - data = ox.cache.read_url(url) + data = cache.read_url(url) for e in re.compile('
.*?
S(\d+), Ep(\d+)<\/div>\n<\/div>', re.DOTALL).findall(data): episodes['S%02dE%02d' %(int(e[1]), int(e[2]))] = e[0] else: - data = ox.cache.read_url(url) + data = cache.read_url(url) match = re.compile('Season (\d+)').findall(data) if match: for season in range(1, int(match[0]) + 1): @@ -800,7 +806,7 @@ def get_episodes(imdbId, season=None): def max_votes(): url = 'http://www.imdb.com/search/title?num_votes=500000,&sort=num_votes,desc' - data = ox.cache.read_url(url) + data = cache.read_url(url) votes = max([int(v.replace(',', '')) for v in re.compile('([\d,]+)').findall(data)]) return votes @@ -810,6 +816,6 @@ def guess(title, director='', timeout=-1): if __name__ == "__main__": import json - print json.dumps(Imdb('0306414'), indent=2) + print(json.dumps(Imdb('0306414'), indent=2)) #print json.dumps(Imdb('0133093'), indent=2) diff --git a/ox/web/piratecinema.py b/ox/web/piratecinema.py index fc74a3a..9ae3c24 100644 --- a/ox/web/piratecinema.py +++ b/ox/web/piratecinema.py @@ -1,5 +1,7 @@ # -*- coding: utf-8 -*- # vi:si:et:sw=4:sts=4:ts=4 +from __future__ import print_function + import re from ox.net import read_url @@ -13,5 +15,5 @@ def get_poster_url(id): return '' if __name__ == '__main__': - print get_poster_url('0749451') + print(get_poster_url('0749451')) diff --git a/ox/web/siteparser.py b/ox/web/siteparser.py index 4b231ba..fa21948 100644 --- a/ox/web/siteparser.py +++ b/ox/web/siteparser.py @@ -2,22 +2,24 @@ # vi:si:et:sw=4:sts=4:ts=4 import re +from six import string_types + from ..cache import read_url -from .. import strip_tags, decode_html +from .. import decode_html from ..utils import datetime def cleanup(key, data, data_type): if data: - if isinstance(data[0], basestring): + if isinstance(data[0], string_types): #FIXME: some types need strip_tags #data = [strip_tags(decode_html(p)).strip() for p in data] data = [decode_html(p).strip() for p in data] elif isinstance(data[0], list) or isinstance(data[0], tuple): data = [cleanup(key, p, data_type) for p in data] - while len(data) == 1 and not isinstance(data, basestring): + while len(data) == 1 and not isinstance(data, string_types): data = data[0] - if data_type == 'list' and isinstance(data, basestring): + if data_type == 'list' and isinstance(data, string_types): data = [data, ] elif data_type != 'list': data = '' @@ -40,7 +42,7 @@ class SiteParser(dict): for key in self.regex: url = self.get_url(self.regex[key]['page']) data = self.read_url(url, timeout) - if isinstance(self.regex[key]['re'], basestring): + if isinstance(self.regex[key]['re'], string_types): data = re.compile(self.regex[key]['re'], re.DOTALL).findall(data) data = cleanup(key, data, self.regex[key]['type']) elif callable(self.regex[key]['re']): @@ -51,7 +53,7 @@ class SiteParser(dict): f = r else: f = re.compile(r, re.DOTALL).findall - if isinstance(data, basestring): + if isinstance(data, string_types): data = f(data) else: data = [f(d) for d in data] diff --git a/ox/web/wikipedia.py b/ox/web/wikipedia.py index d08feb9..0e9d8de 100644 --- a/ox/web/wikipedia.py +++ b/ox/web/wikipedia.py @@ -1,11 +1,14 @@ # -*- coding: utf-8 -*- # vi:si:et:sw=4:sts=4:ts=4 +from __future__ import print_function + import re -from urllib import urlencode + +from six.moves import urllib from ox.utils import json from ox.cache import read_url -from ox import find_re, decode_html +from ox import find_re def get_id(url): @@ -138,11 +141,11 @@ def get_allmovie_id(wikipedia_url): def find(query, max_results=10): query = {'action': 'query', 'list':'search', 'format': 'json', 'srlimit': max_results, 'srwhat': 'text', 'srsearch': query.encode('utf-8')} - url = "http://en.wikipedia.org/w/api.php?" + urlencode(query) + url = "http://en.wikipedia.org/w/api.php?" + urllib.parse.urlencode(query) data = read_url(url) if not data: data = read_url(url, timeout=0) - result = json.loads(data) + result = json.loads(data.decode('utf-8')) results = [] if result and 'query' in result: for r in result['query']['search']: diff --git a/setup.py b/setup.py index e1e208e..6055fba 100644 --- a/setup.py +++ b/setup.py @@ -36,15 +36,16 @@ setup( download_url="http://code.0x2620.org/python-ox/download", license="GPLv3", packages=['ox', 'ox.django', 'ox.django.api', 'ox.torrent', 'ox.web'], - install_requires=['chardet', 'feedparser'], + install_requires=['six', 'chardet', 'feedparser'], keywords = [ ], classifiers = [ 'Operating System :: OS Independent', 'Programming Language :: Python', 'Programming Language :: Python :: 2', - 'Programming Language :: Python :: 2.6', 'Programming Language :: Python :: 2.7', + 'Programming Language :: Python :: 3', + 'Programming Language :: Python :: 3.4', 'Topic :: Software Development :: Libraries :: Python Modules', ], )