diff --git a/Fakeum-2.0.1.alfredworkflow b/Fakeum-2.0.1.alfredworkflow
deleted file mode 100644
index 635d943..0000000
Binary files a/Fakeum-2.0.1.alfredworkflow and /dev/null differ
diff --git a/Fakeum-2.2.0.alfredworkflow b/Fakeum-2.2.0.alfredworkflow
new file mode 100644
index 0000000..32e47b0
Binary files /dev/null and b/Fakeum-2.2.0.alfredworkflow differ
diff --git a/src/common.py b/src/common.py
index 207cd92..e1b7046 100644
--- a/src/common.py
+++ b/src/common.py
@@ -15,9 +15,9 @@
from collections import OrderedDict
import logging
import os
-import subprocess
from workflow import Variables
+from workflow.util import run_applescript
log = logging.getLogger('workflow')
@@ -105,7 +105,7 @@
('th_TH', 'Thai'),
('tr_TR', 'Turkish'),
('uk_UA', 'Ukranian'),
- ))
+))
# Workflow's bundle IDs
@@ -114,19 +114,10 @@
# Script Filter keyword
KEYWORD = os.getenv('keyword')
-# AppleScript to call an External Trigger
-TRIGGER_AS = (u'tell application "Alfred 3" to run trigger "{trigger}" '
- u'in workflow "{bundleid}"')
-
# AppleScript to run an Alfred search
SEARCH_AS = u'tell application "Alfred 3" to search "{query}"'
-def escape_as(s):
- """Escape string for inserting into AppleScript."""
- return s.replace('"', '" & quote & "')
-
-
def boolvar(name, default=False):
"""Return `True` or `False` for a workflow variable."""
v = os.getenv(name)
@@ -156,42 +147,18 @@ def intvar(name, default=0):
return default
-def savevar(name, value):
- """Save a workflow variable by adding it to ``info.plist``."""
- from plistlib import readPlist, writePlist
- if not isinstance(value, basestring):
- value = str(value)
-
- data = readPlist('info.plist')
- data['variables'][name] = value
- writePlist(data, 'info.plist')
- log.debug(u'set workflow variable "%s" to "%s"', name, value)
-
-
-def run_trigger(name, arg=None):
- """Run an external trigger."""
- script = TRIGGER_AS.format(trigger=name, bundleid=BUNDLE_ID)
- if arg:
- script += u' with argument "{}"'.format(escape_as(arg))
-
- msg = u'calling external trigger "{}"'.format(name)
- if arg:
- msg += u' with arg "{}"'.format(arg)
- log.debug(msg + ' ...')
- subprocess.call(['osascript', '-e', script.encode('utf-8')])
-
-
def run_workflow(query=None):
"""Run workflow with query."""
query = KEYWORD + u' ' + (query or '')
script = SEARCH_AS.format(query=query)
log.debug(u'calling Alfred with query "%s" ...', query)
- subprocess.call(['osascript', '-e', script.encode('utf-8')])
+ run_applescript(script)
def notify(title, text=''):
"""Show a notification."""
if not boolvar('SHOW_NOTIFICATIONS'):
return
+
v = Variables(title=title, text=text)
print(v)
diff --git a/src/config.py b/src/config.py
index 7ec9e97..202e5fe 100644
--- a/src/config.py
+++ b/src/config.py
@@ -30,6 +30,7 @@
import sys
from workflow import Workflow3, ICON_WARNING
+from workflow.util import run_trigger, set_config
from common import (
ALL_LOCALES,
@@ -47,9 +48,6 @@
ICON_UPDATE_CHECK,
UPDATE_SETTINGS,
boolvar,
- notify,
- run_trigger,
- savevar,
)
@@ -152,17 +150,14 @@ def toggle_locale(loc):
is_active = loc in active
if is_active:
- msg = u'Deactivated locale {}'.format(ALL_LOCALES.get(loc))
+ log.info(u'Deactivated locale %s', ALL_LOCALES.get(loc))
active.remove(loc)
wf.settings['locales'] = active
else:
- msg = u'Activated locale {}'.format(ALL_LOCALES.get(loc))
+ log.info(u'Activated locale %s', ALL_LOCALES.get(loc))
active.append(loc)
wf.settings['locales'] = active
- log.info(msg)
- notify(msg)
-
run_trigger('locales')
@@ -177,11 +172,8 @@ def toggle_notifications():
what = 'off'
value = '0'
- msg = 'Turned notifications ' + what
- savevar(name, value)
-
- log.info(msg)
- notify(msg)
+ set_config(name, value)
+ log.info('turned notifications ' + what)
run_trigger('config')
diff --git a/src/fakeum.py b/src/fakeum.py
index 6b77541..5bbb07b 100644
--- a/src/fakeum.py
+++ b/src/fakeum.py
@@ -14,10 +14,12 @@
from collections import OrderedDict
import datetime
+import os
import random
import sys
from workflow import Workflow3, ICON_WARNING, MATCH_ALL, MATCH_ALLCHARS
+from workflow.util import run_trigger, set_config
from common import (
DEFAULT_SETTINGS,
@@ -32,6 +34,7 @@
# Number of sentences per paragraph of Lipsum text
LIPSUMS = intvar('LIPSUM_SENTENCES', 3)
+SNIPPET_MODE = os.getenv('SNIPPET_MODE') is not None
# ALFRED_AS = 'tell application "Alfred 2" to search "fake "'
@@ -45,11 +48,15 @@
('Email (free)', 'free_email'),
('Email (safe)', 'safe_email'),
('Email domain (free)', 'free_email_domain'),
+ ('Social Security No.', 'ssn'),
+ ('Phone No.', 'phone_number'),
+ ('MSISDN', 'msisdn'),
# Addresses
('Address', 'address'),
('Street', 'street_address'),
('Street Name', 'street_name'),
('City', 'city'),
+ ('Postcode', 'postcode'),
('State', 'state'),
('State abbr.', 'state_abbr'),
('Country', 'country'),
@@ -62,6 +69,7 @@
('URI', 'uri'),
('URI path', 'uri_path'),
('URL', 'url'),
+ ('User-Agent', 'user_agent'),
# Corporate bullshit
('Corporate BS', 'bs'),
('Corporate catchphrase', 'catch_phrase'),
@@ -69,53 +77,93 @@
('Company suffix', 'company_suffix'),
# Lorem
('Paragraph', 'paragraph'),
- # 'Paragraphs', 'paragraphs',
('Sentence', 'sentence'),
- # 'Sentences', 'sentences',
- # 'Text', 'text',
('Word', 'word'),
- # 'Words', 'words',
# Dates and times
('Date', 'date'),
('Datetime', 'date_time'),
('ISO 8601 Datetime', 'iso8601'),
('Time', 'time'),
('Timezone', 'timezone'),
- ('UNIX timestamp', 'unix_time'),
+ ('UNIX Timestamp', 'unix_time'),
+ # Banking
+ ('Credit Card Provider', 'credit_card_provider'),
+ ('Credit Card No.', 'credit_card_number'),
+ ('Credit Card Expiry Date', 'credit_card_expire'),
+ ('Credit Card Full', 'credit_card_full'),
+ ('Credit Card Security No.', 'credit_card_security_code'),
+ ('IBAN', 'iban'),
+ ('BBAN', 'bban'),
+ ('Bank Country Code', 'bank_country'),
+ ('Currency', 'currency_name'),
+ ('Currency Code', 'currency_code'),
+ ('Cryptocurrency', 'cryptocurrency_name'),
+ ('Cryptocurrency Code', 'cryptocurrency_code'),
+ # Barcodes
+ ('EAN', 'ean'),
+ ('EAN 8', 'ean8'),
+ ('EAN 13', 'ean13'),
+ ('ISBN 10', 'isbn10'),
+ ('ISBN 13', 'isbn13'),
+ # Colours
+ ('Colour Name', 'color_name'),
+ ('Colour Name (Safe)', 'safe_color_name'),
+ ('Hex Colour', 'hex_color'),
+ ('Hex Colour (Safe)', 'safe_hex_color'),
+ ('RGB Colour', 'rgb_color'),
+ ('RGB CSS Colour', 'rgb_css_color'),
+ # Miscellaneous
+ ('Profession', 'job'),
+ ('Licence Plate', 'license_plate'),
+ ('MD5 Hash', 'md5'),
+ ('SHA1 Hash', 'sha1'),
+ ('SHA256 Hash', 'sha256'),
+ ('Locale', 'locale'),
+ ('Language Code', 'language_code'),
+ ('UUID4', 'uuid4'),
+ ('Password (not secure!!)', 'password'),
])
log = None
fakers = []
-def get_faker():
- """Return random faker instance."""
+def all_fakers():
+ """Return all fakers."""
from faker import Factory
global fakers
if not fakers:
for loc in wf.settings.get('locales', DEFAULT_SETTINGS['locales']):
fakers.append(Factory.create(loc))
- return random.choice(fakers)
+ return fakers
+
+
+def get_faker(name=None):
+ """Return random faker instance."""
+ fakers = all_fakers()
+ if name is None:
+ return random.choice(fakers)
-# def run_workflow():
-# """Run workflow in Alfred"""
-# subprocess.call(['osascript', '-e', ALFRED_AS])
+ random.shuffle(fakers)
+ methname = FAKERS[name]
+ for faker in fakers:
+ if hasattr(faker, methname):
+ return faker
def get_fake_datum(name):
"""Return one fake datum for name."""
+ faker = get_faker(name)
+ if not faker:
+ return None
+
methname = FAKERS[name]
- # Get a faker instance that has the required method
- while True:
- faker = get_faker()
- if hasattr(faker, methname):
- if name == 'Paragraph': # Pass no. of sentences to generator
- datum = getattr(faker, methname)(LIPSUMS, False)
- else:
- datum = getattr(faker, methname)()
- break
+ if name == 'Paragraph': # Pass no. of sentences to generator
+ datum = getattr(faker, methname)(LIPSUMS, False)
+ else:
+ datum = getattr(faker, methname)()
if isinstance(datum, int):
datum = str(datum)
@@ -129,6 +177,17 @@ def get_fake_datum(name):
return datum
+def supported_type(name):
+ """Return ``True`` if at least one Faker supports this type."""
+ methname = FAKERS[name]
+ for faker in all_fakers():
+ if hasattr(faker, methname):
+ return True
+
+ log.debug('data type "%s" is not supported by active locales', name)
+ return False
+
+
def get_fake_data(names=None, count=1):
"""Return list of fake data."""
fake_data = []
@@ -136,6 +195,8 @@ def get_fake_data(names=None, count=1):
if not names:
names = sorted(FAKERS.keys())
+ names = [n for n in names if supported_type(n)]
+
for name in names:
data = []
@@ -171,8 +232,8 @@ def main(wf):
if DELIMITER in query:
if query.endswith(DELIMITER):
- # Run workflow with previous query
- # run_workflow(wf.cached_data('last_query', session=True))
+ # Back up to empty query
+ # run_trigger('fake')
run_workflow()
return
@@ -230,9 +291,12 @@ def main(wf):
it.setvar('title', 'Copied to Clipboard')
it.setvar('text', data)
- mod = it.add_modifier('cmd', 'Paste to frontmost application')
- mod.setvar('paste', 1)
- mod.setvar('SHOW_NOTIFICATIONS', 0)
+ if SNIPPET_MODE:
+ it.setvar('paste', 1)
+ else:
+ mod = it.add_modifier('cmd', 'Paste to frontmost application')
+ mod.setvar('paste', 1)
+ mod.setvar('SHOW_NOTIFICATIONS', 0)
wf.send_feedback()
diff --git a/src/info.plist b/src/info.plist
index 4b19454..d925496 100644
--- a/src/info.plist
+++ b/src/info.plist
@@ -104,7 +104,7 @@
modifiersubtext
vitoclose
-
+
destinationuid
@@ -124,7 +124,7 @@
modifiersubtext
vitoclose
-
+
5BB103F1-C20A-4AEC-AB23-051F4AA6816E
@@ -176,7 +176,7 @@
modifiersubtext
vitoclose
-
+
80140127-E88D-4ED2-B69F-2A6EA08F3407
@@ -228,6 +228,19 @@
modifiersubtext
vitoclose
+
+
+
+ BBB81D4A-9ED4-4C71-8CD3-248ED0F2CB3A
+
+
+ destinationuid
+ 305FB681-8DA9-4F6C-9C38-1B3880FDD6BF
+ modifiers
+ 0
+ modifiersubtext
+
+ vitoclose
@@ -257,6 +270,19 @@
+ E31FF35D-3BFF-4A13-B804-7550FBD280C9
+
+
+ destinationuid
+ 305FB681-8DA9-4F6C-9C38-1B3880FDD6BF
+ modifiers
+ 0
+ modifiersubtext
+
+ vitoclose
+
+
+
E4106CE4-7B7A-41AC-896D-40160A37952C
F01C9E5F-D701-41D1-8FC2-71EE6DD64371
@@ -347,6 +373,23 @@
version
2
+
+ config
+
+ focusedappvariable
+
+ focusedappvariablename
+ SNIPPET_MODE
+ keyword
+ xxfake
+
+ type
+ alfred.workflow.trigger.snippet
+ uid
+ E31FF35D-3BFF-4A13-B804-7550FBD280C9
+ version
+ 1
+
config
@@ -387,6 +430,19 @@ vars={allvars}
version
1
+
+ config
+
+ triggerid
+ fake
+
+ type
+ alfred.workflow.trigger.external
+ uid
+ BBB81D4A-9ED4-4C71-8CD3-248ED0F2CB3A
+ version
+ 1
+
config
@@ -783,7 +839,7 @@ vars={allvars}
colorindex
9
xpos
- 550
+ 730
ypos
40
@@ -825,7 +881,7 @@ vars={allvars}
note
Generate fake data
xpos
- 40
+ 220
ypos
40
@@ -843,7 +899,7 @@ vars={allvars}
colorindex
12
xpos
- 840
+ 1020
ypos
330
@@ -852,7 +908,7 @@ vars={allvars}
colorindex
9
xpos
- 550
+ 730
ypos
180
@@ -861,7 +917,7 @@ vars={allvars}
colorindex
9
xpos
- 260
+ 440
ypos
70
@@ -947,7 +1003,7 @@ vars={allvars}
note
paste != 1
xpos
- 430
+ 610
ypos
70
@@ -960,6 +1016,15 @@ vars={allvars}
ypos
620
+ BBB81D4A-9ED4-4C71-8CD3-248ED0F2CB3A
+
+ colorindex
+ 9
+ xpos
+ 40
+ ypos
+ 180
+
BF97123F-C623-457B-B1E9-F417109255A7
colorindex
@@ -978,10 +1043,19 @@ vars={allvars}
note
paste == 1
xpos
- 430
+ 610
ypos
210
+ E31FF35D-3BFF-4A13-B804-7550FBD280C9
+
+ colorindex
+ 9
+ xpos
+ 40
+ ypos
+ 40
+
E4106CE4-7B7A-41AC-896D-40160A37952C
colorindex
@@ -1008,12 +1082,16 @@ vars={allvars}
LIPSUM_SENTENCES
3
SHOW_NOTIFICATIONS
- 0
+ 1
keyword
fake
+ variablesdontexport
+
+ SHOW_NOTIFICATIONS
+
version
- 2.0.1
+ 2.2.0
webaddress
diff --git a/src/libs/bin/faker b/src/libs/bin/faker
new file mode 100755
index 0000000..c85f16b
--- /dev/null
+++ b/src/libs/bin/faker
@@ -0,0 +1,10 @@
+#!/usr/bin/python
+# -*- coding: utf-8 -*-
+import re
+import sys
+
+from faker.cli import execute_from_command_line
+
+if __name__ == '__main__':
+ sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.argv[0])
+ sys.exit(execute_from_command_line())
diff --git a/src/libs/dateutil/__init__.py b/src/libs/dateutil/__init__.py
index 796ef3d..0defb82 100644
--- a/src/libs/dateutil/__init__.py
+++ b/src/libs/dateutil/__init__.py
@@ -1,2 +1,8 @@
# -*- coding: utf-8 -*-
-from ._version import VERSION as __version__
+try:
+ from ._version import version as __version__
+except ImportError:
+ __version__ = 'unknown'
+
+__all__ = ['easter', 'parser', 'relativedelta', 'rrule', 'tz',
+ 'utils', 'zoneinfo']
diff --git a/src/libs/dateutil/_common.py b/src/libs/dateutil/_common.py
index e8b4af7..4eb2659 100644
--- a/src/libs/dateutil/_common.py
+++ b/src/libs/dateutil/_common.py
@@ -24,7 +24,14 @@ def __eq__(self, other):
return False
return True
- __hash__ = None
+ def __hash__(self):
+ return hash((
+ self.weekday,
+ self.n,
+ ))
+
+ def __ne__(self, other):
+ return not (self == other)
def __repr__(self):
s = ("MO", "TU", "WE", "TH", "FR", "SA", "SU")[self.weekday]
@@ -32,3 +39,5 @@ def __repr__(self):
return s
else:
return "%s(%+d)" % (s, self.n)
+
+# vim:ts=4:sw=4:et
diff --git a/src/libs/dateutil/_version.py b/src/libs/dateutil/_version.py
index c1a0357..670d7ab 100644
--- a/src/libs/dateutil/_version.py
+++ b/src/libs/dateutil/_version.py
@@ -1,10 +1,4 @@
-"""
-Contains information about the dateutil version.
-"""
-
-VERSION_MAJOR = 2
-VERSION_MINOR = 6
-VERSION_PATCH = 1
-
-VERSION_TUPLE = (VERSION_MAJOR, VERSION_MINOR, VERSION_PATCH)
-VERSION = '.'.join(map(str, VERSION_TUPLE))
+# coding: utf-8
+# file generated by setuptools_scm
+# don't change, don't track in version control
+version = '2.8.0'
diff --git a/src/libs/dateutil/easter.py b/src/libs/dateutil/easter.py
index e4def97..53b7c78 100644
--- a/src/libs/dateutil/easter.py
+++ b/src/libs/dateutil/easter.py
@@ -41,11 +41,11 @@ def easter(year, method=EASTER_WESTERN):
More about the algorithm may be found at:
- http://users.chariot.net.au/~gmarts/eastalg.htm
+ `GM Arts: Easter Algorithms `_
and
- http://www.tondering.dk/claus/calendar.html
+ `The Calendar FAQ: Easter `_
"""
diff --git a/src/libs/dateutil/parser/__init__.py b/src/libs/dateutil/parser/__init__.py
new file mode 100644
index 0000000..216762c
--- /dev/null
+++ b/src/libs/dateutil/parser/__init__.py
@@ -0,0 +1,60 @@
+# -*- coding: utf-8 -*-
+from ._parser import parse, parser, parserinfo
+from ._parser import DEFAULTPARSER, DEFAULTTZPARSER
+from ._parser import UnknownTimezoneWarning
+
+from ._parser import __doc__
+
+from .isoparser import isoparser, isoparse
+
+__all__ = ['parse', 'parser', 'parserinfo',
+ 'isoparse', 'isoparser',
+ 'UnknownTimezoneWarning']
+
+
+###
+# Deprecate portions of the private interface so that downstream code that
+# is improperly relying on it is given *some* notice.
+
+
+def __deprecated_private_func(f):
+ from functools import wraps
+ import warnings
+
+ msg = ('{name} is a private function and may break without warning, '
+ 'it will be moved and or renamed in future versions.')
+ msg = msg.format(name=f.__name__)
+
+ @wraps(f)
+ def deprecated_func(*args, **kwargs):
+ warnings.warn(msg, DeprecationWarning)
+ return f(*args, **kwargs)
+
+ return deprecated_func
+
+def __deprecate_private_class(c):
+ import warnings
+
+ msg = ('{name} is a private class and may break without warning, '
+ 'it will be moved and or renamed in future versions.')
+ msg = msg.format(name=c.__name__)
+
+ class private_class(c):
+ __doc__ = c.__doc__
+
+ def __init__(self, *args, **kwargs):
+ warnings.warn(msg, DeprecationWarning)
+ super(private_class, self).__init__(*args, **kwargs)
+
+ private_class.__name__ = c.__name__
+
+ return private_class
+
+
+from ._parser import _timelex, _resultbase
+from ._parser import _tzparser, _parsetz
+
+_timelex = __deprecate_private_class(_timelex)
+_tzparser = __deprecate_private_class(_tzparser)
+_resultbase = __deprecate_private_class(_resultbase)
+_parsetz = __deprecated_private_func(_parsetz)
diff --git a/src/libs/dateutil/parser.py b/src/libs/dateutil/parser/_parser.py
similarity index 53%
rename from src/libs/dateutil/parser.py
rename to src/libs/dateutil/parser/_parser.py
index 595331f..0da0f3e 100644
--- a/src/libs/dateutil/parser.py
+++ b/src/libs/dateutil/parser/_parser.py
@@ -6,6 +6,7 @@
This module attempts to be forgiving with regards to unlikely input formats,
returning a datetime object even for dates which are ambiguous. If an element
of a date/time stamp is omitted, the following rules are applied:
+
- If AM or PM is left unspecified, a 24-hour clock is assumed, however, an hour
on a 12-hour clock (``0 <= hour <= 12``) *must* be specified if AM or PM is
specified.
@@ -21,7 +22,7 @@
- `A summary of the international standard date and time notation
`_
- `W3C Date and Time Formats `_
-- `Time Formats (Planetary Rings Node) `_
+- `Time Formats (Planetary Rings Node) `_
- `CPAN ParseDate module
`_
- `Java SimpleDateFormat Class
@@ -30,33 +31,47 @@
from __future__ import unicode_literals
import datetime
+import re
import string
import time
-import collections
-import re
-from io import StringIO
+import warnings
+
from calendar import monthrange
+from io import StringIO
+
+import six
+from six import integer_types, text_type
+
+from decimal import Decimal
-from six import text_type, binary_type, integer_types
+from warnings import warn
-from . import relativedelta
-from . import tz
+from .. import relativedelta
+from .. import tz
__all__ = ["parse", "parserinfo"]
+# TODO: pandas.core.tools.datetimes imports this explicitly. Might be worth
+# making public and/or figuring out if there is something we can
+# take off their plate.
class _timelex(object):
# Fractional seconds are sometimes split by a comma
_split_decimal = re.compile("([.,])")
def __init__(self, instream):
- if isinstance(instream, binary_type):
- instream = instream.decode()
+ if six.PY2:
+ # In Python 2, we can't duck type properly because unicode has
+ # a 'decode' function, and we'd be double-decoding
+ if isinstance(instream, (bytes, bytearray)):
+ instream = instream.decode()
+ else:
+ if getattr(instream, 'decode', None) is not None:
+ instream = instream.decode()
if isinstance(instream, text_type):
instream = StringIO(instream)
-
- if getattr(instream, 'read', None) is None:
+ elif getattr(instream, 'read', None) is None:
raise TypeError('Parser must be a string or character stream, not '
'{itype}'.format(itype=instream.__class__.__name__))
@@ -235,16 +250,16 @@ class parserinfo(object):
the language and acceptable values for each parameter.
:param dayfirst:
- Whether to interpret the first value in an ambiguous 3-integer date
- (e.g. 01/05/09) as the day (``True``) or month (``False``). If
- ``yearfirst`` is set to ``True``, this distinguishes between YDM
- and YMD. Default is ``False``.
+ Whether to interpret the first value in an ambiguous 3-integer date
+ (e.g. 01/05/09) as the day (``True``) or month (``False``). If
+ ``yearfirst`` is set to ``True``, this distinguishes between YDM
+ and YMD. Default is ``False``.
:param yearfirst:
- Whether to interpret the first value in an ambiguous 3-integer date
- (e.g. 01/05/09) as the year. If ``True``, the first number is taken
- to be the year, otherwise the last number is taken to be the year.
- Default is ``False``.
+ Whether to interpret the first value in an ambiguous 3-integer date
+ (e.g. 01/05/09) as the year. If ``True``, the first number is taken
+ to be the year, otherwise the last number is taken to be the year.
+ Default is ``False``.
"""
# m from a.m/p.m, t from ISO T separator
@@ -253,14 +268,14 @@ class parserinfo(object):
"st", "nd", "rd", "th"]
WEEKDAYS = [("Mon", "Monday"),
- ("Tue", "Tuesday"),
+ ("Tue", "Tuesday"), # TODO: "Tues"
("Wed", "Wednesday"),
- ("Thu", "Thursday"),
+ ("Thu", "Thursday"), # TODO: "Thurs"
("Fri", "Friday"),
("Sat", "Saturday"),
("Sun", "Sunday")]
MONTHS = [("Jan", "January"),
- ("Feb", "February"),
+ ("Feb", "February"), # TODO: "Febr"
("Mar", "March"),
("Apr", "April"),
("May", "May"),
@@ -276,9 +291,11 @@ class parserinfo(object):
("s", "second", "seconds")]
AMPM = [("am", "a"),
("pm", "p")]
- UTCZONE = ["UTC", "GMT", "Z"]
+ UTCZONE = ["UTC", "GMT", "Z", "z"]
PERTAIN = ["of"]
TZOFFSET = {}
+ # TODO: ERA = ["AD", "BC", "CE", "BCE", "Stardate",
+ # "Anno Domini", "Year of Our Lord"]
def __init__(self, dayfirst=False, yearfirst=False):
self._jump = self._convert(self.JUMP)
@@ -309,19 +326,17 @@ def jump(self, name):
return name.lower() in self._jump
def weekday(self, name):
- if len(name) >= min(len(n) for n in self._weekdays.keys()):
- try:
- return self._weekdays[name.lower()]
- except KeyError:
- pass
+ try:
+ return self._weekdays[name.lower()]
+ except KeyError:
+ pass
return None
def month(self, name):
- if len(name) >= min(len(n) for n in self._months.keys()):
- try:
- return self._months[name.lower()] + 1
- except KeyError:
- pass
+ try:
+ return self._months[name.lower()] + 1
+ except KeyError:
+ pass
return None
def hms(self, name):
@@ -349,13 +364,23 @@ def tzoffset(self, name):
return self.TZOFFSET.get(name)
def convertyear(self, year, century_specified=False):
+ """
+ Converts two-digit years to year within [-50, 49]
+ range of self._year (current local time)
+ """
+
+ # Function contract is that the year is always positive
+ assert year >= 0
+
if year < 100 and not century_specified:
+ # assume current century to start
year += self._century
- if abs(year - self._year) >= 50:
- if year < self._year:
- year += 100
- else:
- year -= 100
+
+ if year >= self._year + 50: # if too far in future
+ year -= 100
+ elif year < self._year - 50: # if too far in past
+ year += 100
+
return year
def validate(self, res):
@@ -363,7 +388,8 @@ def validate(self, res):
if res.year is not None:
res.year = self.convertyear(res.year, res.century_specified)
- if res.tzoffset == 0 and not res.tzname or res.tzname == 'Z':
+ if ((res.tzoffset == 0 and not res.tzname) or
+ (res.tzname == 'Z' or res.tzname == 'z')):
res.tzname = "UTC"
res.tzoffset = 0
elif res.tzoffset != 0 and res.tzname and self.utczone(res.tzname):
@@ -372,58 +398,117 @@ def validate(self, res):
class _ymd(list):
- def __init__(self, tzstr, *args, **kwargs):
+ def __init__(self, *args, **kwargs):
super(self.__class__, self).__init__(*args, **kwargs)
self.century_specified = False
- self.tzstr = tzstr
+ self.dstridx = None
+ self.mstridx = None
+ self.ystridx = None
- @staticmethod
- def token_could_be_year(token, year):
- try:
- return int(token) == year
- except ValueError:
- return False
+ @property
+ def has_year(self):
+ return self.ystridx is not None
- @staticmethod
- def find_potential_year_tokens(year, tokens):
- return [token for token in tokens if _ymd.token_could_be_year(token, year)]
+ @property
+ def has_month(self):
+ return self.mstridx is not None
- def find_probable_year_index(self, tokens):
- """
- attempt to deduce if a pre 100 year was lost
- due to padded zeros being taken off
- """
- for index, token in enumerate(self):
- potential_year_tokens = _ymd.find_potential_year_tokens(token, tokens)
- if len(potential_year_tokens) == 1 and len(potential_year_tokens[0]) > 2:
- return index
+ @property
+ def has_day(self):
+ return self.dstridx is not None
- def append(self, val):
+ def could_be_day(self, value):
+ if self.has_day:
+ return False
+ elif not self.has_month:
+ return 1 <= value <= 31
+ elif not self.has_year:
+ # Be permissive, assume leapyear
+ month = self[self.mstridx]
+ return 1 <= value <= monthrange(2000, month)[1]
+ else:
+ month = self[self.mstridx]
+ year = self[self.ystridx]
+ return 1 <= value <= monthrange(year, month)[1]
+
+ def append(self, val, label=None):
if hasattr(val, '__len__'):
if val.isdigit() and len(val) > 2:
self.century_specified = True
+ if label not in [None, 'Y']: # pragma: no cover
+ raise ValueError(label)
+ label = 'Y'
elif val > 100:
self.century_specified = True
+ if label not in [None, 'Y']: # pragma: no cover
+ raise ValueError(label)
+ label = 'Y'
super(self.__class__, self).append(int(val))
- def resolve_ymd(self, mstridx, yearfirst, dayfirst):
+ if label == 'M':
+ if self.has_month:
+ raise ValueError('Month is already set')
+ self.mstridx = len(self) - 1
+ elif label == 'D':
+ if self.has_day:
+ raise ValueError('Day is already set')
+ self.dstridx = len(self) - 1
+ elif label == 'Y':
+ if self.has_year:
+ raise ValueError('Year is already set')
+ self.ystridx = len(self) - 1
+
+ def _resolve_from_stridxs(self, strids):
+ """
+ Try to resolve the identities of year/month/day elements using
+ ystridx, mstridx, and dstridx, if enough of these are specified.
+ """
+ if len(self) == 3 and len(strids) == 2:
+ # we can back out the remaining stridx value
+ missing = [x for x in range(3) if x not in strids.values()]
+ key = [x for x in ['y', 'm', 'd'] if x not in strids]
+ assert len(missing) == len(key) == 1
+ key = key[0]
+ val = missing[0]
+ strids[key] = val
+
+ assert len(self) == len(strids) # otherwise this should not be called
+ out = {key: self[strids[key]] for key in strids}
+ return (out.get('y'), out.get('m'), out.get('d'))
+
+ def resolve_ymd(self, yearfirst, dayfirst):
len_ymd = len(self)
year, month, day = (None, None, None)
+ strids = (('y', self.ystridx),
+ ('m', self.mstridx),
+ ('d', self.dstridx))
+
+ strids = {key: val for key, val in strids if val is not None}
+ if (len(self) == len(strids) > 0 or
+ (len(self) == 3 and len(strids) == 2)):
+ return self._resolve_from_stridxs(strids)
+
+ mstridx = self.mstridx
+
if len_ymd > 3:
raise ValueError("More than three YMD values")
- elif len_ymd == 1 or (mstridx != -1 and len_ymd == 2):
+ elif len_ymd == 1 or (mstridx is not None and len_ymd == 2):
# One member, or two members with a month string
- if mstridx != -1:
+ if mstridx is not None:
month = self[mstridx]
- del self[mstridx]
+ # since mstridx is 0 or 1, self[mstridx-1] always
+ # looks up the other element
+ other = self[mstridx - 1]
+ else:
+ other = self[0]
- if len_ymd > 1 or mstridx == -1:
- if self[0] > 31:
- year = self[0]
+ if len_ymd > 1 or mstridx is None:
+ if other > 31:
+ year = other
else:
- day = self[0]
+ day = other
elif len_ymd == 2:
# Two members with numbers
@@ -443,7 +528,11 @@ def resolve_ymd(self, mstridx, yearfirst, dayfirst):
elif len_ymd == 3:
# Three members
if mstridx == 0:
- month, day, year = self
+ if self[1] > 31:
+ # Apr-2003-25
+ month, year, day = self
+ else:
+ month, day, year = self
elif mstridx == 1:
if self[0] > 31 or (yearfirst and self[2] <= 31):
# 99-Jan-01
@@ -464,9 +553,9 @@ def resolve_ymd(self, mstridx, yearfirst, dayfirst):
year, day, month = self
else:
- if self[0] > 31 or \
- self.find_probable_year_index(_timelex.split(self.tzstr)) == 0 or \
- (yearfirst and self[1] <= 12 and self[2] <= 31):
+ if (self[0] > 31 or
+ self.ystridx == 0 or
+ (yearfirst and self[1] <= 12 and self[2] <= 31)):
# 99-01-01
if dayfirst and self[2] <= 12:
year, day, month = self
@@ -486,7 +575,8 @@ class parser(object):
def __init__(self, info=None):
self.info = info or parserinfo()
- def parse(self, timestr, default=None, ignoretz=False, tzinfos=None, **kwargs):
+ def parse(self, timestr, default=None,
+ ignoretz=False, tzinfos=None, **kwargs):
"""
Parse the date/time string into a :class:`datetime.datetime` object.
@@ -511,23 +601,23 @@ def parse(self, timestr, default=None, ignoretz=False, tzinfos=None, **kwargs):
``tzoffset``) and returning a time zone.
The timezones to which the names are mapped can be an integer
- offset from UTC in minutes or a :class:`tzinfo` object.
+ offset from UTC in seconds or a :class:`tzinfo` object.
.. doctest::
:options: +NORMALIZE_WHITESPACE
>>> from dateutil.parser import parse
>>> from dateutil.tz import gettz
- >>> tzinfos = {"BRST": -10800, "CST": gettz("America/Chicago")}
+ >>> tzinfos = {"BRST": -7200, "CST": gettz("America/Chicago")}
>>> parse("2012-01-19 17:21:00 BRST", tzinfos=tzinfos)
- datetime.datetime(2012, 1, 19, 17, 21, tzinfo=tzoffset(u'BRST', -10800))
+ datetime.datetime(2012, 1, 19, 17, 21, tzinfo=tzoffset(u'BRST', -7200))
>>> parse("2012-01-19 17:21:00 CST", tzinfos=tzinfos)
datetime.datetime(2012, 1, 19, 17, 21,
tzinfo=tzfile('/usr/share/zoneinfo/America/Chicago'))
This parameter is ignored if ``ignoretz`` is set.
- :param **kwargs:
+ :param \\*\\*kwargs:
Keyword arguments as passed to ``_parse()``.
:return:
@@ -556,58 +646,15 @@ def parse(self, timestr, default=None, ignoretz=False, tzinfos=None, **kwargs):
res, skipped_tokens = self._parse(timestr, **kwargs)
if res is None:
- raise ValueError("Unknown string format")
+ raise ValueError("Unknown string format:", timestr)
if len(res) == 0:
- raise ValueError("String does not contain a date.")
+ raise ValueError("String does not contain a date:", timestr)
- repl = {}
- for attr in ("year", "month", "day", "hour",
- "minute", "second", "microsecond"):
- value = getattr(res, attr)
- if value is not None:
- repl[attr] = value
-
- if 'day' not in repl:
- # If the default day exceeds the last day of the month, fall back to
- # the end of the month.
- cyear = default.year if res.year is None else res.year
- cmonth = default.month if res.month is None else res.month
- cday = default.day if res.day is None else res.day
-
- if cday > monthrange(cyear, cmonth)[1]:
- repl['day'] = monthrange(cyear, cmonth)[1]
-
- ret = default.replace(**repl)
-
- if res.weekday is not None and not res.day:
- ret = ret+relativedelta.relativedelta(weekday=res.weekday)
+ ret = self._build_naive(res, default)
if not ignoretz:
- if (isinstance(tzinfos, collections.Callable) or
- tzinfos and res.tzname in tzinfos):
-
- if isinstance(tzinfos, collections.Callable):
- tzdata = tzinfos(res.tzname, res.tzoffset)
- else:
- tzdata = tzinfos.get(res.tzname)
-
- if isinstance(tzdata, datetime.tzinfo):
- tzinfo = tzdata
- elif isinstance(tzdata, text_type):
- tzinfo = tz.tzstr(tzdata)
- elif isinstance(tzdata, integer_types):
- tzinfo = tz.tzoffset(res.tzname, tzdata)
- else:
- raise ValueError("Offset must be tzinfo subclass, "
- "tz string, or int offset.")
- ret = ret.replace(tzinfo=tzinfo)
- elif res.tzname and res.tzname in time.tzname:
- ret = ret.replace(tzinfo=tz.tzlocal())
- elif res.tzoffset == 0:
- ret = ret.replace(tzinfo=tz.tzutc())
- elif res.tzoffset:
- ret = ret.replace(tzinfo=tz.tzoffset(res.tzname, res.tzoffset))
+ ret = self._build_tzaware(ret, res, tzinfos)
if kwargs.get('fuzzy_with_tokens', False):
return ret, skipped_tokens
@@ -617,7 +664,7 @@ def parse(self, timestr, default=None, ignoretz=False, tzinfos=None, **kwargs):
class _result(_resultbase):
__slots__ = ["year", "month", "day", "weekday",
"hour", "minute", "second", "microsecond",
- "tzname", "tzoffset", "ampm"]
+ "tzname", "tzoffset", "ampm","any_unused_tokens"]
def _parse(self, timestr, dayfirst=None, yearfirst=None, fuzzy=False,
fuzzy_with_tokens=False):
@@ -674,408 +721,537 @@ def _parse(self, timestr, dayfirst=None, yearfirst=None, fuzzy=False,
res = self._result()
l = _timelex.split(timestr) # Splits the timestr into tokens
- # keep up with the last token skipped so we can recombine
- # consecutively skipped tokens (-2 for when i begins at 0).
- last_skipped_token_i = -2
- skipped_tokens = list()
-
- try:
- # year/month/day list
- ymd = _ymd(timestr)
+ skipped_idxs = []
- # Index of the month string in ymd
- mstridx = -1
+ # year/month/day list
+ ymd = _ymd()
- len_l = len(l)
- i = 0
+ len_l = len(l)
+ i = 0
+ try:
while i < len_l:
# Check if it's a number
+ value_repr = l[i]
try:
- value_repr = l[i]
value = float(value_repr)
except ValueError:
value = None
if value is not None:
- # Token is a number
- len_li = len(l[i])
- i += 1
-
- if (len(ymd) == 3 and len_li in (2, 4)
- and res.hour is None and (i >= len_l or (l[i] != ':' and
- info.hms(l[i]) is None))):
- # 19990101T23[59]
- s = l[i-1]
- res.hour = int(s[:2])
-
- if len_li == 4:
- res.minute = int(s[2:])
-
- elif len_li == 6 or (len_li > 6 and l[i-1].find('.') == 6):
- # YYMMDD or HHMMSS[.ss]
- s = l[i-1]
-
- if not ymd and l[i-1].find('.') == -1:
- #ymd.append(info.convertyear(int(s[:2])))
-
- ymd.append(s[:2])
- ymd.append(s[2:4])
- ymd.append(s[4:])
- else:
- # 19990101T235959[.59]
- res.hour = int(s[:2])
- res.minute = int(s[2:4])
- res.second, res.microsecond = _parsems(s[4:])
-
- elif len_li in (8, 12, 14):
- # YYYYMMDD
- s = l[i-1]
- ymd.append(s[:4])
- ymd.append(s[4:6])
- ymd.append(s[6:8])
-
- if len_li > 8:
- res.hour = int(s[8:10])
- res.minute = int(s[10:12])
-
- if len_li > 12:
- res.second = int(s[12:])
-
- elif ((i < len_l and info.hms(l[i]) is not None) or
- (i+1 < len_l and l[i] == ' ' and
- info.hms(l[i+1]) is not None)):
-
- # HH[ ]h or MM[ ]m or SS[.ss][ ]s
- if l[i] == ' ':
- i += 1
-
- idx = info.hms(l[i])
-
- while True:
- if idx == 0:
- res.hour = int(value)
-
- if value % 1:
- res.minute = int(60*(value % 1))
-
- elif idx == 1:
- res.minute = int(value)
-
- if value % 1:
- res.second = int(60*(value % 1))
-
- elif idx == 2:
- res.second, res.microsecond = \
- _parsems(value_repr)
-
- i += 1
-
- if i >= len_l or idx == 2:
- break
-
- # 12h00
- try:
- value_repr = l[i]
- value = float(value_repr)
- except ValueError:
- break
- else:
- i += 1
- idx += 1
-
- if i < len_l:
- newidx = info.hms(l[i])
-
- if newidx is not None:
- idx = newidx
-
- elif (i == len_l and l[i-2] == ' ' and
- info.hms(l[i-3]) is not None):
- # X h MM or X m SS
- idx = info.hms(l[i-3])
-
- if idx == 0: # h
- res.minute = int(value)
-
- sec_remainder = value % 1
- if sec_remainder:
- res.second = int(60 * sec_remainder)
- elif idx == 1: # m
- res.second, res.microsecond = \
- _parsems(value_repr)
-
- # We don't need to advance the tokens here because the
- # i == len_l call indicates that we're looking at all
- # the tokens already.
-
- elif i+1 < len_l and l[i] == ':':
- # HH:MM[:SS[.ss]]
- res.hour = int(value)
- i += 1
- value = float(l[i])
- res.minute = int(value)
-
- if value % 1:
- res.second = int(60*(value % 1))
-
- i += 1
-
- if i < len_l and l[i] == ':':
- res.second, res.microsecond = _parsems(l[i+1])
- i += 2
-
- elif i < len_l and l[i] in ('-', '/', '.'):
- sep = l[i]
- ymd.append(value_repr)
- i += 1
-
- if i < len_l and not info.jump(l[i]):
- try:
- # 01-01[-01]
- ymd.append(l[i])
- except ValueError:
- # 01-Jan[-01]
- value = info.month(l[i])
-
- if value is not None:
- ymd.append(value)
- assert mstridx == -1
- mstridx = len(ymd)-1
- else:
- return None, None
-
- i += 1
-
- if i < len_l and l[i] == sep:
- # We have three members
- i += 1
- value = info.month(l[i])
-
- if value is not None:
- ymd.append(value)
- mstridx = len(ymd)-1
- assert mstridx == -1
- else:
- ymd.append(l[i])
-
- i += 1
- elif i >= len_l or info.jump(l[i]):
- if i+1 < len_l and info.ampm(l[i+1]) is not None:
- # 12 am
- res.hour = int(value)
-
- if res.hour < 12 and info.ampm(l[i+1]) == 1:
- res.hour += 12
- elif res.hour == 12 and info.ampm(l[i+1]) == 0:
- res.hour = 0
-
- i += 1
- else:
- # Year, month or day
- ymd.append(value)
- i += 1
- elif info.ampm(l[i]) is not None:
-
- # 12am
- res.hour = int(value)
-
- if res.hour < 12 and info.ampm(l[i]) == 1:
- res.hour += 12
- elif res.hour == 12 and info.ampm(l[i]) == 0:
- res.hour = 0
- i += 1
-
- elif not fuzzy:
- return None, None
- else:
- i += 1
- continue
+ # Numeric token
+ i = self._parse_numeric_token(l, i, info, ymd, res, fuzzy)
# Check weekday
- value = info.weekday(l[i])
- if value is not None:
+ elif info.weekday(l[i]) is not None:
+ value = info.weekday(l[i])
res.weekday = value
- i += 1
- continue
# Check month name
- value = info.month(l[i])
- if value is not None:
- ymd.append(value)
- assert mstridx == -1
- mstridx = len(ymd)-1
+ elif info.month(l[i]) is not None:
+ value = info.month(l[i])
+ ymd.append(value, 'M')
- i += 1
- if i < len_l:
- if l[i] in ('-', '/'):
+ if i + 1 < len_l:
+ if l[i + 1] in ('-', '/'):
# Jan-01[-99]
- sep = l[i]
- i += 1
- ymd.append(l[i])
- i += 1
+ sep = l[i + 1]
+ ymd.append(l[i + 2])
- if i < len_l and l[i] == sep:
+ if i + 3 < len_l and l[i + 3] == sep:
# Jan-01-99
- i += 1
- ymd.append(l[i])
- i += 1
+ ymd.append(l[i + 4])
+ i += 2
- elif (i+3 < len_l and l[i] == l[i+2] == ' '
- and info.pertain(l[i+1])):
+ i += 2
+
+ elif (i + 4 < len_l and l[i + 1] == l[i + 3] == ' ' and
+ info.pertain(l[i + 2])):
# Jan of 01
# In this case, 01 is clearly year
- try:
- value = int(l[i+3])
- except ValueError:
+ if l[i + 4].isdigit():
+ # Convert it here to become unambiguous
+ value = int(l[i + 4])
+ year = str(info.convertyear(value))
+ ymd.append(year, 'Y')
+ else:
# Wrong guess
pass
- else:
- # Convert it here to become unambiguous
- ymd.append(str(info.convertyear(value)))
+ # TODO: not hit in tests
i += 4
- continue
# Check am/pm
- value = info.ampm(l[i])
- if value is not None:
- # For fuzzy parsing, 'a' or 'am' (both valid English words)
- # may erroneously trigger the AM/PM flag. Deal with that
- # here.
- val_is_ampm = True
-
- # If there's already an AM/PM flag, this one isn't one.
- if fuzzy and res.ampm is not None:
- val_is_ampm = False
-
- # If AM/PM is found and hour is not, raise a ValueError
- if res.hour is None:
- if fuzzy:
- val_is_ampm = False
- else:
- raise ValueError('No hour specified with ' +
- 'AM or PM flag.')
- elif not 0 <= res.hour <= 12:
- # If AM/PM is found, it's a 12 hour clock, so raise
- # an error for invalid range
- if fuzzy:
- val_is_ampm = False
- else:
- raise ValueError('Invalid hour specified for ' +
- '12-hour clock.')
+ elif info.ampm(l[i]) is not None:
+ value = info.ampm(l[i])
+ val_is_ampm = self._ampm_valid(res.hour, res.ampm, fuzzy)
if val_is_ampm:
- if value == 1 and res.hour < 12:
- res.hour += 12
- elif value == 0 and res.hour == 12:
- res.hour = 0
-
+ res.hour = self._adjust_ampm(res.hour, value)
res.ampm = value
elif fuzzy:
- last_skipped_token_i = self._skip_token(skipped_tokens,
- last_skipped_token_i, i, l)
- i += 1
- continue
+ skipped_idxs.append(i)
# Check for a timezone name
- if (res.hour is not None and len(l[i]) <= 5 and
- res.tzname is None and res.tzoffset is None and
- not [x for x in l[i] if x not in
- string.ascii_uppercase]):
+ elif self._could_be_tzname(res.hour, res.tzname, res.tzoffset, l[i]):
res.tzname = l[i]
res.tzoffset = info.tzoffset(res.tzname)
- i += 1
# Check for something like GMT+3, or BRST+3. Notice
# that it doesn't mean "I am 3 hours after GMT", but
# "my time +3 is GMT". If found, we reverse the
# logic so that timezone parsing code will get it
# right.
- if i < len_l and l[i] in ('+', '-'):
- l[i] = ('+', '-')[l[i] == '+']
+ if i + 1 < len_l and l[i + 1] in ('+', '-'):
+ l[i + 1] = ('+', '-')[l[i + 1] == '+']
res.tzoffset = None
if info.utczone(res.tzname):
# With something like GMT+3, the timezone
# is *not* GMT.
res.tzname = None
- continue
-
# Check for a numbered timezone
- if res.hour is not None and l[i] in ('+', '-'):
+ elif res.hour is not None and l[i] in ('+', '-'):
signal = (-1, 1)[l[i] == '+']
- i += 1
- len_li = len(l[i])
+ len_li = len(l[i + 1])
+ # TODO: check that l[i + 1] is integer?
if len_li == 4:
# -0300
- res.tzoffset = int(l[i][:2])*3600+int(l[i][2:])*60
- elif i+1 < len_l and l[i+1] == ':':
+ hour_offset = int(l[i + 1][:2])
+ min_offset = int(l[i + 1][2:])
+ elif i + 2 < len_l and l[i + 2] == ':':
# -03:00
- res.tzoffset = int(l[i])*3600+int(l[i+2])*60
+ hour_offset = int(l[i + 1])
+ min_offset = int(l[i + 3]) # TODO: Check that l[i+3] is minute-like?
i += 2
elif len_li <= 2:
# -[0]3
- res.tzoffset = int(l[i][:2])*3600
+ hour_offset = int(l[i + 1][:2])
+ min_offset = 0
else:
- return None, None
- i += 1
+ raise ValueError(timestr)
- res.tzoffset *= signal
+ res.tzoffset = signal * (hour_offset * 3600 + min_offset * 60)
# Look for a timezone name between parenthesis
- if (i+3 < len_l and
- info.jump(l[i]) and l[i+1] == '(' and l[i+3] == ')' and
- 3 <= len(l[i+2]) <= 5 and
- not [x for x in l[i+2]
- if x not in string.ascii_uppercase]):
+ if (i + 5 < len_l and
+ info.jump(l[i + 2]) and l[i + 3] == '(' and
+ l[i + 5] == ')' and
+ 3 <= len(l[i + 4]) and
+ self._could_be_tzname(res.hour, res.tzname,
+ None, l[i + 4])):
# -0300 (BRST)
- res.tzname = l[i+2]
+ res.tzname = l[i + 4]
i += 4
- continue
+
+ i += 1
# Check jumps
- if not (info.jump(l[i]) or fuzzy):
- return None, None
+ elif not (info.jump(l[i]) or fuzzy):
+ raise ValueError(timestr)
- last_skipped_token_i = self._skip_token(skipped_tokens,
- last_skipped_token_i, i, l)
+ else:
+ skipped_idxs.append(i)
i += 1
# Process year/month/day
- year, month, day = ymd.resolve_ymd(mstridx, yearfirst, dayfirst)
- if year is not None:
- res.year = year
- res.century_specified = ymd.century_specified
-
- if month is not None:
- res.month = month
+ year, month, day = ymd.resolve_ymd(yearfirst, dayfirst)
- if day is not None:
- res.day = day
+ res.century_specified = ymd.century_specified
+ res.year = year
+ res.month = month
+ res.day = day
- except (IndexError, ValueError, AssertionError):
+ except (IndexError, ValueError):
return None, None
if not info.validate(res):
return None, None
if fuzzy_with_tokens:
+ skipped_tokens = self._recombine_skipped(l, skipped_idxs)
return res, tuple(skipped_tokens)
else:
return res, None
- @staticmethod
- def _skip_token(skipped_tokens, last_skipped_token_i, i, l):
- if last_skipped_token_i == i - 1:
- # recombine the tokens
- skipped_tokens[-1] += l[i]
+ def _parse_numeric_token(self, tokens, idx, info, ymd, res, fuzzy):
+ # Token is a number
+ value_repr = tokens[idx]
+ try:
+ value = self._to_decimal(value_repr)
+ except Exception as e:
+ six.raise_from(ValueError('Unknown numeric token'), e)
+
+ len_li = len(value_repr)
+
+ len_l = len(tokens)
+
+ if (len(ymd) == 3 and len_li in (2, 4) and
+ res.hour is None and
+ (idx + 1 >= len_l or
+ (tokens[idx + 1] != ':' and
+ info.hms(tokens[idx + 1]) is None))):
+ # 19990101T23[59]
+ s = tokens[idx]
+ res.hour = int(s[:2])
+
+ if len_li == 4:
+ res.minute = int(s[2:])
+
+ elif len_li == 6 or (len_li > 6 and tokens[idx].find('.') == 6):
+ # YYMMDD or HHMMSS[.ss]
+ s = tokens[idx]
+
+ if not ymd and '.' not in tokens[idx]:
+ ymd.append(s[:2])
+ ymd.append(s[2:4])
+ ymd.append(s[4:])
+ else:
+ # 19990101T235959[.59]
+
+ # TODO: Check if res attributes already set.
+ res.hour = int(s[:2])
+ res.minute = int(s[2:4])
+ res.second, res.microsecond = self._parsems(s[4:])
+
+ elif len_li in (8, 12, 14):
+ # YYYYMMDD
+ s = tokens[idx]
+ ymd.append(s[:4], 'Y')
+ ymd.append(s[4:6])
+ ymd.append(s[6:8])
+
+ if len_li > 8:
+ res.hour = int(s[8:10])
+ res.minute = int(s[10:12])
+
+ if len_li > 12:
+ res.second = int(s[12:])
+
+ elif self._find_hms_idx(idx, tokens, info, allow_jump=True) is not None:
+ # HH[ ]h or MM[ ]m or SS[.ss][ ]s
+ hms_idx = self._find_hms_idx(idx, tokens, info, allow_jump=True)
+ (idx, hms) = self._parse_hms(idx, tokens, info, hms_idx)
+ if hms is not None:
+ # TODO: checking that hour/minute/second are not
+ # already set?
+ self._assign_hms(res, value_repr, hms)
+
+ elif idx + 2 < len_l and tokens[idx + 1] == ':':
+ # HH:MM[:SS[.ss]]
+ res.hour = int(value)
+ value = self._to_decimal(tokens[idx + 2]) # TODO: try/except for this?
+ (res.minute, res.second) = self._parse_min_sec(value)
+
+ if idx + 4 < len_l and tokens[idx + 3] == ':':
+ res.second, res.microsecond = self._parsems(tokens[idx + 4])
+
+ idx += 2
+
+ idx += 2
+
+ elif idx + 1 < len_l and tokens[idx + 1] in ('-', '/', '.'):
+ sep = tokens[idx + 1]
+ ymd.append(value_repr)
+
+ if idx + 2 < len_l and not info.jump(tokens[idx + 2]):
+ if tokens[idx + 2].isdigit():
+ # 01-01[-01]
+ ymd.append(tokens[idx + 2])
+ else:
+ # 01-Jan[-01]
+ value = info.month(tokens[idx + 2])
+
+ if value is not None:
+ ymd.append(value, 'M')
+ else:
+ raise ValueError()
+
+ if idx + 3 < len_l and tokens[idx + 3] == sep:
+ # We have three members
+ value = info.month(tokens[idx + 4])
+
+ if value is not None:
+ ymd.append(value, 'M')
+ else:
+ ymd.append(tokens[idx + 4])
+ idx += 2
+
+ idx += 1
+ idx += 1
+
+ elif idx + 1 >= len_l or info.jump(tokens[idx + 1]):
+ if idx + 2 < len_l and info.ampm(tokens[idx + 2]) is not None:
+ # 12 am
+ hour = int(value)
+ res.hour = self._adjust_ampm(hour, info.ampm(tokens[idx + 2]))
+ idx += 1
+ else:
+ # Year, month or day
+ ymd.append(value)
+ idx += 1
+
+ elif info.ampm(tokens[idx + 1]) is not None and (0 <= value < 24):
+ # 12am
+ hour = int(value)
+ res.hour = self._adjust_ampm(hour, info.ampm(tokens[idx + 1]))
+ idx += 1
+
+ elif ymd.could_be_day(value):
+ ymd.append(value)
+
+ elif not fuzzy:
+ raise ValueError()
+
+ return idx
+
+ def _find_hms_idx(self, idx, tokens, info, allow_jump):
+ len_l = len(tokens)
+
+ if idx+1 < len_l and info.hms(tokens[idx+1]) is not None:
+ # There is an "h", "m", or "s" label following this token. We take
+ # assign the upcoming label to the current token.
+ # e.g. the "12" in 12h"
+ hms_idx = idx + 1
+
+ elif (allow_jump and idx+2 < len_l and tokens[idx+1] == ' ' and
+ info.hms(tokens[idx+2]) is not None):
+ # There is a space and then an "h", "m", or "s" label.
+ # e.g. the "12" in "12 h"
+ hms_idx = idx + 2
+
+ elif idx > 0 and info.hms(tokens[idx-1]) is not None:
+ # There is a "h", "m", or "s" preceeding this token. Since neither
+ # of the previous cases was hit, there is no label following this
+ # token, so we use the previous label.
+ # e.g. the "04" in "12h04"
+ hms_idx = idx-1
+
+ elif (1 < idx == len_l-1 and tokens[idx-1] == ' ' and
+ info.hms(tokens[idx-2]) is not None):
+ # If we are looking at the final token, we allow for a
+ # backward-looking check to skip over a space.
+ # TODO: Are we sure this is the right condition here?
+ hms_idx = idx - 2
+
else:
- # just append
- skipped_tokens.append(l[i])
- last_skipped_token_i = i
- return last_skipped_token_i
+ hms_idx = None
+
+ return hms_idx
+
+ def _assign_hms(self, res, value_repr, hms):
+ # See GH issue #427, fixing float rounding
+ value = self._to_decimal(value_repr)
+
+ if hms == 0:
+ # Hour
+ res.hour = int(value)
+ if value % 1:
+ res.minute = int(60*(value % 1))
+
+ elif hms == 1:
+ (res.minute, res.second) = self._parse_min_sec(value)
+
+ elif hms == 2:
+ (res.second, res.microsecond) = self._parsems(value_repr)
+
+ def _could_be_tzname(self, hour, tzname, tzoffset, token):
+ return (hour is not None and
+ tzname is None and
+ tzoffset is None and
+ len(token) <= 5 and
+ (all(x in string.ascii_uppercase for x in token)
+ or token in self.info.UTCZONE))
+
+ def _ampm_valid(self, hour, ampm, fuzzy):
+ """
+ For fuzzy parsing, 'a' or 'am' (both valid English words)
+ may erroneously trigger the AM/PM flag. Deal with that
+ here.
+ """
+ val_is_ampm = True
+
+ # If there's already an AM/PM flag, this one isn't one.
+ if fuzzy and ampm is not None:
+ val_is_ampm = False
+
+ # If AM/PM is found and hour is not, raise a ValueError
+ if hour is None:
+ if fuzzy:
+ val_is_ampm = False
+ else:
+ raise ValueError('No hour specified with AM or PM flag.')
+ elif not 0 <= hour <= 12:
+ # If AM/PM is found, it's a 12 hour clock, so raise
+ # an error for invalid range
+ if fuzzy:
+ val_is_ampm = False
+ else:
+ raise ValueError('Invalid hour specified for 12-hour clock.')
+
+ return val_is_ampm
+
+ def _adjust_ampm(self, hour, ampm):
+ if hour < 12 and ampm == 1:
+ hour += 12
+ elif hour == 12 and ampm == 0:
+ hour = 0
+ return hour
+
+ def _parse_min_sec(self, value):
+ # TODO: Every usage of this function sets res.second to the return
+ # value. Are there any cases where second will be returned as None and
+ # we *dont* want to set res.second = None?
+ minute = int(value)
+ second = None
+
+ sec_remainder = value % 1
+ if sec_remainder:
+ second = int(60 * sec_remainder)
+ return (minute, second)
+
+ def _parsems(self, value):
+ """Parse a I[.F] seconds value into (seconds, microseconds)."""
+ if "." not in value:
+ return int(value), 0
+ else:
+ i, f = value.split(".")
+ return int(i), int(f.ljust(6, "0")[:6])
+
+ def _parse_hms(self, idx, tokens, info, hms_idx):
+ # TODO: Is this going to admit a lot of false-positives for when we
+ # just happen to have digits and "h", "m" or "s" characters in non-date
+ # text? I guess hex hashes won't have that problem, but there's plenty
+ # of random junk out there.
+ if hms_idx is None:
+ hms = None
+ new_idx = idx
+ elif hms_idx > idx:
+ hms = info.hms(tokens[hms_idx])
+ new_idx = hms_idx
+ else:
+ # Looking backwards, increment one.
+ hms = info.hms(tokens[hms_idx]) + 1
+ new_idx = idx
+
+ return (new_idx, hms)
+
+ def _recombine_skipped(self, tokens, skipped_idxs):
+ """
+ >>> tokens = ["foo", " ", "bar", " ", "19June2000", "baz"]
+ >>> skipped_idxs = [0, 1, 2, 5]
+ >>> _recombine_skipped(tokens, skipped_idxs)
+ ["foo bar", "baz"]
+ """
+ skipped_tokens = []
+ for i, idx in enumerate(sorted(skipped_idxs)):
+ if i > 0 and idx - 1 == skipped_idxs[i - 1]:
+ skipped_tokens[-1] = skipped_tokens[-1] + tokens[idx]
+ else:
+ skipped_tokens.append(tokens[idx])
+
+ return skipped_tokens
+
+ def _build_tzinfo(self, tzinfos, tzname, tzoffset):
+ if callable(tzinfos):
+ tzdata = tzinfos(tzname, tzoffset)
+ else:
+ tzdata = tzinfos.get(tzname)
+ # handle case where tzinfo is paased an options that returns None
+ # eg tzinfos = {'BRST' : None}
+ if isinstance(tzdata, datetime.tzinfo) or tzdata is None:
+ tzinfo = tzdata
+ elif isinstance(tzdata, text_type):
+ tzinfo = tz.tzstr(tzdata)
+ elif isinstance(tzdata, integer_types):
+ tzinfo = tz.tzoffset(tzname, tzdata)
+ return tzinfo
+
+ def _build_tzaware(self, naive, res, tzinfos):
+ if (callable(tzinfos) or (tzinfos and res.tzname in tzinfos)):
+ tzinfo = self._build_tzinfo(tzinfos, res.tzname, res.tzoffset)
+ aware = naive.replace(tzinfo=tzinfo)
+ aware = self._assign_tzname(aware, res.tzname)
+
+ elif res.tzname and res.tzname in time.tzname:
+ aware = naive.replace(tzinfo=tz.tzlocal())
+
+ # Handle ambiguous local datetime
+ aware = self._assign_tzname(aware, res.tzname)
+
+ # This is mostly relevant for winter GMT zones parsed in the UK
+ if (aware.tzname() != res.tzname and
+ res.tzname in self.info.UTCZONE):
+ aware = aware.replace(tzinfo=tz.tzutc())
+
+ elif res.tzoffset == 0:
+ aware = naive.replace(tzinfo=tz.tzutc())
+
+ elif res.tzoffset:
+ aware = naive.replace(tzinfo=tz.tzoffset(res.tzname, res.tzoffset))
+
+ elif not res.tzname and not res.tzoffset:
+ # i.e. no timezone information was found.
+ aware = naive
+
+ elif res.tzname:
+ # tz-like string was parsed but we don't know what to do
+ # with it
+ warnings.warn("tzname {tzname} identified but not understood. "
+ "Pass `tzinfos` argument in order to correctly "
+ "return a timezone-aware datetime. In a future "
+ "version, this will raise an "
+ "exception.".format(tzname=res.tzname),
+ category=UnknownTimezoneWarning)
+ aware = naive
+
+ return aware
+
+ def _build_naive(self, res, default):
+ repl = {}
+ for attr in ("year", "month", "day", "hour",
+ "minute", "second", "microsecond"):
+ value = getattr(res, attr)
+ if value is not None:
+ repl[attr] = value
+
+ if 'day' not in repl:
+ # If the default day exceeds the last day of the month, fall back
+ # to the end of the month.
+ cyear = default.year if res.year is None else res.year
+ cmonth = default.month if res.month is None else res.month
+ cday = default.day if res.day is None else res.day
+
+ if cday > monthrange(cyear, cmonth)[1]:
+ repl['day'] = monthrange(cyear, cmonth)[1]
+
+ naive = default.replace(**repl)
+
+ if res.weekday is not None and not res.day:
+ naive = naive + relativedelta.relativedelta(weekday=res.weekday)
+
+ return naive
+
+ def _assign_tzname(self, dt, tzname):
+ if dt.tzname() != tzname:
+ new_dt = tz.enfold(dt, fold=1)
+ if new_dt.tzname() == tzname:
+ return new_dt
+
+ return dt
+
+ def _to_decimal(self, val):
+ try:
+ decimal_value = Decimal(val)
+ # See GH 662, edge case, infinite value should not be converted via `_to_decimal`
+ if not decimal_value.is_finite():
+ raise ValueError("Converted decimal value is infinite or NaN")
+ except Exception as e:
+ msg = "Could not convert %s to decimal" % val
+ six.raise_from(ValueError(msg), e)
+ else:
+ return decimal_value
DEFAULTPARSER = parser()
@@ -1107,29 +1283,29 @@ def parse(timestr, parserinfo=None, **kwargs):
:class:`datetime` object is returned.
:param tzinfos:
- Additional time zone names / aliases which may be present in the
- string. This argument maps time zone names (and optionally offsets
- from those time zones) to time zones. This parameter can be a
- dictionary with timezone aliases mapping time zone names to time
- zones or a function taking two parameters (``tzname`` and
- ``tzoffset``) and returning a time zone.
+ Additional time zone names / aliases which may be present in the
+ string. This argument maps time zone names (and optionally offsets
+ from those time zones) to time zones. This parameter can be a
+ dictionary with timezone aliases mapping time zone names to time
+ zones or a function taking two parameters (``tzname`` and
+ ``tzoffset``) and returning a time zone.
- The timezones to which the names are mapped can be an integer
- offset from UTC in minutes or a :class:`tzinfo` object.
+ The timezones to which the names are mapped can be an integer
+ offset from UTC in seconds or a :class:`tzinfo` object.
- .. doctest::
- :options: +NORMALIZE_WHITESPACE
+ .. doctest::
+ :options: +NORMALIZE_WHITESPACE
- >>> from dateutil.parser import parse
- >>> from dateutil.tz import gettz
- >>> tzinfos = {"BRST": -10800, "CST": gettz("America/Chicago")}
- >>> parse("2012-01-19 17:21:00 BRST", tzinfos=tzinfos)
- datetime.datetime(2012, 1, 19, 17, 21, tzinfo=tzoffset(u'BRST', -10800))
- >>> parse("2012-01-19 17:21:00 CST", tzinfos=tzinfos)
- datetime.datetime(2012, 1, 19, 17, 21,
- tzinfo=tzfile('/usr/share/zoneinfo/America/Chicago'))
+ >>> from dateutil.parser import parse
+ >>> from dateutil.tz import gettz
+ >>> tzinfos = {"BRST": -7200, "CST": gettz("America/Chicago")}
+ >>> parse("2012-01-19 17:21:00 BRST", tzinfos=tzinfos)
+ datetime.datetime(2012, 1, 19, 17, 21, tzinfo=tzoffset(u'BRST', -7200))
+ >>> parse("2012-01-19 17:21:00 CST", tzinfos=tzinfos)
+ datetime.datetime(2012, 1, 19, 17, 21,
+ tzinfo=tzfile('/usr/share/zoneinfo/America/Chicago'))
- This parameter is ignored if ``ignoretz`` is set.
+ This parameter is ignored if ``ignoretz`` is set.
:param dayfirst:
Whether to interpret the first value in an ambiguous 3-integer date
@@ -1203,7 +1379,8 @@ def __init__(self):
def parse(self, tzstr):
res = self._result()
- l = _timelex.split(tzstr)
+ l = [x for x in re.split(r'([,:.]|[a-zA-Z]+|[0-9]+)',tzstr) if x]
+ used_idxs = list()
try:
len_l = len(l)
@@ -1222,6 +1399,9 @@ def parse(self, tzstr):
else:
offattr = "dstoffset"
res.dstabbr = "".join(l[i:j])
+
+ for ii in range(j):
+ used_idxs.append(ii)
i = j
if (i < len_l and (l[i] in ('+', '-') or l[i][0] in
"0123456789")):
@@ -1229,31 +1409,36 @@ def parse(self, tzstr):
# Yes, that's right. See the TZ variable
# documentation.
signal = (1, -1)[l[i] == '+']
+ used_idxs.append(i)
i += 1
else:
signal = -1
len_li = len(l[i])
if len_li == 4:
# -0300
- setattr(res, offattr, (int(l[i][:2])*3600 +
- int(l[i][2:])*60)*signal)
- elif i+1 < len_l and l[i+1] == ':':
+ setattr(res, offattr, (int(l[i][:2]) * 3600 +
+ int(l[i][2:]) * 60) * signal)
+ elif i + 1 < len_l and l[i + 1] == ':':
# -03:00
setattr(res, offattr,
- (int(l[i])*3600+int(l[i+2])*60)*signal)
+ (int(l[i]) * 3600 +
+ int(l[i + 2]) * 60) * signal)
+ used_idxs.append(i)
i += 2
elif len_li <= 2:
# -[0]3
setattr(res, offattr,
- int(l[i][:2])*3600*signal)
+ int(l[i][:2]) * 3600 * signal)
else:
return None
+ used_idxs.append(i)
i += 1
if res.dstabbr:
break
else:
break
+
if i < len_l:
for j in range(i, len_l):
if l[j] == ';':
@@ -1267,32 +1452,47 @@ def parse(self, tzstr):
pass
elif (8 <= l.count(',') <= 9 and
not [y for x in l[i:] if x != ','
- for y in x if y not in "0123456789"]):
+ for y in x if y not in "0123456789+-"]):
# GMT0BST,3,0,30,3600,10,0,26,7200[,3600]
for x in (res.start, res.end):
x.month = int(l[i])
+ used_idxs.append(i)
i += 2
if l[i] == '-':
- value = int(l[i+1])*-1
+ value = int(l[i + 1]) * -1
+ used_idxs.append(i)
i += 1
else:
value = int(l[i])
+ used_idxs.append(i)
i += 2
if value:
x.week = value
- x.weekday = (int(l[i])-1) % 7
+ x.weekday = (int(l[i]) - 1) % 7
else:
x.day = int(l[i])
+ used_idxs.append(i)
i += 2
x.time = int(l[i])
+ used_idxs.append(i)
i += 2
if i < len_l:
if l[i] in ('-', '+'):
signal = (-1, 1)[l[i] == "+"]
+ used_idxs.append(i)
i += 1
else:
signal = 1
- res.dstoffset = (res.stdoffset+int(l[i]))*signal
+ used_idxs.append(i)
+ res.dstoffset = (res.stdoffset + int(l[i]) * signal)
+
+ # This was a made-up format that is not in normal use
+ warn(('Parsed time zone "%s"' % tzstr) +
+ 'is in a non-standard dateutil-specific format, which ' +
+ 'is now deprecated; support for parsing this format ' +
+ 'will be removed in future versions. It is recommended ' +
+ 'that you switch to a standard format like the GNU ' +
+ 'TZ variable format.', tz.DeprecatedTzFormatWarning)
elif (l.count(',') == 2 and l[i:].count('/') <= 2 and
not [y for x in l[i:] if x not in (',', '/', 'J', 'M',
'.', '-', ':')
@@ -1300,47 +1500,59 @@ def parse(self, tzstr):
for x in (res.start, res.end):
if l[i] == 'J':
# non-leap year day (1 based)
+ used_idxs.append(i)
i += 1
x.jyday = int(l[i])
elif l[i] == 'M':
# month[-.]week[-.]weekday
+ used_idxs.append(i)
i += 1
x.month = int(l[i])
+ used_idxs.append(i)
i += 1
assert l[i] in ('-', '.')
+ used_idxs.append(i)
i += 1
x.week = int(l[i])
if x.week == 5:
x.week = -1
+ used_idxs.append(i)
i += 1
assert l[i] in ('-', '.')
+ used_idxs.append(i)
i += 1
- x.weekday = (int(l[i])-1) % 7
+ x.weekday = (int(l[i]) - 1) % 7
else:
# year day (zero based)
- x.yday = int(l[i])+1
+ x.yday = int(l[i]) + 1
+ used_idxs.append(i)
i += 1
if i < len_l and l[i] == '/':
+ used_idxs.append(i)
i += 1
# start time
len_li = len(l[i])
if len_li == 4:
# -0300
- x.time = (int(l[i][:2])*3600+int(l[i][2:])*60)
- elif i+1 < len_l and l[i+1] == ':':
+ x.time = (int(l[i][:2]) * 3600 +
+ int(l[i][2:]) * 60)
+ elif i + 1 < len_l and l[i + 1] == ':':
# -03:00
- x.time = int(l[i])*3600+int(l[i+2])*60
+ x.time = int(l[i]) * 3600 + int(l[i + 2]) * 60
+ used_idxs.append(i)
i += 2
- if i+1 < len_l and l[i+1] == ':':
+ if i + 1 < len_l and l[i + 1] == ':':
+ used_idxs.append(i)
i += 2
x.time += int(l[i])
elif len_li <= 2:
# -[0]3
- x.time = (int(l[i][:2])*3600)
+ x.time = (int(l[i][:2]) * 3600)
else:
return None
+ used_idxs.append(i)
i += 1
assert i == len_l or l[i] == ','
@@ -1352,6 +1564,8 @@ def parse(self, tzstr):
except (IndexError, ValueError, AssertionError):
return None
+ unused_idxs = set(range(len_l)).difference(used_idxs)
+ res.any_unused_tokens = not {l[n] for n in unused_idxs}.issubset({",",":"})
return res
@@ -1361,14 +1575,6 @@ def parse(self, tzstr):
def _parsetz(tzstr):
return DEFAULTTZPARSER.parse(tzstr)
-
-def _parsems(value):
- """Parse a I[.F] seconds value into (seconds, microseconds)."""
- if "." not in value:
- return int(value), 0
- else:
- i, f = value.split(".")
- return int(i), int(f.ljust(6, "0")[:6])
-
-
+class UnknownTimezoneWarning(RuntimeWarning):
+ """Raised when the parser finds a timezone it cannot parse into a tzinfo"""
# vim:ts=4:sw=4:et
diff --git a/src/libs/dateutil/parser/isoparser.py b/src/libs/dateutil/parser/isoparser.py
new file mode 100644
index 0000000..e3cf6d8
--- /dev/null
+++ b/src/libs/dateutil/parser/isoparser.py
@@ -0,0 +1,411 @@
+# -*- coding: utf-8 -*-
+"""
+This module offers a parser for ISO-8601 strings
+
+It is intended to support all valid date, time and datetime formats per the
+ISO-8601 specification.
+
+..versionadded:: 2.7.0
+"""
+from datetime import datetime, timedelta, time, date
+import calendar
+from dateutil import tz
+
+from functools import wraps
+
+import re
+import six
+
+__all__ = ["isoparse", "isoparser"]
+
+
+def _takes_ascii(f):
+ @wraps(f)
+ def func(self, str_in, *args, **kwargs):
+ # If it's a stream, read the whole thing
+ str_in = getattr(str_in, 'read', lambda: str_in)()
+
+ # If it's unicode, turn it into bytes, since ISO-8601 only covers ASCII
+ if isinstance(str_in, six.text_type):
+ # ASCII is the same in UTF-8
+ try:
+ str_in = str_in.encode('ascii')
+ except UnicodeEncodeError as e:
+ msg = 'ISO-8601 strings should contain only ASCII characters'
+ six.raise_from(ValueError(msg), e)
+
+ return f(self, str_in, *args, **kwargs)
+
+ return func
+
+
+class isoparser(object):
+ def __init__(self, sep=None):
+ """
+ :param sep:
+ A single character that separates date and time portions. If
+ ``None``, the parser will accept any single character.
+ For strict ISO-8601 adherence, pass ``'T'``.
+ """
+ if sep is not None:
+ if (len(sep) != 1 or ord(sep) >= 128 or sep in '0123456789'):
+ raise ValueError('Separator must be a single, non-numeric ' +
+ 'ASCII character')
+
+ sep = sep.encode('ascii')
+
+ self._sep = sep
+
+ @_takes_ascii
+ def isoparse(self, dt_str):
+ """
+ Parse an ISO-8601 datetime string into a :class:`datetime.datetime`.
+
+ An ISO-8601 datetime string consists of a date portion, followed
+ optionally by a time portion - the date and time portions are separated
+ by a single character separator, which is ``T`` in the official
+ standard. Incomplete date formats (such as ``YYYY-MM``) may *not* be
+ combined with a time portion.
+
+ Supported date formats are:
+
+ Common:
+
+ - ``YYYY``
+ - ``YYYY-MM`` or ``YYYYMM``
+ - ``YYYY-MM-DD`` or ``YYYYMMDD``
+
+ Uncommon:
+
+ - ``YYYY-Www`` or ``YYYYWww`` - ISO week (day defaults to 0)
+ - ``YYYY-Www-D`` or ``YYYYWwwD`` - ISO week and day
+
+ The ISO week and day numbering follows the same logic as
+ :func:`datetime.date.isocalendar`.
+
+ Supported time formats are:
+
+ - ``hh``
+ - ``hh:mm`` or ``hhmm``
+ - ``hh:mm:ss`` or ``hhmmss``
+ - ``hh:mm:ss.ssssss`` (Up to 6 sub-second digits)
+
+ Midnight is a special case for `hh`, as the standard supports both
+ 00:00 and 24:00 as a representation. The decimal separator can be
+ either a dot or a comma.
+
+
+ .. caution::
+
+ Support for fractional components other than seconds is part of the
+ ISO-8601 standard, but is not currently implemented in this parser.
+
+ Supported time zone offset formats are:
+
+ - `Z` (UTC)
+ - `±HH:MM`
+ - `±HHMM`
+ - `±HH`
+
+ Offsets will be represented as :class:`dateutil.tz.tzoffset` objects,
+ with the exception of UTC, which will be represented as
+ :class:`dateutil.tz.tzutc`. Time zone offsets equivalent to UTC (such
+ as `+00:00`) will also be represented as :class:`dateutil.tz.tzutc`.
+
+ :param dt_str:
+ A string or stream containing only an ISO-8601 datetime string
+
+ :return:
+ Returns a :class:`datetime.datetime` representing the string.
+ Unspecified components default to their lowest value.
+
+ .. warning::
+
+ As of version 2.7.0, the strictness of the parser should not be
+ considered a stable part of the contract. Any valid ISO-8601 string
+ that parses correctly with the default settings will continue to
+ parse correctly in future versions, but invalid strings that
+ currently fail (e.g. ``2017-01-01T00:00+00:00:00``) are not
+ guaranteed to continue failing in future versions if they encode
+ a valid date.
+
+ .. versionadded:: 2.7.0
+ """
+ components, pos = self._parse_isodate(dt_str)
+
+ if len(dt_str) > pos:
+ if self._sep is None or dt_str[pos:pos + 1] == self._sep:
+ components += self._parse_isotime(dt_str[pos + 1:])
+ else:
+ raise ValueError('String contains unknown ISO components')
+
+ if len(components) > 3 and components[3] == 24:
+ components[3] = 0
+ return datetime(*components) + timedelta(days=1)
+
+ return datetime(*components)
+
+ @_takes_ascii
+ def parse_isodate(self, datestr):
+ """
+ Parse the date portion of an ISO string.
+
+ :param datestr:
+ The string portion of an ISO string, without a separator
+
+ :return:
+ Returns a :class:`datetime.date` object
+ """
+ components, pos = self._parse_isodate(datestr)
+ if pos < len(datestr):
+ raise ValueError('String contains unknown ISO ' +
+ 'components: {}'.format(datestr))
+ return date(*components)
+
+ @_takes_ascii
+ def parse_isotime(self, timestr):
+ """
+ Parse the time portion of an ISO string.
+
+ :param timestr:
+ The time portion of an ISO string, without a separator
+
+ :return:
+ Returns a :class:`datetime.time` object
+ """
+ components = self._parse_isotime(timestr)
+ if components[0] == 24:
+ components[0] = 0
+ return time(*components)
+
+ @_takes_ascii
+ def parse_tzstr(self, tzstr, zero_as_utc=True):
+ """
+ Parse a valid ISO time zone string.
+
+ See :func:`isoparser.isoparse` for details on supported formats.
+
+ :param tzstr:
+ A string representing an ISO time zone offset
+
+ :param zero_as_utc:
+ Whether to return :class:`dateutil.tz.tzutc` for zero-offset zones
+
+ :return:
+ Returns :class:`dateutil.tz.tzoffset` for offsets and
+ :class:`dateutil.tz.tzutc` for ``Z`` and (if ``zero_as_utc`` is
+ specified) offsets equivalent to UTC.
+ """
+ return self._parse_tzstr(tzstr, zero_as_utc=zero_as_utc)
+
+ # Constants
+ _DATE_SEP = b'-'
+ _TIME_SEP = b':'
+ _FRACTION_REGEX = re.compile(b'[\\.,]([0-9]+)')
+
+ def _parse_isodate(self, dt_str):
+ try:
+ return self._parse_isodate_common(dt_str)
+ except ValueError:
+ return self._parse_isodate_uncommon(dt_str)
+
+ def _parse_isodate_common(self, dt_str):
+ len_str = len(dt_str)
+ components = [1, 1, 1]
+
+ if len_str < 4:
+ raise ValueError('ISO string too short')
+
+ # Year
+ components[0] = int(dt_str[0:4])
+ pos = 4
+ if pos >= len_str:
+ return components, pos
+
+ has_sep = dt_str[pos:pos + 1] == self._DATE_SEP
+ if has_sep:
+ pos += 1
+
+ # Month
+ if len_str - pos < 2:
+ raise ValueError('Invalid common month')
+
+ components[1] = int(dt_str[pos:pos + 2])
+ pos += 2
+
+ if pos >= len_str:
+ if has_sep:
+ return components, pos
+ else:
+ raise ValueError('Invalid ISO format')
+
+ if has_sep:
+ if dt_str[pos:pos + 1] != self._DATE_SEP:
+ raise ValueError('Invalid separator in ISO string')
+ pos += 1
+
+ # Day
+ if len_str - pos < 2:
+ raise ValueError('Invalid common day')
+ components[2] = int(dt_str[pos:pos + 2])
+ return components, pos + 2
+
+ def _parse_isodate_uncommon(self, dt_str):
+ if len(dt_str) < 4:
+ raise ValueError('ISO string too short')
+
+ # All ISO formats start with the year
+ year = int(dt_str[0:4])
+
+ has_sep = dt_str[4:5] == self._DATE_SEP
+
+ pos = 4 + has_sep # Skip '-' if it's there
+ if dt_str[pos:pos + 1] == b'W':
+ # YYYY-?Www-?D?
+ pos += 1
+ weekno = int(dt_str[pos:pos + 2])
+ pos += 2
+
+ dayno = 1
+ if len(dt_str) > pos:
+ if (dt_str[pos:pos + 1] == self._DATE_SEP) != has_sep:
+ raise ValueError('Inconsistent use of dash separator')
+
+ pos += has_sep
+
+ dayno = int(dt_str[pos:pos + 1])
+ pos += 1
+
+ base_date = self._calculate_weekdate(year, weekno, dayno)
+ else:
+ # YYYYDDD or YYYY-DDD
+ if len(dt_str) - pos < 3:
+ raise ValueError('Invalid ordinal day')
+
+ ordinal_day = int(dt_str[pos:pos + 3])
+ pos += 3
+
+ if ordinal_day < 1 or ordinal_day > (365 + calendar.isleap(year)):
+ raise ValueError('Invalid ordinal day' +
+ ' {} for year {}'.format(ordinal_day, year))
+
+ base_date = date(year, 1, 1) + timedelta(days=ordinal_day - 1)
+
+ components = [base_date.year, base_date.month, base_date.day]
+ return components, pos
+
+ def _calculate_weekdate(self, year, week, day):
+ """
+ Calculate the day of corresponding to the ISO year-week-day calendar.
+
+ This function is effectively the inverse of
+ :func:`datetime.date.isocalendar`.
+
+ :param year:
+ The year in the ISO calendar
+
+ :param week:
+ The week in the ISO calendar - range is [1, 53]
+
+ :param day:
+ The day in the ISO calendar - range is [1 (MON), 7 (SUN)]
+
+ :return:
+ Returns a :class:`datetime.date`
+ """
+ if not 0 < week < 54:
+ raise ValueError('Invalid week: {}'.format(week))
+
+ if not 0 < day < 8: # Range is 1-7
+ raise ValueError('Invalid weekday: {}'.format(day))
+
+ # Get week 1 for the specific year:
+ jan_4 = date(year, 1, 4) # Week 1 always has January 4th in it
+ week_1 = jan_4 - timedelta(days=jan_4.isocalendar()[2] - 1)
+
+ # Now add the specific number of weeks and days to get what we want
+ week_offset = (week - 1) * 7 + (day - 1)
+ return week_1 + timedelta(days=week_offset)
+
+ def _parse_isotime(self, timestr):
+ len_str = len(timestr)
+ components = [0, 0, 0, 0, None]
+ pos = 0
+ comp = -1
+
+ if len(timestr) < 2:
+ raise ValueError('ISO time too short')
+
+ has_sep = len_str >= 3 and timestr[2:3] == self._TIME_SEP
+
+ while pos < len_str and comp < 5:
+ comp += 1
+
+ if timestr[pos:pos + 1] in b'-+Zz':
+ # Detect time zone boundary
+ components[-1] = self._parse_tzstr(timestr[pos:])
+ pos = len_str
+ break
+
+ if comp < 3:
+ # Hour, minute, second
+ components[comp] = int(timestr[pos:pos + 2])
+ pos += 2
+ if (has_sep and pos < len_str and
+ timestr[pos:pos + 1] == self._TIME_SEP):
+ pos += 1
+
+ if comp == 3:
+ # Fraction of a second
+ frac = self._FRACTION_REGEX.match(timestr[pos:])
+ if not frac:
+ continue
+
+ us_str = frac.group(1)[:6] # Truncate to microseconds
+ components[comp] = int(us_str) * 10**(6 - len(us_str))
+ pos += len(frac.group())
+
+ if pos < len_str:
+ raise ValueError('Unused components in ISO string')
+
+ if components[0] == 24:
+ # Standard supports 00:00 and 24:00 as representations of midnight
+ if any(component != 0 for component in components[1:4]):
+ raise ValueError('Hour may only be 24 at 24:00:00.000')
+
+ return components
+
+ def _parse_tzstr(self, tzstr, zero_as_utc=True):
+ if tzstr == b'Z' or tzstr == b'z':
+ return tz.tzutc()
+
+ if len(tzstr) not in {3, 5, 6}:
+ raise ValueError('Time zone offset must be 1, 3, 5 or 6 characters')
+
+ if tzstr[0:1] == b'-':
+ mult = -1
+ elif tzstr[0:1] == b'+':
+ mult = 1
+ else:
+ raise ValueError('Time zone offset requires sign')
+
+ hours = int(tzstr[1:3])
+ if len(tzstr) == 3:
+ minutes = 0
+ else:
+ minutes = int(tzstr[(4 if tzstr[3:4] == self._TIME_SEP else 3):])
+
+ if zero_as_utc and hours == 0 and minutes == 0:
+ return tz.tzutc()
+ else:
+ if minutes > 59:
+ raise ValueError('Invalid minutes in time zone offset')
+
+ if hours > 23:
+ raise ValueError('Invalid hours in time zone offset')
+
+ return tz.tzoffset(None, mult * (hours * 60 + minutes) * 60)
+
+
+DEFAULT_ISOPARSER = isoparser()
+isoparse = DEFAULT_ISOPARSER.isoparse
diff --git a/src/libs/dateutil/relativedelta.py b/src/libs/dateutil/relativedelta.py
index 0e66afc..c65c66e 100644
--- a/src/libs/dateutil/relativedelta.py
+++ b/src/libs/dateutil/relativedelta.py
@@ -17,9 +17,13 @@
class relativedelta(object):
"""
- The relativedelta type is based on the specification of the excellent
- work done by M.-A. Lemburg in his
- `mx.DateTime `_ extension.
+ The relativedelta type is designed to be applied to an existing datetime and
+ can replace specific components of that datetime, or represents an interval
+ of time.
+
+ It is based on the specification of the excellent work done by M.-A. Lemburg
+ in his
+ `mx.DateTime `_ extension.
However, notice that this type does *NOT* implement the same algorithm as
his work. Do *NOT* expect it to behave like mx.DateTime's counterpart.
@@ -34,7 +38,7 @@ class relativedelta(object):
year, month, day, hour, minute, second, microsecond:
Absolute information (argument is singular); adding or subtracting a
- relativedelta with absolute information does not perform an aritmetic
+ relativedelta with absolute information does not perform an arithmetic
operation, but rather REPLACES the corresponding value in the
original datetime with the value(s) in relativedelta.
@@ -44,12 +48,16 @@ class relativedelta(object):
the corresponding aritmetic operation on the original datetime value
with the information in the relativedelta.
- weekday:
- One of the weekday instances (MO, TU, etc). These instances may
- receive a parameter N, specifying the Nth weekday, which could
- be positive or negative (like MO(+1) or MO(-2). Not specifying
- it is the same as specifying +1. You can also use an integer,
- where 0=MO.
+ weekday:
+ One of the weekday instances (MO, TU, etc) available in the
+ relativedelta module. These instances may receive a parameter N,
+ specifying the Nth weekday, which could be positive or negative
+ (like MO(+1) or MO(-2)). Not specifying it is the same as specifying
+ +1. You can also use an integer, where 0=MO. This argument is always
+ relative e.g. if the calculated date is already Monday, using MO(1)
+ or MO(-1) won't change the day. To effectively make it absolute, use
+ it in combination with the day argument (e.g. day=1, MO(1) for first
+ Monday of the month).
leapdays:
Will add given days to the date found, if year is a leap
@@ -59,33 +67,39 @@ class relativedelta(object):
Set the yearday or the non-leap year day (jump leap days).
These are converted to day/month/leapdays information.
- Here is the behavior of operations with relativedelta:
+ There are relative and absolute forms of the keyword
+ arguments. The plural is relative, and the singular is
+ absolute. For each argument in the order below, the absolute form
+ is applied first (by setting each attribute to that value) and
+ then the relative form (by adding the value to the attribute).
- 1. Calculate the absolute year, using the 'year' argument, or the
- original datetime year, if the argument is not present.
+ The order of attributes considered when this relativedelta is
+ added to a datetime is:
- 2. Add the relative 'years' argument to the absolute year.
+ 1. Year
+ 2. Month
+ 3. Day
+ 4. Hours
+ 5. Minutes
+ 6. Seconds
+ 7. Microseconds
- 3. Do steps 1 and 2 for month/months.
+ Finally, weekday is applied, using the rule described above.
- 4. Calculate the absolute day, using the 'day' argument, or the
- original datetime day, if the argument is not present. Then,
- subtract from the day until it fits in the year and month
- found after their operations.
+ For example
- 5. Add the relative 'days' argument to the absolute day. Notice
- that the 'weeks' argument is multiplied by 7 and added to
- 'days'.
+ >>> from datetime import datetime
+ >>> from dateutil.relativedelta import relativedelta, MO
+ >>> dt = datetime(2018, 4, 9, 13, 37, 0)
+ >>> delta = relativedelta(hours=25, day=1, weekday=MO(1))
+ >>> dt + delta
+ datetime.datetime(2018, 4, 2, 14, 37)
- 6. Do steps 1 and 2 for hour/hours, minute/minutes, second/seconds,
- microsecond/microseconds.
+ First, the day is set to 1 (the first of the month), then 25 hours
+ are added, to get to the 2nd day and 14th hour, finally the
+ weekday is applied, but since the 2nd is already a Monday there is
+ no effect.
- 7. If the 'weekday' argument is present, calculate the weekday,
- with the given (wday, nth) tuple. wday is the index of the
- weekday (0-6, 0=Mon), and nth is the number of weeks to add
- forward or backward, depending on its signal. Notice that if
- the calculated date is already Monday, for example, using
- (0, 1) or (0, -1) won't change the day.
"""
def __init__(self, dt1=None, dt2=None,
@@ -95,11 +109,6 @@ def __init__(self, dt1=None, dt2=None,
yearday=None, nlyearday=None,
hour=None, minute=None, second=None, microsecond=None):
- # Check for non-integer values in integer-only quantities
- if any(x is not None and x != int(x) for x in (years, months)):
- raise ValueError("Non-integer years and months are "
- "ambiguous and not currently supported.")
-
if dt1 and dt2:
# datetime is a subclass of date. So both must be date
if not (isinstance(dt1, datetime.date) and
@@ -159,9 +168,14 @@ def __init__(self, dt1=None, dt2=None,
self.seconds = delta.seconds + delta.days * 86400
self.microseconds = delta.microseconds
else:
+ # Check for non-integer values in integer-only quantities
+ if any(x is not None and x != int(x) for x in (years, months)):
+ raise ValueError("Non-integer years and months are "
+ "ambiguous and not currently supported.")
+
# Relative information
- self.years = years
- self.months = months
+ self.years = int(years)
+ self.months = int(months)
self.days = days + weeks * 7
self.leapdays = leapdays
self.hours = hours
@@ -249,7 +263,7 @@ def _fix(self):
@property
def weeks(self):
- return self.days // 7
+ return int(self.days / 7.0)
@weeks.setter
def weeks(self, value):
@@ -271,7 +285,7 @@ def normalized(self):
values for the relative attributes.
>>> relativedelta(days=1.5, hours=2).normalized()
- relativedelta(days=1, hours=14)
+ relativedelta(days=+1, hours=+14)
:return:
Returns a :class:`dateutil.relativedelta.relativedelta` object.
@@ -422,6 +436,24 @@ def __sub__(self, other):
is not None else
other.microsecond))
+ def __abs__(self):
+ return self.__class__(years=abs(self.years),
+ months=abs(self.months),
+ days=abs(self.days),
+ hours=abs(self.hours),
+ minutes=abs(self.minutes),
+ seconds=abs(self.seconds),
+ microseconds=abs(self.microseconds),
+ leapdays=self.leapdays,
+ year=self.year,
+ month=self.month,
+ day=self.day,
+ weekday=self.weekday,
+ hour=self.hour,
+ minute=self.minute,
+ second=self.second,
+ microsecond=self.microsecond)
+
def __neg__(self):
return self.__class__(years=-self.years,
months=-self.months,
@@ -512,7 +544,25 @@ def __eq__(self, other):
self.second == other.second and
self.microsecond == other.microsecond)
- __hash__ = None
+ def __hash__(self):
+ return hash((
+ self.weekday,
+ self.years,
+ self.months,
+ self.days,
+ self.hours,
+ self.minutes,
+ self.seconds,
+ self.microseconds,
+ self.leapdays,
+ self.year,
+ self.month,
+ self.day,
+ self.hour,
+ self.minute,
+ self.second,
+ self.microsecond,
+ ))
def __ne__(self, other):
return not self.__eq__(other)
diff --git a/src/libs/dateutil/rrule.py b/src/libs/dateutil/rrule.py
index 429f8fc..20a0c4a 100644
--- a/src/libs/dateutil/rrule.py
+++ b/src/libs/dateutil/rrule.py
@@ -2,12 +2,13 @@
"""
The rrule module offers a small, complete, and very fast, implementation of
the recurrence rules documented in the
-`iCalendar RFC `_,
+`iCalendar RFC `_,
including support for caching of results.
"""
import itertools
import datetime
import calendar
+import re
import sys
try:
@@ -20,6 +21,7 @@
import heapq
from ._common import weekday as weekdaybase
+from .tz import tzutc, tzlocal
# For warning about deprecation of until and count
from warnings import warn
@@ -335,10 +337,6 @@ class rrule(rrulebase):
Additionally, it supports the following keyword arguments:
- :param cache:
- If given, it must be a boolean value specifying to enable or disable
- caching of results. If you will use the same rrule instance multiple
- times, enabling caching will improve the performance considerably.
:param dtstart:
The recurrence start. Besides being the base for the recurrence,
missing parameters in the final recurrence instances will also be
@@ -355,20 +353,26 @@ class rrule(rrulebase):
from calendar.firstweekday(), and may be modified by
calendar.setfirstweekday().
:param count:
- How many occurrences will be generated.
+ If given, this determines how many occurrences will be generated.
.. note::
- As of version 2.5.0, the use of the ``until`` keyword together
- with the ``count`` keyword is deprecated per RFC-2445 Sec. 4.3.10.
+ As of version 2.5.0, the use of the keyword ``until`` in conjunction
+ with ``count`` is deprecated, to make sure ``dateutil`` is fully
+ compliant with `RFC-5545 Sec. 3.3.10 `_. Therefore, ``until`` and ``count``
+ **must not** occur in the same call to ``rrule``.
:param until:
- If given, this must be a datetime instance, that will specify the
+ If given, this must be a datetime instance specifying the upper-bound
limit of the recurrence. The last recurrence in the rule is the greatest
datetime that is less than or equal to the value specified in the
``until`` parameter.
.. note::
- As of version 2.5.0, the use of the ``until`` keyword together
- with the ``count`` keyword is deprecated per RFC-2445 Sec. 4.3.10.
+ As of version 2.5.0, the use of the keyword ``until`` in conjunction
+ with ``count`` is deprecated, to make sure ``dateutil`` is fully
+ compliant with `RFC-5545 Sec. 3.3.10 `_. Therefore, ``until`` and ``count``
+ **must not** occur in the same call to ``rrule``.
:param bysetpos:
If given, it must be either an integer, or a sequence of integers,
positive or negative. Each given integer will specify an occurrence
@@ -385,6 +389,11 @@ class rrule(rrulebase):
:param byyearday:
If given, it must be either an integer, or a sequence of integers,
meaning the year days to apply the recurrence to.
+ :param byeaster:
+ If given, it must be either an integer, or a sequence of integers,
+ positive or negative. Each integer will define an offset from the
+ Easter Sunday. Passing the offset 0 to byeaster will yield the Easter
+ Sunday itself. This is an extension to the RFC specification.
:param byweekno:
If given, it must be either an integer, or a sequence of integers,
meaning the week numbers to apply the recurrence to. Week numbers
@@ -410,11 +419,10 @@ class rrule(rrulebase):
:param bysecond:
If given, it must be either an integer, or a sequence of integers,
meaning the seconds to apply the recurrence to.
- :param byeaster:
- If given, it must be either an integer, or a sequence of integers,
- positive or negative. Each integer will define an offset from the
- Easter Sunday. Passing the offset 0 to byeaster will yield the Easter
- Sunday itself. This is an extension to the RFC specification.
+ :param cache:
+ If given, it must be a boolean value specifying to enable or disable
+ caching of results. If you will use the same rrule instance multiple
+ times, enabling caching will improve the performance considerably.
"""
def __init__(self, freq, dtstart=None,
interval=1, wkst=None, count=None, until=None, bysetpos=None,
@@ -425,7 +433,10 @@ def __init__(self, freq, dtstart=None,
super(rrule, self).__init__(cache)
global easter
if not dtstart:
- dtstart = datetime.datetime.now().replace(microsecond=0)
+ if until and until.tzinfo:
+ dtstart = datetime.datetime.now(tz=until.tzinfo).replace(microsecond=0)
+ else:
+ dtstart = datetime.datetime.now().replace(microsecond=0)
elif not isinstance(dtstart, datetime.datetime):
dtstart = datetime.datetime.fromordinal(dtstart.toordinal())
else:
@@ -446,8 +457,22 @@ def __init__(self, freq, dtstart=None,
until = datetime.datetime.fromordinal(until.toordinal())
self._until = until
+ if self._dtstart and self._until:
+ if (self._dtstart.tzinfo is not None) != (self._until.tzinfo is not None):
+ # According to RFC5545 Section 3.3.10:
+ # https://tools.ietf.org/html/rfc5545#section-3.3.10
+ #
+ # > If the "DTSTART" property is specified as a date with UTC
+ # > time or a date with local time and time zone reference,
+ # > then the UNTIL rule part MUST be specified as a date with
+ # > UTC time.
+ raise ValueError(
+ 'RRULE UNTIL values must be specified in UTC when DTSTART '
+ 'is timezone-aware'
+ )
+
if count is not None and until:
- warn("Using both 'count' and 'until' is inconsistent with RFC 2445"
+ warn("Using both 'count' and 'until' is inconsistent with RFC 5545"
" and has been deprecated in dateutil. Future versions will "
"raise an error.", DeprecationWarning)
@@ -584,13 +609,13 @@ def __init__(self, freq, dtstart=None,
self._byweekday = tuple(sorted(self._byweekday))
orig_byweekday = [weekday(x) for x in self._byweekday]
else:
- orig_byweekday = tuple()
+ orig_byweekday = ()
if self._bynweekday is not None:
self._bynweekday = tuple(sorted(self._bynweekday))
orig_bynweekday = [weekday(*x) for x in self._bynweekday]
else:
- orig_bynweekday = tuple()
+ orig_bynweekday = ()
if 'byweekday' not in self._original_rule:
self._original_rule['byweekday'] = tuple(itertools.chain(
@@ -599,7 +624,7 @@ def __init__(self, freq, dtstart=None,
# byhour
if byhour is None:
if freq < HOURLY:
- self._byhour = set((dtstart.hour,))
+ self._byhour = {dtstart.hour}
else:
self._byhour = None
else:
@@ -619,7 +644,7 @@ def __init__(self, freq, dtstart=None,
# byminute
if byminute is None:
if freq < MINUTELY:
- self._byminute = set((dtstart.minute,))
+ self._byminute = {dtstart.minute}
else:
self._byminute = None
else:
@@ -674,7 +699,7 @@ def __init__(self, freq, dtstart=None,
def __str__(self):
"""
Output a string that would generate this RRULE if passed to rrulestr.
- This is mostly compatible with RFC2445, except for the
+ This is mostly compatible with RFC5545, except for the
dateutil-specific extension BYEASTER.
"""
@@ -699,7 +724,7 @@ def __str__(self):
if self._original_rule.get('byweekday') is not None:
# The str() method on weekday objects doesn't generate
- # RFC2445-compliant strings, so we should modify that.
+ # RFC5545-compliant strings, so we should modify that.
original_rule = dict(self._original_rule)
wday_strings = []
for wday in original_rule['byweekday']:
@@ -730,7 +755,7 @@ def __str__(self):
parts.append(partfmt.format(name=name, vals=(','.join(str(v)
for v in value))))
- output.append(';'.join(parts))
+ output.append('RRULE:' + ';'.join(parts))
return '\n'.join(output)
def replace(self, **kwargs):
@@ -1387,7 +1412,52 @@ def _iter(self):
self._len = total
+
+
class _rrulestr(object):
+ """ Parses a string representation of a recurrence rule or set of
+ recurrence rules.
+
+ :param s:
+ Required, a string defining one or more recurrence rules.
+
+ :param dtstart:
+ If given, used as the default recurrence start if not specified in the
+ rule string.
+
+ :param cache:
+ If set ``True`` caching of results will be enabled, improving
+ performance of multiple queries considerably.
+
+ :param unfold:
+ If set ``True`` indicates that a rule string is split over more
+ than one line and should be joined before processing.
+
+ :param forceset:
+ If set ``True`` forces a :class:`dateutil.rrule.rruleset` to
+ be returned.
+
+ :param compatible:
+ If set ``True`` forces ``unfold`` and ``forceset`` to be ``True``.
+
+ :param ignoretz:
+ If set ``True``, time zones in parsed strings are ignored and a naive
+ :class:`datetime.datetime` object is returned.
+
+ :param tzids:
+ If given, a callable or mapping used to retrieve a
+ :class:`datetime.tzinfo` from a string representation.
+ Defaults to :func:`dateutil.tz.gettz`.
+
+ :param tzinfos:
+ Additional time zone names / aliases which may be present in a string
+ representation. See :func:`dateutil.parser.parse` for more
+ information.
+
+ :return:
+ Returns a :class:`dateutil.rrule.rruleset` or
+ :class:`dateutil.rrule.rrule`
+ """
_freq_map = {"YEARLY": YEARLY,
"MONTHLY": MONTHLY,
@@ -1489,6 +1559,58 @@ def _parse_rfc_rrule(self, line,
raise ValueError("invalid '%s': %s" % (name, value))
return rrule(dtstart=dtstart, cache=cache, **rrkwargs)
+ def _parse_date_value(self, date_value, parms, rule_tzids,
+ ignoretz, tzids, tzinfos):
+ global parser
+ if not parser:
+ from dateutil import parser
+
+ datevals = []
+ value_found = False
+ TZID = None
+
+ for parm in parms:
+ if parm.startswith("TZID="):
+ try:
+ tzkey = rule_tzids[parm.split('TZID=')[-1]]
+ except KeyError:
+ continue
+ if tzids is None:
+ from . import tz
+ tzlookup = tz.gettz
+ elif callable(tzids):
+ tzlookup = tzids
+ else:
+ tzlookup = getattr(tzids, 'get', None)
+ if tzlookup is None:
+ msg = ('tzids must be a callable, mapping, or None, '
+ 'not %s' % tzids)
+ raise ValueError(msg)
+
+ TZID = tzlookup(tzkey)
+ continue
+
+ # RFC 5445 3.8.2.4: The VALUE parameter is optional, but may be found
+ # only once.
+ if parm not in {"VALUE=DATE-TIME", "VALUE=DATE"}:
+ raise ValueError("unsupported parm: " + parm)
+ else:
+ if value_found:
+ msg = ("Duplicate value parameter found in: " + parm)
+ raise ValueError(msg)
+ value_found = True
+
+ for datestr in date_value.split(','):
+ date = parser.parse(datestr, ignoretz=ignoretz, tzinfos=tzinfos)
+ if TZID is not None:
+ if date.tzinfo is None:
+ date = date.replace(tzinfo=TZID)
+ else:
+ raise ValueError('DTSTART/EXDATE specifies multiple timezone')
+ datevals.append(date)
+
+ return datevals
+
def _parse_rfc(self, s,
dtstart=None,
cache=False,
@@ -1496,11 +1618,17 @@ def _parse_rfc(self, s,
forceset=False,
compatible=False,
ignoretz=False,
+ tzids=None,
tzinfos=None):
global parser
if compatible:
forceset = True
unfold = True
+
+ TZID_NAMES = dict(map(
+ lambda x: (x.upper(), x),
+ re.findall('TZID=(?P[^:]+):', s)
+ ))
s = s.upper()
if not s.strip():
raise ValueError("empty string")
@@ -1555,17 +1683,18 @@ def _parse_rfc(self, s,
raise ValueError("unsupported EXRULE parm: "+parm)
exrulevals.append(value)
elif name == "EXDATE":
- for parm in parms:
- if parm != "VALUE=DATE-TIME":
- raise ValueError("unsupported EXDATE parm: "+parm)
- exdatevals.append(value)
+ exdatevals.extend(
+ self._parse_date_value(value, parms,
+ TZID_NAMES, ignoretz,
+ tzids, tzinfos)
+ )
elif name == "DTSTART":
- for parm in parms:
- raise ValueError("unsupported DTSTART parm: "+parm)
- if not parser:
- from dateutil import parser
- dtstart = parser.parse(value, ignoretz=ignoretz,
- tzinfos=tzinfos)
+ dtvals = self._parse_date_value(value, parms, TZID_NAMES,
+ ignoretz, tzids, tzinfos)
+ if len(dtvals) != 1:
+ raise ValueError("Multiple DTSTART values specified:" +
+ value)
+ dtstart = dtvals[0]
else:
raise ValueError("unsupported property: "+name)
if (forceset or len(rrulevals) > 1 or rdatevals
@@ -1587,10 +1716,7 @@ def _parse_rfc(self, s,
ignoretz=ignoretz,
tzinfos=tzinfos))
for value in exdatevals:
- for datestr in value.split(','):
- rset.exdate(parser.parse(datestr,
- ignoretz=ignoretz,
- tzinfos=tzinfos))
+ rset.exdate(value)
if compatible and dtstart:
rset.rdate(dtstart)
return rset
diff --git a/src/libs/dateutil/tz/__init__.py b/src/libs/dateutil/tz/__init__.py
index b0a5043..5a2d9cd 100644
--- a/src/libs/dateutil/tz/__init__.py
+++ b/src/libs/dateutil/tz/__init__.py
@@ -1,5 +1,17 @@
+# -*- coding: utf-8 -*-
from .tz import *
+from .tz import __doc__
+
+#: Convenience constant providing a :class:`tzutc()` instance
+#:
+#: .. versionadded:: 2.7.0
+UTC = tzutc()
__all__ = ["tzutc", "tzoffset", "tzlocal", "tzfile", "tzrange",
"tzstr", "tzical", "tzwin", "tzwinlocal", "gettz",
- "enfold", "datetime_ambiguous", "datetime_exists"]
+ "enfold", "datetime_ambiguous", "datetime_exists",
+ "resolve_imaginary", "UTC", "DeprecatedTzFormatWarning"]
+
+
+class DeprecatedTzFormatWarning(Warning):
+ """Warning raised when time zones are parsed from deprecated formats."""
diff --git a/src/libs/dateutil/tz/_common.py b/src/libs/dateutil/tz/_common.py
index f1cf2af..594e082 100644
--- a/src/libs/dateutil/tz/_common.py
+++ b/src/libs/dateutil/tz/_common.py
@@ -1,4 +1,4 @@
-from six import PY3
+from six import PY2
from functools import wraps
@@ -16,14 +16,18 @@ def tzname_in_python2(namefunc):
tzname() API changed in Python 3. It used to return bytes, but was changed
to unicode strings
"""
- def adjust_encoding(*args, **kwargs):
- name = namefunc(*args, **kwargs)
- if name is not None and not PY3:
- name = name.encode()
+ if PY2:
+ @wraps(namefunc)
+ def adjust_encoding(*args, **kwargs):
+ name = namefunc(*args, **kwargs)
+ if name is not None:
+ name = name.encode()
- return name
+ return name
- return adjust_encoding
+ return adjust_encoding
+ else:
+ return namefunc
# The following is adapted from Alexander Belopolsky's tz library
@@ -61,6 +65,36 @@ class _DatetimeWithFold(datetime):
"""
__slots__ = ()
+ def replace(self, *args, **kwargs):
+ """
+ Return a datetime with the same attributes, except for those
+ attributes given new values by whichever keyword arguments are
+ specified. Note that tzinfo=None can be specified to create a naive
+ datetime from an aware datetime with no conversion of date and time
+ data.
+
+ This is reimplemented in ``_DatetimeWithFold`` because pypy3 will
+ return a ``datetime.datetime`` even if ``fold`` is unchanged.
+ """
+ argnames = (
+ 'year', 'month', 'day', 'hour', 'minute', 'second',
+ 'microsecond', 'tzinfo'
+ )
+
+ for arg, argname in zip(args, argnames):
+ if argname in kwargs:
+ raise TypeError('Duplicate argument: {}'.format(argname))
+
+ kwargs[argname] = arg
+
+ for argname in argnames:
+ if argname not in kwargs:
+ kwargs[argname] = getattr(self, argname)
+
+ dt_class = self.__class__ if kwargs.get('fold', 1) else datetime
+
+ return dt_class(**kwargs)
+
@property
def fold(self):
return 1
@@ -383,12 +417,3 @@ def __repr__(self):
return "%s(...)" % self.__class__.__name__
__reduce__ = object.__reduce__
-
-
-def _total_seconds(td):
- # Python 2.6 doesn't have a total_seconds() method on timedelta objects
- return ((td.seconds + td.days * 86400) * 1000000 +
- td.microseconds) // 1000000
-
-
-_total_seconds = getattr(timedelta, 'total_seconds', _total_seconds)
diff --git a/src/libs/dateutil/tz/_factories.py b/src/libs/dateutil/tz/_factories.py
new file mode 100644
index 0000000..d2560eb
--- /dev/null
+++ b/src/libs/dateutil/tz/_factories.py
@@ -0,0 +1,73 @@
+from datetime import timedelta
+import weakref
+from collections import OrderedDict
+
+
+class _TzSingleton(type):
+ def __init__(cls, *args, **kwargs):
+ cls.__instance = None
+ super(_TzSingleton, cls).__init__(*args, **kwargs)
+
+ def __call__(cls):
+ if cls.__instance is None:
+ cls.__instance = super(_TzSingleton, cls).__call__()
+ return cls.__instance
+
+
+class _TzFactory(type):
+ def instance(cls, *args, **kwargs):
+ """Alternate constructor that returns a fresh instance"""
+ return type.__call__(cls, *args, **kwargs)
+
+
+class _TzOffsetFactory(_TzFactory):
+ def __init__(cls, *args, **kwargs):
+ cls.__instances = weakref.WeakValueDictionary()
+ cls.__strong_cache = OrderedDict()
+ cls.__strong_cache_size = 8
+
+ def __call__(cls, name, offset):
+ if isinstance(offset, timedelta):
+ key = (name, offset.total_seconds())
+ else:
+ key = (name, offset)
+
+ instance = cls.__instances.get(key, None)
+ if instance is None:
+ instance = cls.__instances.setdefault(key,
+ cls.instance(name, offset))
+
+ cls.__strong_cache[key] = cls.__strong_cache.pop(key, instance)
+
+ # Remove an item if the strong cache is overpopulated
+ # TODO: Maybe this should be under a lock?
+ if len(cls.__strong_cache) > cls.__strong_cache_size:
+ cls.__strong_cache.popitem(last=False)
+
+ return instance
+
+
+class _TzStrFactory(_TzFactory):
+ def __init__(cls, *args, **kwargs):
+ cls.__instances = weakref.WeakValueDictionary()
+ cls.__strong_cache = OrderedDict()
+ cls.__strong_cache_size = 8
+
+ def __call__(cls, s, posix_offset=False):
+ key = (s, posix_offset)
+ instance = cls.__instances.get(key, None)
+
+ if instance is None:
+ instance = cls.__instances.setdefault(key,
+ cls.instance(s, posix_offset))
+
+ cls.__strong_cache[key] = cls.__strong_cache.pop(key, instance)
+
+
+ # Remove an item if the strong cache is overpopulated
+ # TODO: Maybe this should be under a lock?
+ if len(cls.__strong_cache) > cls.__strong_cache_size:
+ cls.__strong_cache.popitem(last=False)
+
+ return instance
+
diff --git a/src/libs/dateutil/tz/tz.py b/src/libs/dateutil/tz/tz.py
index 9468282..d05414e 100644
--- a/src/libs/dateutil/tz/tz.py
+++ b/src/libs/dateutil/tz/tz.py
@@ -1,10 +1,10 @@
# -*- coding: utf-8 -*-
"""
This module offers timezone implementations subclassing the abstract
-:py:`datetime.tzinfo` type. There are classes to handle tzfile format files
-(usually are in :file:`/etc/localtime`, :file:`/usr/share/zoneinfo`, etc), TZ
-environment string (in all known formats), given ranges (with help from
-relative deltas), local machine timezone, fixed offset timezone, and UTC
+:py:class:`datetime.tzinfo` type. There are classes to handle tzfile format
+files (usually are in :file:`/etc/localtime`, :file:`/usr/share/zoneinfo`,
+etc), TZ environment string (in all known formats), given ranges (with help
+from relative deltas), local machine timezone, fixed offset timezone, and UTC
timezone.
"""
import datetime
@@ -13,25 +13,63 @@
import sys
import os
import bisect
+import weakref
+from collections import OrderedDict
+import six
from six import string_types
-from ._common import tzname_in_python2, _tzinfo, _total_seconds
+from six.moves import _thread
+from ._common import tzname_in_python2, _tzinfo
from ._common import tzrangebase, enfold
from ._common import _validate_fromutc_inputs
+from ._factories import _TzSingleton, _TzOffsetFactory
+from ._factories import _TzStrFactory
try:
from .win import tzwin, tzwinlocal
except ImportError:
tzwin = tzwinlocal = None
+# For warning about rounding tzinfo
+from warnings import warn
+
ZERO = datetime.timedelta(0)
EPOCH = datetime.datetime.utcfromtimestamp(0)
EPOCHORDINAL = EPOCH.toordinal()
+@six.add_metaclass(_TzSingleton)
class tzutc(datetime.tzinfo):
"""
This is a tzinfo object that represents the UTC time zone.
+
+ **Examples:**
+
+ .. doctest::
+
+ >>> from datetime import *
+ >>> from dateutil.tz import *
+
+ >>> datetime.now()
+ datetime.datetime(2003, 9, 27, 9, 40, 1, 521290)
+
+ >>> datetime.now(tzutc())
+ datetime.datetime(2003, 9, 27, 12, 40, 12, 156379, tzinfo=tzutc())
+
+ >>> datetime.now(tzutc()).tzname()
+ 'UTC'
+
+ .. versionchanged:: 2.7.0
+ ``tzutc()`` is now a singleton, so the result of ``tzutc()`` will
+ always return the same object.
+
+ .. doctest::
+
+ >>> from dateutil.tz import tzutc, UTC
+ >>> tzutc() is tzutc()
+ True
+ >>> tzutc() is UTC
+ True
"""
def utcoffset(self, dt):
return ZERO
@@ -85,26 +123,27 @@ def __repr__(self):
__reduce__ = object.__reduce__
+@six.add_metaclass(_TzOffsetFactory)
class tzoffset(datetime.tzinfo):
"""
A simple class for representing a fixed offset from UTC.
:param name:
The timezone name, to be returned when ``tzname()`` is called.
-
:param offset:
The time zone offset in seconds, or (since version 2.6.0, represented
- as a :py:class:`datetime.timedelta` object.
+ as a :py:class:`datetime.timedelta` object).
"""
def __init__(self, name, offset):
self._name = name
try:
# Allow a timedelta
- offset = _total_seconds(offset)
+ offset = offset.total_seconds()
except (TypeError, AttributeError):
pass
- self._offset = datetime.timedelta(seconds=offset)
+
+ self._offset = datetime.timedelta(seconds=_get_supported_offset(offset))
def utcoffset(self, dt):
return self._offset
@@ -127,8 +166,6 @@ def is_ambiguous(self, dt):
:param dt:
A :py:class:`datetime.datetime`, naive or time zone aware.
-
-
:return:
Returns ``True`` if ambiguous, ``False`` otherwise.
@@ -150,7 +187,7 @@ def __ne__(self, other):
def __repr__(self):
return "%s(%s, %s)" % (self.__class__.__name__,
repr(self._name),
- int(_total_seconds(self._offset)))
+ int(self._offset.total_seconds()))
__reduce__ = object.__reduce__
@@ -170,6 +207,7 @@ def __init__(self):
self._dst_saved = self._dst_offset - self._std_offset
self._hasdst = bool(self._dst_saved)
+ self._tznames = tuple(time.tzname)
def utcoffset(self, dt):
if dt is None and self._hasdst:
@@ -191,7 +229,7 @@ def dst(self, dt):
@tzname_in_python2
def tzname(self, dt):
- return time.tzname[self._isdst(dt)]
+ return self._tznames[self._isdst(dt)]
def is_ambiguous(self, dt):
"""
@@ -256,12 +294,20 @@ def _isdst(self, dt, fold_naive=True):
return dstval
def __eq__(self, other):
- if not isinstance(other, tzlocal):
+ if isinstance(other, tzlocal):
+ return (self._std_offset == other._std_offset and
+ self._dst_offset == other._dst_offset)
+ elif isinstance(other, tzutc):
+ return (not self._hasdst and
+ self._tznames[0] in {'UTC', 'GMT'} and
+ self._std_offset == ZERO)
+ elif isinstance(other, tzoffset):
+ return (not self._hasdst and
+ self._tznames[0] == other._name and
+ self._std_offset == other._offset)
+ else:
return NotImplemented
- return (self._std_offset == other._std_offset and
- self._dst_offset == other._dst_offset)
-
__hash__ = None
def __ne__(self, other):
@@ -347,10 +393,60 @@ class tzfile(_tzinfo):
``fileobj``'s ``name`` attribute or to ``repr(fileobj)``.
See `Sources for Time Zone and Daylight Saving Time Data
- `_ for more information. Time zone
- files can be compiled from the `IANA Time Zone database files
+ `_ for more information.
+ Time zone files can be compiled from the `IANA Time Zone database files
`_ with the `zic time zone compiler
`_
+
+ .. note::
+
+ Only construct a ``tzfile`` directly if you have a specific timezone
+ file on disk that you want to read into a Python ``tzinfo`` object.
+ If you want to get a ``tzfile`` representing a specific IANA zone,
+ (e.g. ``'America/New_York'``), you should call
+ :func:`dateutil.tz.gettz` with the zone identifier.
+
+
+ **Examples:**
+
+ Using the US Eastern time zone as an example, we can see that a ``tzfile``
+ provides time zone information for the standard Daylight Saving offsets:
+
+ .. testsetup:: tzfile
+
+ from dateutil.tz import gettz
+ from datetime import datetime
+
+ .. doctest:: tzfile
+
+ >>> NYC = gettz('America/New_York')
+ >>> NYC
+ tzfile('/usr/share/zoneinfo/America/New_York')
+
+ >>> print(datetime(2016, 1, 3, tzinfo=NYC)) # EST
+ 2016-01-03 00:00:00-05:00
+
+ >>> print(datetime(2016, 7, 7, tzinfo=NYC)) # EDT
+ 2016-07-07 00:00:00-04:00
+
+
+ The ``tzfile`` structure contains a fully history of the time zone,
+ so historical dates will also have the right offsets. For example, before
+ the adoption of the UTC standards, New York used local solar mean time:
+
+ .. doctest:: tzfile
+
+ >>> print(datetime(1901, 4, 12, tzinfo=NYC)) # LMT
+ 1901-04-12 00:00:00-04:56
+
+ And during World War II, New York was on "Eastern War Time", which was a
+ state of permanent daylight saving time:
+
+ .. doctest:: tzfile
+
+ >>> print(datetime(1944, 2, 7, tzinfo=NYC)) # EWT
+ 1944-02-07 00:00:00-04:00
+
"""
def __init__(self, fileobj, filename=None):
@@ -370,7 +466,7 @@ def __init__(self, fileobj, filename=None):
if fileobj is not None:
if not file_opened_here:
- fileobj = _ContextWrapper(fileobj)
+ fileobj = _nullcontext(fileobj)
with fileobj as file_stream:
tzobj = self._read_tzfile(file_stream)
@@ -447,7 +543,7 @@ def _read_tzfile(self, fileobj):
if timecnt:
out.trans_idx = struct.unpack(">%dB" % timecnt,
- fileobj.read(timecnt))
+ fileobj.read(timecnt))
else:
out.trans_idx = []
@@ -510,10 +606,7 @@ def _read_tzfile(self, fileobj):
out.ttinfo_list = []
for i in range(typecnt):
gmtoff, isdst, abbrind = ttinfo[i]
- # Round to full-minutes if that's not the case. Python's
- # datetime doesn't accept sub-minute timezones. Check
- # http://python.org/sf/1447945 for some information.
- gmtoff = 60 * ((gmtoff + 30) // 60)
+ gmtoff = _get_supported_offset(gmtoff)
tti = _ttinfo()
tti.offset = gmtoff
tti.dstoffset = datetime.timedelta(0)
@@ -565,37 +658,44 @@ def _read_tzfile(self, fileobj):
# isgmt are off, so it should be in wall time. OTOH, it's
# always in gmt time. Let me know if you have comments
# about this.
- laststdoffset = None
+ lastdst = None
+ lastoffset = None
+ lastdstoffset = None
+ lastbaseoffset = None
out.trans_list = []
- for i, tti in enumerate(out.trans_idx):
- if not tti.isdst:
- offset = tti.offset
- laststdoffset = offset
- else:
- if laststdoffset is not None:
- # Store the DST offset as well and update it in the list
- tti.dstoffset = tti.offset - laststdoffset
- out.trans_idx[i] = tti
-
- offset = laststdoffset or 0
-
- out.trans_list.append(out.trans_list_utc[i] + offset)
-
- # In case we missed any DST offsets on the way in for some reason, make
- # a second pass over the list, looking for the /next/ DST offset.
- laststdoffset = None
- for i in reversed(range(len(out.trans_idx))):
- tti = out.trans_idx[i]
- if tti.isdst:
- if not (tti.dstoffset or laststdoffset is None):
- tti.dstoffset = tti.offset - laststdoffset
- else:
- laststdoffset = tti.offset
-
- if not isinstance(tti.dstoffset, datetime.timedelta):
- tti.dstoffset = datetime.timedelta(seconds=tti.dstoffset)
- out.trans_idx[i] = tti
+ for i, tti in enumerate(out.trans_idx):
+ offset = tti.offset
+ dstoffset = 0
+
+ if lastdst is not None:
+ if tti.isdst:
+ if not lastdst:
+ dstoffset = offset - lastoffset
+
+ if not dstoffset and lastdstoffset:
+ dstoffset = lastdstoffset
+
+ tti.dstoffset = datetime.timedelta(seconds=dstoffset)
+ lastdstoffset = dstoffset
+
+ # If a time zone changes its base offset during a DST transition,
+ # then you need to adjust by the previous base offset to get the
+ # transition time in local time. Otherwise you use the current
+ # base offset. Ideally, I would have some mathematical proof of
+ # why this is true, but I haven't really thought about it enough.
+ baseoffset = offset - dstoffset
+ adjustment = baseoffset
+ if (lastbaseoffset is not None and baseoffset != lastbaseoffset
+ and tti.isdst != lastdst):
+ # The base DST has changed
+ adjustment = lastbaseoffset
+
+ lastdst = tti.isdst
+ lastoffset = offset
+ lastbaseoffset = baseoffset
+
+ out.trans_list.append(out.trans_list_utc[i] + adjustment)
out.trans_idx = tuple(out.trans_idx)
out.trans_list = tuple(out.trans_list)
@@ -616,7 +716,7 @@ def _find_last_transition(self, dt, in_utc=False):
idx = bisect.bisect_right(trans_list, timestamp)
# We want to know when the previous transition was, so subtract off 1
- return idx - 1
+ return idx - 1
def _get_ttinfo(self, idx):
# For no list or after the last transition, default to _ttinfo_std
@@ -800,8 +900,9 @@ class tzrange(tzrangebase):
:param start:
A :class:`relativedelta.relativedelta` object or equivalent specifying
- the time and time of year that daylight savings time starts. To specify,
- for example, that DST starts at 2AM on the 2nd Sunday in March, pass:
+ the time and time of year that daylight savings time starts. To
+ specify, for example, that DST starts at 2AM on the 2nd Sunday in
+ March, pass:
``relativedelta(hours=2, month=3, day=1, weekday=SU(+2))``
@@ -809,12 +910,12 @@ class tzrange(tzrangebase):
value is 2 AM on the first Sunday in April.
:param end:
- A :class:`relativedelta.relativedelta` object or equivalent representing
- the time and time of year that daylight savings time ends, with the
- same specification method as in ``start``. One note is that this should
- point to the first time in the *standard* zone, so if a transition
- occurs at 2AM in the DST zone and the clocks are set back 1 hour to 1AM,
- set the `hours` parameter to +1.
+ A :class:`relativedelta.relativedelta` object or equivalent
+ representing the time and time of year that daylight savings time
+ ends, with the same specification method as in ``start``. One note is
+ that this should point to the first time in the *standard* zone, so if
+ a transition occurs at 2AM in the DST zone and the clocks are set back
+ 1 hour to 1AM, set the ``hours`` parameter to +1.
**Examples:**
@@ -850,12 +951,12 @@ def __init__(self, stdabbr, stdoffset=None,
self._dst_abbr = dstabbr
try:
- stdoffset = _total_seconds(stdoffset)
+ stdoffset = stdoffset.total_seconds()
except (TypeError, AttributeError):
pass
try:
- dstoffset = _total_seconds(dstoffset)
+ dstoffset = dstoffset.total_seconds()
except (TypeError, AttributeError):
pass
@@ -926,6 +1027,7 @@ def _dst_base_offset(self):
return self._dst_base_offset_
+@six.add_metaclass(_TzStrFactory)
class tzstr(tzrange):
"""
``tzstr`` objects are time zone objects specified by a time-zone string as
@@ -944,25 +1046,38 @@ class tzstr(tzrange):
:param s:
A time zone string in ``TZ`` variable format. This can be a
- :class:`bytes` (2.x: :class:`str`), :class:`str` (2.x: :class:`unicode`)
- or a stream emitting unicode characters (e.g. :class:`StringIO`).
+ :class:`bytes` (2.x: :class:`str`), :class:`str` (2.x:
+ :class:`unicode`) or a stream emitting unicode characters
+ (e.g. :class:`StringIO`).
:param posix_offset:
Optional. If set to ``True``, interpret strings such as ``GMT+3`` or
``UTC+3`` as being 3 hours *behind* UTC rather than ahead, per the
POSIX standard.
+ .. caution::
+
+ Prior to version 2.7.0, this function also supported time zones
+ in the format:
+
+ * ``EST5EDT,4,0,6,7200,10,0,26,7200,3600``
+ * ``EST5EDT,4,1,0,7200,10,-1,0,7200,3600``
+
+ This format is non-standard and has been deprecated; this function
+ will raise a :class:`DeprecatedTZFormatWarning` until
+ support is removed in a future version.
+
.. _`GNU C Library: TZ Variable`:
https://www.gnu.org/software/libc/manual/html_node/TZ-Variable.html
"""
def __init__(self, s, posix_offset=False):
global parser
- from dateutil import parser
+ from dateutil.parser import _parser as parser
self._s = s
res = parser._parsetz(s)
- if res is None:
+ if res is None or res.any_unused_tokens:
raise ValueError("unknown string format")
# Here we break the compatibility with the TZ variable handling.
@@ -1051,6 +1166,7 @@ def __init__(self, tzid, comps=[]):
self._comps = comps
self._cachedate = []
self._cachecomp = []
+ self._cache_lock = _thread.allocate_lock()
def _find_comp(self, dt):
if len(self._comps) == 1:
@@ -1059,7 +1175,9 @@ def _find_comp(self, dt):
dt = dt.replace(tzinfo=None)
try:
- return self._cachecomp[self._cachedate.index((dt, self._fold(dt)))]
+ with self._cache_lock:
+ return self._cachecomp[self._cachedate.index(
+ (dt, self._fold(dt)))]
except ValueError:
pass
@@ -1085,12 +1203,13 @@ def _find_comp(self, dt):
else:
lastcomp = comp[0]
- self._cachedate.insert(0, (dt, self._fold(dt)))
- self._cachecomp.insert(0, lastcomp)
+ with self._cache_lock:
+ self._cachedate.insert(0, (dt, self._fold(dt)))
+ self._cachecomp.insert(0, lastcomp)
- if len(self._cachedate) > 10:
- self._cachedate.pop()
- self._cachecomp.pop()
+ if len(self._cachedate) > 10:
+ self._cachedate.pop()
+ self._cachecomp.pop()
return lastcomp
@@ -1128,13 +1247,13 @@ def __repr__(self):
class tzical(object):
"""
This object is designed to parse an iCalendar-style ``VTIMEZONE`` structure
- as set out in `RFC 2445`_ Section 4.6.5 into one or more `tzinfo` objects.
+ as set out in `RFC 5545`_ Section 4.6.5 into one or more `tzinfo` objects.
:param `fileobj`:
A file or stream in iCalendar format, which should be UTF-8 encoded
with CRLF endings.
- .. _`RFC 2445`: https://www.ietf.org/rfc/rfc2445.txt
+ .. _`RFC 5545`: https://tools.ietf.org/html/rfc5545
"""
def __init__(self, fileobj):
global rrule
@@ -1146,7 +1265,7 @@ def __init__(self, fileobj):
fileobj = open(fileobj, 'r')
else:
self._s = getattr(fileobj, 'name', repr(fileobj))
- fileobj = _ContextWrapper(fileobj)
+ fileobj = _nullcontext(fileobj)
self._vtz = {}
@@ -1282,6 +1401,13 @@ def _parse_rfc(self, s):
raise ValueError("invalid component end: "+value)
elif comptype:
if name == "DTSTART":
+ # DTSTART in VTIMEZONE takes a subset of valid RRULE
+ # values under RFC 5545.
+ for parm in parms:
+ if parm != 'VALUE=DATE-TIME':
+ msg = ('Unsupported DTSTART param in ' +
+ 'VTIMEZONE: ' + parm)
+ raise ValueError(msg)
rrulelines.append(line)
founddtstart = True
elif name in ("RRULE", "RDATE", "EXRULE", "EXDATE"):
@@ -1335,78 +1461,210 @@ def __repr__(self):
TZPATHS = []
-def gettz(name=None):
- tz = None
- if not name:
- try:
- name = os.environ["TZ"]
- except KeyError:
- pass
- if name is None or name == ":":
- for filepath in TZFILES:
- if not os.path.isabs(filepath):
- filename = filepath
- for path in TZPATHS:
- filepath = os.path.join(path, filename)
- if os.path.isfile(filepath):
- break
- else:
- continue
- if os.path.isfile(filepath):
- try:
- tz = tzfile(filepath)
- break
- except (IOError, OSError, ValueError):
- pass
- else:
- tz = tzlocal()
- else:
- if name.startswith(":"):
- name = name[:-1]
- if os.path.isabs(name):
- if os.path.isfile(name):
- tz = tzfile(name)
- else:
- tz = None
- else:
- for path in TZPATHS:
- filepath = os.path.join(path, name)
- if not os.path.isfile(filepath):
- filepath = filepath.replace(' ', '_')
- if not os.path.isfile(filepath):
- continue
+def __get_gettz():
+ tzlocal_classes = (tzlocal,)
+ if tzwinlocal is not None:
+ tzlocal_classes += (tzwinlocal,)
+
+ class GettzFunc(object):
+ """
+ Retrieve a time zone object from a string representation
+
+ This function is intended to retrieve the :py:class:`tzinfo` subclass
+ that best represents the time zone that would be used if a POSIX
+ `TZ variable`_ were set to the same value.
+
+ If no argument or an empty string is passed to ``gettz``, local time
+ is returned:
+
+ .. code-block:: python3
+
+ >>> gettz()
+ tzfile('/etc/localtime')
+
+ This function is also the preferred way to map IANA tz database keys
+ to :class:`tzfile` objects:
+
+ .. code-block:: python3
+
+ >>> gettz('Pacific/Kiritimati')
+ tzfile('/usr/share/zoneinfo/Pacific/Kiritimati')
+
+ On Windows, the standard is extended to include the Windows-specific
+ zone names provided by the operating system:
+
+ .. code-block:: python3
+
+ >>> gettz('Egypt Standard Time')
+ tzwin('Egypt Standard Time')
+
+ Passing a GNU ``TZ`` style string time zone specification returns a
+ :class:`tzstr` object:
+
+ .. code-block:: python3
+
+ >>> gettz('AEST-10AEDT-11,M10.1.0/2,M4.1.0/3')
+ tzstr('AEST-10AEDT-11,M10.1.0/2,M4.1.0/3')
+
+ :param name:
+ A time zone name (IANA, or, on Windows, Windows keys), location of
+ a ``tzfile(5)`` zoneinfo file or ``TZ`` variable style time zone
+ specifier. An empty string, no argument or ``None`` is interpreted
+ as local time.
+
+ :return:
+ Returns an instance of one of ``dateutil``'s :py:class:`tzinfo`
+ subclasses.
+
+ .. versionchanged:: 2.7.0
+
+ After version 2.7.0, any two calls to ``gettz`` using the same
+ input strings will return the same object:
+
+ .. code-block:: python3
+
+ >>> tz.gettz('America/Chicago') is tz.gettz('America/Chicago')
+ True
+
+ In addition to improving performance, this ensures that
+ `"same zone" semantics`_ are used for datetimes in the same zone.
+
+
+ .. _`TZ variable`:
+ https://www.gnu.org/software/libc/manual/html_node/TZ-Variable.html
+
+ .. _`"same zone" semantics`:
+ https://blog.ganssle.io/articles/2018/02/aware-datetime-arithmetic.html
+ """
+ def __init__(self):
+
+ self.__instances = weakref.WeakValueDictionary()
+ self.__strong_cache_size = 8
+ self.__strong_cache = OrderedDict()
+ self._cache_lock = _thread.allocate_lock()
+
+ def __call__(self, name=None):
+ with self._cache_lock:
+ rv = self.__instances.get(name, None)
+
+ if rv is None:
+ rv = self.nocache(name=name)
+ if not (name is None
+ or isinstance(rv, tzlocal_classes)
+ or rv is None):
+ # tzlocal is slightly more complicated than the other
+ # time zone providers because it depends on environment
+ # at construction time, so don't cache that.
+ #
+ # We also cannot store weak references to None, so we
+ # will also not store that.
+ self.__instances[name] = rv
+ else:
+ # No need for strong caching, return immediately
+ return rv
+
+ self.__strong_cache[name] = self.__strong_cache.pop(name, rv)
+
+ if len(self.__strong_cache) > self.__strong_cache_size:
+ self.__strong_cache.popitem(last=False)
+
+ return rv
+
+ def set_cache_size(self, size):
+ with self._cache_lock:
+ self.__strong_cache_size = size
+ while len(self.__strong_cache) > size:
+ self.__strong_cache.popitem(last=False)
+
+ def cache_clear(self):
+ with self._cache_lock:
+ self.__instances = weakref.WeakValueDictionary()
+ self.__strong_cache.clear()
+
+ @staticmethod
+ def nocache(name=None):
+ """A non-cached version of gettz"""
+ tz = None
+ if not name:
try:
- tz = tzfile(filepath)
- break
- except (IOError, OSError, ValueError):
+ name = os.environ["TZ"]
+ except KeyError:
pass
+ if name is None or name == ":":
+ for filepath in TZFILES:
+ if not os.path.isabs(filepath):
+ filename = filepath
+ for path in TZPATHS:
+ filepath = os.path.join(path, filename)
+ if os.path.isfile(filepath):
+ break
+ else:
+ continue
+ if os.path.isfile(filepath):
+ try:
+ tz = tzfile(filepath)
+ break
+ except (IOError, OSError, ValueError):
+ pass
+ else:
+ tz = tzlocal()
else:
- tz = None
- if tzwin is not None:
- try:
- tz = tzwin(name)
- except WindowsError:
+ if name.startswith(":"):
+ name = name[1:]
+ if os.path.isabs(name):
+ if os.path.isfile(name):
+ tz = tzfile(name)
+ else:
tz = None
-
- if not tz:
- from dateutil.zoneinfo import get_zonefile_instance
- tz = get_zonefile_instance().get(name)
-
- if not tz:
- for c in name:
- # name must have at least one offset to be a tzstr
- if c in "0123456789":
- try:
- tz = tzstr(name)
- except ValueError:
- pass
+ else:
+ for path in TZPATHS:
+ filepath = os.path.join(path, name)
+ if not os.path.isfile(filepath):
+ filepath = filepath.replace(' ', '_')
+ if not os.path.isfile(filepath):
+ continue
+ try:
+ tz = tzfile(filepath)
break
+ except (IOError, OSError, ValueError):
+ pass
else:
- if name in ("GMT", "UTC"):
- tz = tzutc()
- elif name in time.tzname:
- tz = tzlocal()
- return tz
+ tz = None
+ if tzwin is not None:
+ try:
+ tz = tzwin(name)
+ except (WindowsError, UnicodeEncodeError):
+ # UnicodeEncodeError is for Python 2.7 compat
+ tz = None
+
+ if not tz:
+ from dateutil.zoneinfo import get_zonefile_instance
+ tz = get_zonefile_instance().get(name)
+
+ if not tz:
+ for c in name:
+ # name is not a tzstr unless it has at least
+ # one offset. For short values of "name", an
+ # explicit for loop seems to be the fastest way
+ # To determine if a string contains a digit
+ if c in "0123456789":
+ try:
+ tz = tzstr(name)
+ except ValueError:
+ pass
+ break
+ else:
+ if name in ("GMT", "UTC"):
+ tz = tzutc()
+ elif name in time.tzname:
+ tz = tzlocal()
+ return tz
+
+ return GettzFunc()
+
+
+gettz = __get_gettz()
+del __get_gettz
def datetime_exists(dt, tz=None):
@@ -1423,7 +1681,10 @@ def datetime_exists(dt, tz=None):
``None`` or not provided, the datetime's own time zone will be used.
:return:
- Returns a boolean value whether or not the "wall time" exists in ``tz``.
+ Returns a boolean value whether or not the "wall time" exists in
+ ``tz``.
+
+ .. versionadded:: 2.7.0
"""
if tz is None:
if dt.tzinfo is None:
@@ -1471,7 +1732,7 @@ def datetime_ambiguous(dt, tz=None):
if is_ambiguous_fn is not None:
try:
return tz.is_ambiguous(dt)
- except:
+ except Exception:
pass
# If it doesn't come out and tell us it's ambiguous, we'll just check if
@@ -1486,26 +1747,90 @@ def datetime_ambiguous(dt, tz=None):
return not (same_offset and same_dst)
-def _datetime_to_timestamp(dt):
+def resolve_imaginary(dt):
"""
- Convert a :class:`datetime.datetime` object to an epoch timestamp in seconds
- since January 1, 1970, ignoring the time zone.
+ Given a datetime that may be imaginary, return an existing datetime.
+
+ This function assumes that an imaginary datetime represents what the
+ wall time would be in a zone had the offset transition not occurred, so
+ it will always fall forward by the transition's change in offset.
+
+ .. doctest::
+
+ >>> from dateutil import tz
+ >>> from datetime import datetime
+ >>> NYC = tz.gettz('America/New_York')
+ >>> print(tz.resolve_imaginary(datetime(2017, 3, 12, 2, 30, tzinfo=NYC)))
+ 2017-03-12 03:30:00-04:00
+
+ >>> KIR = tz.gettz('Pacific/Kiritimati')
+ >>> print(tz.resolve_imaginary(datetime(1995, 1, 1, 12, 30, tzinfo=KIR)))
+ 1995-01-02 12:30:00+14:00
+
+ As a note, :func:`datetime.astimezone` is guaranteed to produce a valid,
+ existing datetime, so a round-trip to and from UTC is sufficient to get
+ an extant datetime, however, this generally "falls back" to an earlier time
+ rather than falling forward to the STD side (though no guarantees are made
+ about this behavior).
+
+ :param dt:
+ A :class:`datetime.datetime` which may or may not exist.
+
+ :return:
+ Returns an existing :class:`datetime.datetime`. If ``dt`` was not
+ imaginary, the datetime returned is guaranteed to be the same object
+ passed to the function.
+
+ .. versionadded:: 2.7.0
"""
- return _total_seconds((dt.replace(tzinfo=None) - EPOCH))
+ if dt.tzinfo is not None and not datetime_exists(dt):
+
+ curr_offset = (dt + datetime.timedelta(hours=24)).utcoffset()
+ old_offset = (dt - datetime.timedelta(hours=24)).utcoffset()
+
+ dt += curr_offset - old_offset
+ return dt
-class _ContextWrapper(object):
+
+def _datetime_to_timestamp(dt):
"""
- Class for wrapping contexts so that they are passed through in a
- with statement.
+ Convert a :class:`datetime.datetime` object to an epoch timestamp in
+ seconds since January 1, 1970, ignoring the time zone.
"""
- def __init__(self, context):
- self.context = context
+ return (dt.replace(tzinfo=None) - EPOCH).total_seconds()
+
+
+if sys.version_info >= (3, 6):
+ def _get_supported_offset(second_offset):
+ return second_offset
+else:
+ def _get_supported_offset(second_offset):
+ # For python pre-3.6, round to full-minutes if that's not the case.
+ # Python's datetime doesn't accept sub-minute timezones. Check
+ # http://python.org/sf/1447945 or https://bugs.python.org/issue5288
+ # for some information.
+ old_offset = second_offset
+ calculated_offset = 60 * ((second_offset + 30) // 60)
+ return calculated_offset
+
+
+try:
+ # Python 3.7 feature
+ from contextmanager import nullcontext as _nullcontext
+except ImportError:
+ class _nullcontext(object):
+ """
+ Class for wrapping contexts so that they are passed through in a
+ with statement.
+ """
+ def __init__(self, context):
+ self.context = context
- def __enter__(self):
- return self.context
+ def __enter__(self):
+ return self.context
- def __exit__(*args, **kwargs):
- pass
+ def __exit__(*args, **kwargs):
+ pass
# vim:ts=4:sw=4:et
diff --git a/src/libs/dateutil/tz/win.py b/src/libs/dateutil/tz/win.py
index 36a1c26..cde07ba 100644
--- a/src/libs/dateutil/tz/win.py
+++ b/src/libs/dateutil/tz/win.py
@@ -1,3 +1,11 @@
+# -*- coding: utf-8 -*-
+"""
+This module provides an interface to the native time zone data on Windows,
+including :py:class:`datetime.tzinfo` implementations.
+
+Attempting to import this module on a non-Windows platform will raise an
+:py:obj:`ImportError`.
+"""
# This code was originally contributed by Jeffrey Harris.
import datetime
import struct
@@ -39,7 +47,7 @@ def _settzkeyname():
class tzres(object):
"""
- Class for accessing `tzres.dll`, which contains timezone name related
+ Class for accessing ``tzres.dll``, which contains timezone name related
resources.
.. versionadded:: 2.5.0
@@ -72,9 +80,10 @@ def load_name(self, offset):
:param offset:
A positive integer value referring to a string from the tzres dll.
- ..note:
+ .. note::
+
Offsets found in the registry are generally of the form
- `@tzres.dll,-114`. The offset in this case if 114, not -114.
+ ``@tzres.dll,-114``. The offset in this case is 114, not -114.
"""
resource = self.p_wchar()
@@ -146,6 +155,9 @@ def list():
return result
def display(self):
+ """
+ Return the display name of the time zone.
+ """
return self._display
def transitions(self, year):
@@ -188,11 +200,21 @@ def _dst_base_offset(self):
class tzwin(tzwinbase):
+ """
+ Time zone object created from the zone info in the Windows registry
+
+ These are similar to :py:class:`dateutil.tz.tzrange` objects in that
+ the time zone data is provided in the format of a single offset rule
+ for either 0 or 2 time zone transitions per year.
+
+ :param: name
+ The name of a Windows time zone key, e.g. "Eastern Standard Time".
+ The full list of keys can be retrieved with :func:`tzwin.list`.
+ """
def __init__(self, name):
self._name = name
- # multiple contexts only possible in 2.7 and 3.1, we still support 2.6
with winreg.ConnectRegistry(None, winreg.HKEY_LOCAL_MACHINE) as handle:
tzkeyname = text_type("{kn}\\{name}").format(kn=TZKEYNAME, name=name)
with winreg.OpenKey(handle, tzkeyname) as tzkey:
@@ -235,6 +257,22 @@ def __reduce__(self):
class tzwinlocal(tzwinbase):
+ """
+ Class representing the local time zone information in the Windows registry
+
+ While :class:`dateutil.tz.tzlocal` makes system calls (via the :mod:`time`
+ module) to retrieve time zone information, ``tzwinlocal`` retrieves the
+ rules directly from the Windows registry and creates an object like
+ :class:`dateutil.tz.tzwin`.
+
+ Because Windows does not have an equivalent of :func:`time.tzset`, on
+ Windows, :class:`dateutil.tz.tzlocal` instances will always reflect the
+ time zone settings *at the time that the process was started*, meaning
+ changes to the machine's time zone settings during the run of a program
+ on Windows will **not** be reflected by :class:`dateutil.tz.tzlocal`.
+ Because ``tzwinlocal`` reads the registry directly, it is unaffected by
+ this issue.
+ """
def __init__(self):
with winreg.ConnectRegistry(None, winreg.HKEY_LOCAL_MACHINE) as handle:
with winreg.OpenKey(handle, TZLOCALKEYNAME) as tzlocalkey:
diff --git a/src/libs/dateutil/utils.py b/src/libs/dateutil/utils.py
new file mode 100644
index 0000000..ebcce6a
--- /dev/null
+++ b/src/libs/dateutil/utils.py
@@ -0,0 +1,71 @@
+# -*- coding: utf-8 -*-
+"""
+This module offers general convenience and utility functions for dealing with
+datetimes.
+
+.. versionadded:: 2.7.0
+"""
+from __future__ import unicode_literals
+
+from datetime import datetime, time
+
+
+def today(tzinfo=None):
+ """
+ Returns a :py:class:`datetime` representing the current day at midnight
+
+ :param tzinfo:
+ The time zone to attach (also used to determine the current day).
+
+ :return:
+ A :py:class:`datetime.datetime` object representing the current day
+ at midnight.
+ """
+
+ dt = datetime.now(tzinfo)
+ return datetime.combine(dt.date(), time(0, tzinfo=tzinfo))
+
+
+def default_tzinfo(dt, tzinfo):
+ """
+ Sets the the ``tzinfo`` parameter on naive datetimes only
+
+ This is useful for example when you are provided a datetime that may have
+ either an implicit or explicit time zone, such as when parsing a time zone
+ string.
+
+ .. doctest::
+
+ >>> from dateutil.tz import tzoffset
+ >>> from dateutil.parser import parse
+ >>> from dateutil.utils import default_tzinfo
+ >>> dflt_tz = tzoffset("EST", -18000)
+ >>> print(default_tzinfo(parse('2014-01-01 12:30 UTC'), dflt_tz))
+ 2014-01-01 12:30:00+00:00
+ >>> print(default_tzinfo(parse('2014-01-01 12:30'), dflt_tz))
+ 2014-01-01 12:30:00-05:00
+
+ :param dt:
+ The datetime on which to replace the time zone
+
+ :param tzinfo:
+ The :py:class:`datetime.tzinfo` subclass instance to assign to
+ ``dt`` if (and only if) it is naive.
+
+ :return:
+ Returns an aware :py:class:`datetime.datetime`.
+ """
+ if dt.tzinfo is not None:
+ return dt
+ else:
+ return dt.replace(tzinfo=tzinfo)
+
+
+def within_delta(dt1, dt2, delta):
+ """
+ Useful for comparing two datetimes that may a negilible difference
+ to be considered equal.
+ """
+ delta = abs(delta)
+ difference = dt1 - dt2
+ return -delta <= difference <= delta
diff --git a/src/libs/dateutil/zoneinfo/__init__.py b/src/libs/dateutil/zoneinfo/__init__.py
index a2ed4f9..34f11ad 100644
--- a/src/libs/dateutil/zoneinfo/__init__.py
+++ b/src/libs/dateutil/zoneinfo/__init__.py
@@ -5,24 +5,16 @@
from tarfile import TarFile
from pkgutil import get_data
from io import BytesIO
-from contextlib import closing
-from dateutil.tz import tzfile
+from dateutil.tz import tzfile as _tzfile
-__all__ = ["get_zonefile_instance", "gettz", "gettz_db_metadata", "rebuild"]
+__all__ = ["get_zonefile_instance", "gettz", "gettz_db_metadata"]
ZONEFILENAME = "dateutil-zoneinfo.tar.gz"
METADATA_FN = 'METADATA'
-# python2.6 compatability. Note that TarFile.__exit__ != TarFile.close, but
-# it's close enough for python2.6
-tar_open = TarFile.open
-if not hasattr(TarFile, '__exit__'):
- def tar_open(*args, **kwargs):
- return closing(TarFile.open(*args, **kwargs))
-
-class tzfile(tzfile):
+class tzfile(_tzfile):
def __reduce__(self):
return (gettz, (self._filename,))
@@ -38,23 +30,15 @@ def getzoneinfofile_stream():
class ZoneInfoFile(object):
def __init__(self, zonefile_stream=None):
if zonefile_stream is not None:
- with tar_open(fileobj=zonefile_stream, mode='r') as tf:
- # dict comprehension does not work on python2.6
- # TODO: get back to the nicer syntax when we ditch python2.6
- # self.zones = {zf.name: tzfile(tf.extractfile(zf),
- # filename = zf.name)
- # for zf in tf.getmembers() if zf.isfile()}
- self.zones = dict((zf.name, tzfile(tf.extractfile(zf),
- filename=zf.name))
- for zf in tf.getmembers()
- if zf.isfile() and zf.name != METADATA_FN)
+ with TarFile.open(fileobj=zonefile_stream) as tf:
+ self.zones = {zf.name: tzfile(tf.extractfile(zf), filename=zf.name)
+ for zf in tf.getmembers()
+ if zf.isfile() and zf.name != METADATA_FN}
# deal with links: They'll point to their parent object. Less
# waste of memory
- # links = {zl.name: self.zones[zl.linkname]
- # for zl in tf.getmembers() if zl.islnk() or zl.issym()}
- links = dict((zl.name, self.zones[zl.linkname])
- for zl in tf.getmembers() if
- zl.islnk() or zl.issym())
+ links = {zl.name: self.zones[zl.linkname]
+ for zl in tf.getmembers() if
+ zl.islnk() or zl.issym()}
self.zones.update(links)
try:
metadata_json = tf.extractfile(tf.getmember(METADATA_FN))
@@ -64,7 +48,7 @@ def __init__(self, zonefile_stream=None):
# no metadata in tar file
self.metadata = None
else:
- self.zones = dict()
+ self.zones = {}
self.metadata = None
def get(self, name, default=None):
@@ -90,7 +74,7 @@ def get(self, name, default=None):
# timezone. Ugly, but adheres to the api.
#
# TODO: Remove after deprecation period.
-_CLASS_ZONE_INSTANCE = list()
+_CLASS_ZONE_INSTANCE = []
def get_zonefile_instance(new_instance=False):
diff --git a/src/libs/dateutil/zoneinfo/dateutil-zoneinfo.tar.gz b/src/libs/dateutil/zoneinfo/dateutil-zoneinfo.tar.gz
index 613c0ff..124f3e1 100644
Binary files a/src/libs/dateutil/zoneinfo/dateutil-zoneinfo.tar.gz and b/src/libs/dateutil/zoneinfo/dateutil-zoneinfo.tar.gz differ
diff --git a/src/libs/dateutil/zoneinfo/rebuild.py b/src/libs/dateutil/zoneinfo/rebuild.py
index 9d53bb8..78f0d1a 100644
--- a/src/libs/dateutil/zoneinfo/rebuild.py
+++ b/src/libs/dateutil/zoneinfo/rebuild.py
@@ -4,21 +4,22 @@
import shutil
import json
from subprocess import check_call
+from tarfile import TarFile
-from dateutil.zoneinfo import tar_open, METADATA_FN, ZONEFILENAME
+from dateutil.zoneinfo import METADATA_FN, ZONEFILENAME
def rebuild(filename, tag=None, format="gz", zonegroups=[], metadata=None):
"""Rebuild the internal timezone info in dateutil/zoneinfo/zoneinfo*tar*
- filename is the timezone tarball from ftp.iana.org/tz.
+ filename is the timezone tarball from ``ftp.iana.org/tz``.
"""
tmpdir = tempfile.mkdtemp()
zonedir = os.path.join(tmpdir, "zoneinfo")
moduledir = os.path.dirname(__file__)
try:
- with tar_open(filename) as tf:
+ with TarFile.open(filename) as tf:
for name in zonegroups:
tf.extract(name, tmpdir)
filepaths = [os.path.join(tmpdir, n) for n in zonegroups]
@@ -31,7 +32,7 @@ def rebuild(filename, tag=None, format="gz", zonegroups=[], metadata=None):
with open(os.path.join(zonedir, METADATA_FN), 'w') as f:
json.dump(metadata, f, indent=4, sort_keys=True)
target = os.path.join(moduledir, ZONEFILENAME)
- with tar_open(target, "w:%s" % format) as tf:
+ with TarFile.open(target, "w:%s" % format) as tf:
for entry in os.listdir(zonedir):
entrypath = os.path.join(zonedir, entry)
tf.add(entrypath, entry)
diff --git a/src/libs/faker/__init__.py b/src/libs/faker/__init__.py
index 13896f0..4e1b0b2 100644
--- a/src/libs/faker/__init__.py
+++ b/src/libs/faker/__init__.py
@@ -1,6 +1,6 @@
-VERSION = '0.8.7'
+from faker.generator import Generator # noqa F401
+from faker.factory import Factory # noqa F401
-from faker.generator import Generator
-from faker.factory import Factory
+VERSION = '1.0.2'
Faker = Factory.create
diff --git a/src/libs/faker/build_docs.py b/src/libs/faker/build_docs.py
index 66d28d1..5f439e6 100644
--- a/src/libs/faker/build_docs.py
+++ b/src/libs/faker/build_docs.py
@@ -7,13 +7,7 @@
import pprint
import sys
-
-if sys.version < '3':
- text_type = unicode
- binary_type = str
-else:
- text_type = str
- binary_type = bytes
+import six
DOCS_ROOT = os.path.abspath(os.path.join('..', 'docs'))
@@ -41,7 +35,7 @@ def write_provider(fh, doc, provider, formatters, excludes=None):
# `pprint` can't format sets of heterogenous types.
if not isinstance(example, set):
example = pprint.pformat(example, indent=4)
- lines = text_type(example).expandtabs().splitlines()
+ lines = six.text_type(example).expandtabs().splitlines()
except UnicodeEncodeError:
msg = 'error on "{0}" with value "{1}"'.format(signature, example)
raise Exception(msg)
@@ -79,8 +73,7 @@ def write_docs(*args, **kwargs):
[write(fh, ' providers/%s\n' % doc.get_provider_name(provider))
for provider, fakers in formatters]
- AVAILABLE_LOCALES = list(AVAILABLE_LOCALES)
- AVAILABLE_LOCALES.sort()
+ AVAILABLE_LOCALES = sorted(AVAILABLE_LOCALES)
for lang in AVAILABLE_LOCALES:
fname = os.path.join(DOCS_ROOT, 'locales', '%s.rst' % lang)
with open(fname, 'wb') as fh:
diff --git a/src/libs/faker/cli.py b/src/libs/faker/cli.py
index acf771f..efc0913 100644
--- a/src/libs/faker/cli.py
+++ b/src/libs/faker/cli.py
@@ -7,17 +7,14 @@
import sys
import argparse
+import random
+import six
+
from faker import Faker, documentor
from faker import VERSION
from faker.config import AVAILABLE_LOCALES, DEFAULT_LOCALE, META_PROVIDERS_MODULES
-
-if sys.version < '3':
- text_type = unicode
- binary_type = str
-else:
- text_type = str
- binary_type = bytes
+import logging
__author__ = 'joke2k'
@@ -37,7 +34,7 @@ def print_provider(doc, provider, formatters, excludes=None, output=None):
if signature in excludes:
continue
try:
- lines = text_type(example).expandtabs().splitlines()
+ lines = six.text_type(example).expandtabs().splitlines()
except UnicodeDecodeError:
# The example is actually made of bytes.
# We could coerce to bytes, but that would fail anyway when we wiil
@@ -55,16 +52,18 @@ def print_provider(doc, provider, formatters, excludes=None, output=None):
fake=signature,
separator=separator,
example=line[i * remains:(i + 1) * remains],
- margin=margin
+ margin=margin,
), file=output)
signature = separator = ' '
def print_doc(provider_or_field=None,
- args=None, lang=DEFAULT_LOCALE, output=None, includes=None):
+ args=None, lang=DEFAULT_LOCALE, output=None, seed=None,
+ includes=None):
args = args or []
output = output or sys.stdout
fake = Faker(locale=lang, includes=includes)
+ fake.seed_instance(seed)
from faker.providers import BaseProvider
base_provider_formatters = [f for f in dir(BaseProvider)]
@@ -73,7 +72,9 @@ def print_doc(provider_or_field=None,
if '.' in provider_or_field:
parts = provider_or_field.split('.')
locale = parts[-2] if parts[-2] in AVAILABLE_LOCALES else lang
- fake = Faker(locale, providers=[provider_or_field], includes=includes)
+ fake = Faker(locale, providers=[
+ provider_or_field], includes=includes)
+ fake.seed_instance(seed)
doc = documentor.Documentor(fake)
doc.already_generated = base_provider_formatters
print_provider(
@@ -83,7 +84,12 @@ def print_doc(provider_or_field=None,
output=output)
else:
try:
- print(fake.format(provider_or_field, *args), end='', file=output)
+ print(
+ fake.format(
+ provider_or_field,
+ *args),
+ end='',
+ file=output)
except AttributeError:
raise ValueError('No faker found for "{0}({1})"'.format(
provider_or_field, args))
@@ -103,6 +109,7 @@ def print_doc(provider_or_field=None,
print(file=output)
print('## LANGUAGE {0}'.format(language), file=output)
fake = Faker(locale=language)
+ fake.seed_instance(seed)
d = documentor.Documentor(fake)
for p, fs in d.get_formatters(with_args=True, with_defaults=True,
@@ -132,9 +139,14 @@ def execute(self):
{0}
- faker can take a locale as an argument, to return localized data. If no
- localized provider is found, the factory falls back to the default en_US
- locale.
+ Faker can take a locale as an optional argument, to return localized data. If
+ no locale argument is specified, the factory falls back to the user's OS
+ locale as long as it is supported by at least one of the providers.
+ - for this user, the default locale is {1}.
+
+ If the optional argument locale and/or user's default locale is not available
+ for the specified provider, the factory falls back to faker's default locale,
+ which is {2}.
examples:
@@ -154,7 +166,9 @@ def execute(self):
Josiah Maggio;
Gayla Schmitt;
-""".format(', '.join(sorted(AVAILABLE_LOCALES)))
+""".format(', '.join(sorted(AVAILABLE_LOCALES)),
+ default_locale,
+ DEFAULT_LOCALE)
formatter_class = argparse.RawDescriptionHelpFormatter
parser = argparse.ArgumentParser(
@@ -166,6 +180,14 @@ def execute(self):
parser.add_argument("--version", action="version",
version="%(prog)s {0}".format(VERSION))
+ parser.add_argument('-v',
+ '--verbose',
+ action='store_true',
+ help="show INFO logging events instead "
+ "of CRITICAL, which is the default. These logging "
+ "events provide insight into localization of "
+ "specific providers.")
+
parser.add_argument('-o', metavar="output",
type=argparse.FileType('w'),
default=sys.stdout,
@@ -186,6 +208,12 @@ def execute(self):
help="use the specified separator after each "
"output")
+ parser.add_argument('--seed', metavar='SEED',
+ type=int,
+ help="specify a seed for the random generator so "
+ "that results are repeatable. Also compatible "
+ "with 'repeat' option")
+
parser.add_argument('-i',
'--include',
default=META_PROVIDERS_MODULES,
@@ -212,13 +240,22 @@ def execute(self):
arguments = parser.parse_args(self.argv[1:])
+ if arguments.verbose:
+ logging.basicConfig(level=logging.DEBUG)
+ else:
+ logging.basicConfig(level=logging.CRITICAL)
+
+ random.seed(arguments.seed)
+ seeds = random.sample(range(arguments.repeat*10), arguments.repeat)
+
for i in range(arguments.repeat):
print_doc(arguments.fake,
arguments.fake_args,
lang=arguments.lang,
output=arguments.o,
- includes=arguments.include
+ seed=seeds[i],
+ includes=arguments.include,
)
print(arguments.sep, file=arguments.o)
diff --git a/src/libs/faker/config.py b/src/libs/faker/config.py
index 3796de8..8833e6b 100644
--- a/src/libs/faker/config.py
+++ b/src/libs/faker/config.py
@@ -8,6 +8,7 @@
'faker.providers',
]
-PROVIDERS = find_available_providers([import_module(path) for path in META_PROVIDERS_MODULES])
+PROVIDERS = find_available_providers(
+ [import_module(path) for path in META_PROVIDERS_MODULES])
AVAILABLE_LOCALES = find_available_locales(PROVIDERS)
diff --git a/src/libs/faker/documentor.py b/src/libs/faker/documentor.py
index a936420..02ccd20 100644
--- a/src/libs/faker/documentor.py
+++ b/src/libs/faker/documentor.py
@@ -31,7 +31,7 @@ def get_formatters(self, locale=None, excludes=None, **kwargs):
if locale and provider.__lang__ != locale:
continue
formatters.append(
- (provider, self.get_provider_formatters(provider, **kwargs))
+ (provider, self.get_provider_formatters(provider, **kwargs)),
)
return formatters
diff --git a/src/libs/faker/factory.py b/src/libs/faker/factory.py
index 79b9a7f..099b39e 100644
--- a/src/libs/faker/factory.py
+++ b/src/libs/faker/factory.py
@@ -6,15 +6,34 @@
from importlib import import_module
import locale as pylocale
+import logging
+import sys
+
from faker import Generator
from faker.config import DEFAULT_LOCALE, PROVIDERS, AVAILABLE_LOCALES
from faker.utils.loading import list_module
+logger = logging.getLogger(__name__)
+
+# identify if python is being run in interactive mode. If so, disable logging.
+inREPL = bool(getattr(sys, 'ps1', False))
+if inREPL:
+ logger.setLevel(logging.CRITICAL)
+else:
+ logger.debug('Not in REPL -> leaving logger event level as is.')
+
+
class Factory(object):
@classmethod
- def create(cls, locale=None, providers=None, generator=None, includes=None, **config):
+ def create(
+ cls,
+ locale=None,
+ providers=None,
+ generator=None,
+ includes=None,
+ **config):
if includes is None:
includes = []
@@ -22,7 +41,7 @@ def create(cls, locale=None, providers=None, generator=None, includes=None, **co
locale = locale.replace('-', '_') if locale else DEFAULT_LOCALE
locale = pylocale.normalize(locale).split('.')[0]
if locale not in AVAILABLE_LOCALES:
- msg = 'Invalid configuration for faker locale "{0}"'.format(locale)
+ msg = 'Invalid configuration for faker locale `{0}`'.format(locale)
raise AttributeError(msg)
config['locale'] = locale
@@ -63,25 +82,48 @@ def _get_provider_class(cls, provider, locale=''):
if provider_class:
return provider_class, None
- msg = 'Unable to find provider "{0}" with locale "{1}"'.format(
+ msg = 'Unable to find provider `{0}` with locale `{1}`'.format(
provider, locale)
raise ValueError(msg)
@classmethod
def _find_provider_class(cls, provider_path, locale=None):
+
provider_module = import_module(provider_path)
if getattr(provider_module, 'localized', False):
+
+ logger.debug('Looking for locale `{}` in provider `{}`.'.format(
+ locale, provider_module.__name__))
+
available_locales = list_module(provider_module)
if not locale or locale not in available_locales:
- locale = getattr(provider_module, 'default_locale', DEFAULT_LOCALE)
+ unavailable_locale = locale
+ locale = getattr(
+ provider_module, 'default_locale', DEFAULT_LOCALE)
+ logger.debug('Specified locale `{}` is not available for '
+ 'provider `{}`. Locale reset to `{}` for this '
+ 'provider.'.format(
+ unavailable_locale, provider_module.__name__, locale),
+ )
+ else:
+ logger.debug('Provider `{}` has been localized to `{}`.'.format(
+ provider_module.__name__, locale))
path = "{provider_path}.{locale}".format(
provider_path=provider_path,
locale=locale,
)
provider_module = import_module(path)
+
else:
+
+ logger.debug('Provider `{}` does not feature localization. '
+ 'Specified locale `{}` is not utilized for this '
+ 'provider.'.format(
+ provider_module.__name__, locale),
+ )
+
if locale is not None:
provider_module = import_module(provider_path)
diff --git a/src/libs/faker/generator.py b/src/libs/faker/generator.py
index 73835c3..9c835d9 100644
--- a/src/libs/faker/generator.py
+++ b/src/libs/faker/generator.py
@@ -5,7 +5,6 @@
import re
import random as random_module
-
_re_token = re.compile(r'\{\{(\s?)(\w+)(\s?)\}\}')
random = random_module.Random()
mod_random = random # compat with name released in 0.8
@@ -23,7 +22,7 @@ def __init__(self, **config):
def add_provider(self, provider):
- if type(provider) is type:
+ if isinstance(provider, type):
provider = provider(self)
self.providers.insert(0, provider)
@@ -35,8 +34,7 @@ def add_provider(self, provider):
faker_function = getattr(provider, method_name)
- if hasattr(faker_function, '__call__') or \
- isinstance(faker_function, (classmethod, staticmethod)):
+ if callable(faker_function):
# add all faker method to generator
self.set_formatter(method_name, faker_function)
@@ -59,9 +57,11 @@ def random(self):
def seed_instance(self, seed=None):
"""Calls random.seed"""
if self.__random == random:
- # create per-instance random obj when first time seed_instance() is called
+ # create per-instance random obj when first time seed_instance() is
+ # called
self.__random = random_module.Random()
self.__random.seed(seed)
+ return self
@classmethod
def seed(cls, seed=None):
@@ -80,11 +80,11 @@ def get_formatter(self, formatter):
except AttributeError:
if 'locale' in self.__config:
msg = 'Unknown formatter "{0}" with locale "{1}"'.format(
- formatter, self.__config['locale']
+ formatter, self.__config['locale'],
)
else:
raise AttributeError('Unknown formatter "{0}"'.format(
- formatter
+ formatter,
))
raise AttributeError(msg)
diff --git a/src/libs/faker/providers/__init__.py b/src/libs/faker/providers/__init__.py
index eb1f176..2d4993b 100644
--- a/src/libs/faker/providers/__init__.py
+++ b/src/libs/faker/providers/__init__.py
@@ -1,10 +1,9 @@
# coding=utf-8
-from collections import Counter
import re
import string
-from faker.utils.distribution import choice_distribution
+from faker.utils.distribution import choices_distribution, choices_distribution_unique
_re_hash = re.compile(r'#')
@@ -12,6 +11,7 @@
_re_excl = re.compile(r'!')
_re_at = re.compile(r'@')
_re_qm = re.compile(r'\?')
+_re_cir = re.compile(r'\^')
class BaseProvider(object):
@@ -80,17 +80,61 @@ def random_number(self, digits=None, fix_len=False):
if digits is None:
digits = self.random_digit()
if fix_len:
- return self.generator.random.randint(pow(10, digits - 1), pow(10, digits) - 1)
+ return self.generator.random.randint(
+ pow(10, digits - 1), pow(10, digits) - 1)
else:
return self.generator.random.randint(0, pow(10, digits) - 1)
def random_letter(self):
"""Returns a random letter (between a-z and A-Z)."""
- return self.generator.random.choice(getattr(string, 'letters', string.ascii_letters))
+ return self.generator.random.choice(
+ getattr(string, 'letters', string.ascii_letters))
- def random_element(self, elements=('a', 'b', 'c')):
+ def random_letters(self, length=16):
+ """Returns a random letter (between a-z and A-Z)."""
+ return self.random_choices(
+ getattr(string, 'letters', string.ascii_letters),
+ length=length,
+ )
+
+ def random_lowercase_letter(self):
+ """Returns a random lowercase letter (between a-z)."""
+ return self.generator.random.choice(string.ascii_lowercase)
+
+ def random_uppercase_letter(self):
+ """Returns a random letter (between A-Z)."""
+ return self.generator.random.choice(string.ascii_uppercase)
+
+ def random_elements(self, elements=('a', 'b', 'c'), length=None, unique=False):
+ fn = choices_distribution_unique if unique else choices_distribution
+
+ if length is None:
+ length = self.generator.random.randint(1, len(elements))
+
+ if unique and length > len(elements):
+ raise ValueError(
+ "Sample length cannot be longer than the number of unique elements to pick from.")
+
+ if isinstance(elements, dict):
+ choices = elements.keys()
+ probabilities = elements.values()
+ else:
+ if unique:
+ # shortcut
+ return self.generator.random.sample(elements, length)
+ choices = elements
+ probabilities = [1.0 for _ in range(len(choices))]
+
+ return fn(
+ list(choices),
+ list(probabilities),
+ self.generator.random,
+ length=length,
+ )
+
+ def random_choices(self, elements=('a', 'b', 'c'), length=None):
"""
- Returns a random element from a passed object.
+ Returns a list of random, non-unique elements from a passed object.
If `elements` is a dictionary, the value will be used as
a weighting element. For example::
@@ -104,39 +148,40 @@ def random_element(self, elements=('a', 'b', 'c')):
* `variable_4`: 10% probability
"""
+ return self.random_elements(elements, length, unique=False)
- if isinstance(elements, dict):
- choices = elements.keys()
- probabilities = elements.values()
- return choice_distribution(list(choices), list(probabilities), self.generator.random)
- else:
- return self.generator.random.choice(list(elements))
+ def random_element(self, elements=('a', 'b', 'c')):
+ """
+ Returns a random element from a passed object.
- def random_sample(self, elements=('a', 'b', 'c'), length=None):
- if length is None:
- length = self.generator.random.randint(1, len(elements))
+ If `elements` is a dictionary, the value will be used as
+ a weighting element. For example::
- return [self.random_element(elements) for _ in range(length)]
+ random_element({"{{variable_1}}": 0.5, "{{variable_2}}": 0.2, "{{variable_3}}": 0.2, "{{variable_4}}": 0.1})
- def random_sample_unique(self, elements=('a', 'b', 'c'), length=None):
- """
- Returns a `set` of random unique elements for the specified length.
- Multiple occurances of the same value increase its probabilty to be in the output.
- """
- elements = Counter(elements)
- if length is None:
- length = self.generator.random.randint(1, len(elements))
+ will have the following distribution:
+ * `variable_1`: 50% probability
+ * `variable_2`: 20% probability
+ * `variable_3`: 20% probability
+ * `variable_4`: 10% probability
- if length > len(elements):
- raise ValueError("Sample length cannot be longer than the number of unique elements to pick from.")
- sample = set()
- for _ in range(length):
- element = self.random_element(elements)
- sample.add(element)
- elements.pop(element)
- return sample
+ """
+ return self.random_elements(elements, length=1)[0]
- def randomize_nb_elements(self, number=10, le=False, ge=False, min=None, max=None):
+ def random_sample(self, elements=('a', 'b', 'c'), length=None):
+ """
+ Returns a list of random unique elements for the specified length.
+ Multiple occurrences of the same value increase its probability to be in the output.
+ """
+ return self.random_elements(elements, length, unique=True)
+
+ def randomize_nb_elements(
+ self,
+ number=10,
+ le=False,
+ ge=False,
+ min=None,
+ max=None):
"""
Returns a random value near number.
@@ -201,3 +246,17 @@ def bothify(self, text='## ??', letters=string.ascii_letters):
:returns: string with all numerical and letter placeholders filled in
"""
return self.lexify(self.numerify(text), letters=letters)
+
+ def hexify(self, text='^^^^', upper=False):
+ """
+ Replaces all circumflex ('^') occurrences with a random
+ hexadecimal character.
+
+ :param text: string to be parsed
+ :param upper: Format as uppercase hexadecimal
+ :returns: string with all letter placeholders filled in
+ """
+ letters = string.hexdigits[:-6]
+ if upper:
+ letters = letters.upper()
+ return _re_cir.sub(lambda x: self.random_element(letters), text)
diff --git a/src/libs/faker/providers/address/__init__.py b/src/libs/faker/providers/address/__init__.py
index ff39972..539535c 100644
--- a/src/libs/faker/providers/address/__init__.py
+++ b/src/libs/faker/providers/address/__init__.py
@@ -1,6 +1,5 @@
# coding=utf-8
from __future__ import unicode_literals
-from decimal import Decimal
from .. import BaseProvider
from .. import date_time
@@ -9,8 +8,8 @@
class Provider(BaseProvider):
- city_suffixes = ['Ville', ]
- street_suffixes = ['Street', ]
+ city_suffixes = ['Ville']
+ street_suffixes = ['Street']
city_formats = ('{{first_name}} {{city_suffix}}', )
street_name_formats = ('{{last_name}} {{street_suffix}}', )
street_address_formats = ('{{building_number}} {{street_name}}', )
@@ -18,7 +17,12 @@ class Provider(BaseProvider):
building_number_formats = ('##', )
postcode_formats = ('#####', )
countries = [tz['name'] for tz in date_time.Provider.countries]
- country_codes = [tz['code'] for tz in date_time.Provider.countries]
+
+ ALPHA_2 = 'alpha-2'
+ ALPHA_3 = 'alpha-3'
+
+ alpha_2_country_codes = [tz['alpha-2-code'] for tz in date_time.Provider.countries]
+ alpha_3_country_codes = [tz['alpha-3-code'] for tz in date_time.Provider.countries]
def city_suffix(self):
"""
@@ -75,24 +79,10 @@ def address(self):
def country(self):
return self.random_element(self.countries)
- def country_code(self):
- return self.random_element(self.country_codes)
-
- def geo_coordinate(self, center=None, radius=0.001):
- """
- Optionally center the coord and pick a point within radius.
- """
- if center is None:
- return Decimal(str(self.generator.random.randint(-180000000, 180000000) / 1000000.0)).quantize(Decimal('.000001'))
+ def country_code(self, representation=ALPHA_2):
+ if representation == self.ALPHA_2:
+ return self.random_element(self.alpha_2_country_codes)
+ elif representation == self.ALPHA_3:
+ return self.random_element(self.alpha_3_country_codes)
else:
- center = float(center)
- radius = float(radius)
- geo = self.generator.random.uniform(center - radius, center + radius)
- return Decimal(str(geo)).quantize(Decimal('.000001'))
-
- def latitude(self):
- # Latitude has a range of -90 to 90, so divide by two.
- return self.geo_coordinate() / 2
-
- def longitude(self):
- return self.geo_coordinate()
+ raise ValueError("`representation` must be one of `alpha-2` or `alpha-3`.")
diff --git a/src/libs/faker/providers/address/cs_CZ/__init__.py b/src/libs/faker/providers/address/cs_CZ/__init__.py
index 29570a9..add6d18 100644
--- a/src/libs/faker/providers/address/cs_CZ/__init__.py
+++ b/src/libs/faker/providers/address/cs_CZ/__init__.py
@@ -756,3 +756,9 @@ def street_name(self):
def state(self):
return self.random_element(self.states)
+
+ def postcode(self):
+ return self.bothify(self.random_element(self.postcode_formats))
+
+ def city_with_postcode(self):
+ return self.postcode() + " " + self.random_element(self.cities)
diff --git a/src/libs/faker/providers/address/de/__init__.py b/src/libs/faker/providers/address/de/__init__.py
new file mode 100644
index 0000000..b5ade9e
--- /dev/null
+++ b/src/libs/faker/providers/address/de/__init__.py
@@ -0,0 +1,66 @@
+# coding=utf-8
+
+from __future__ import unicode_literals
+from .. import Provider as AddressProvider
+
+
+class Provider(AddressProvider):
+ countries = (
+ 'Afghanistan', 'Alandinseln', 'Albanien', 'Algerien',
+ 'Amerikanisch-Ozeanien', 'Amerikanisch-Samoa',
+ 'Amerikanische Jungferninseln', 'Andorra', 'Angola', 'Anguilla',
+ 'Antarktis', 'Antigua und Barbuda', 'Argentinien', 'Armenien', 'Aruba',
+ 'Aserbaidschan', 'Australien', 'Bahamas', 'Bahrain', 'Bangladesch',
+ 'Barbados', 'Belarus', 'Belgien', 'Belize', 'Benin', 'Bermuda',
+ 'Bhutan', 'Bolivien', 'Bosnien und Herzegowina', 'Botsuana',
+ 'Bouvetinsel', 'Brasilien', 'Britische Jungferninseln',
+ 'Britisches Territorium im Indischen Ozean', 'Brunei Darussalam',
+ 'Bulgarien', 'Burkina Faso', 'Burundi', 'Chile', 'China', 'Cookinseln',
+ 'Costa Rica', 'Côte d’Ivoire', 'Demokratische Republik Kongo',
+ 'Demokratische Volksrepublik Korea', 'Deutschland', 'Dominica',
+ 'Dominikanische Republik', 'Dschibuti', 'Dänemark', 'Ecuador',
+ 'El Salvador', 'Eritrea', 'Estland', 'Falklandinseln', 'Fidschi',
+ 'Finnland', 'Frankreich', 'Französisch-Guayana',
+ 'Französisch-Polynesien', 'Färöer', 'Gabun', 'Gambia', 'Georgien',
+ 'Ghana', 'Gibraltar', 'Grenada', 'Griechenland', 'Grönland',
+ 'Guadeloupe', 'Guam', 'Guatemala', 'Guernsey', 'Guinea',
+ 'Guinea-Bissau', 'Guyana', 'Haiti', 'Heard- und McDonald-Inseln',
+ 'Honduras', 'Indien', 'Indonesien', 'Irak', 'Iran', 'Irland', 'Island',
+ 'Isle of Man', 'Israel', 'Italien', 'Jamaika', 'Japan', 'Jemen',
+ 'Jersey', 'Jordanien', 'Kaimaninseln', 'Kambodscha', 'Kamerun',
+ 'Kanada', 'Kap Verde', 'Kasachstan', 'Katar', 'Kenia', 'Kirgisistan',
+ 'Kiribati', 'Kokosinseln', 'Kolumbien', 'Komoren', 'Kongo', 'Kroatien',
+ 'Kuba', 'Kuwait', 'Laos', 'Lesotho', 'Lettland', 'Libanon', 'Liberia',
+ 'Libyen', 'Liechtenstein', 'Litauen', 'Luxemburg', 'Madagaskar',
+ 'Malawi', 'Malaysia', 'Malediven', 'Mali', 'Malta', 'Marokko',
+ 'Marshallinseln', 'Martinique', 'Mauretanien', 'Mauritius', 'Mayotte',
+ 'Mazedonien', 'Mexiko', 'Mikronesien', 'Monaco', 'Mongolei',
+ 'Montenegro', 'Montserrat', 'Mosambik', 'Myanmar', 'Namibia', 'Nauru',
+ 'Nepal', 'Neukaledonien', 'Neuseeland', 'Nicaragua', 'Niederlande',
+ 'Niederländische Antillen', 'Niger', 'Nigeria', 'Niue', 'Norfolkinsel',
+ 'Norwegen', 'Nördliche Marianen', 'Oman', 'Osttimor', 'Pakistan',
+ 'Palau', 'Palästinensische Gebiete', 'Panama', 'Papua-Neuguinea',
+ 'Paraguay', 'Peru', 'Philippinen', 'Pitcairn', 'Polen', 'Portugal',
+ 'Puerto Rico', 'Republik Korea', 'Republik Moldau', 'Ruanda',
+ 'Rumänien', 'Russische Föderation', 'Réunion', 'Salomonen', 'Sambia',
+ 'Samoa', 'San Marino', 'Saudi-Arabien', 'Schweden', 'Schweiz',
+ 'Senegal', 'Serbien', 'Serbien und Montenegro', 'Seychellen',
+ 'Sierra Leone', 'Simbabwe', 'Singapur', 'Slowakei', 'Slowenien',
+ 'Somalia', 'Sonderverwaltungszone Hongkong',
+ 'Sonderverwaltungszone Macao', 'Spanien', 'Sri Lanka',
+ 'St. Barthélemy', 'St. Helena', 'St. Kitts und Nevis', 'St. Lucia',
+ 'St. Martin', 'St. Pierre und Miquelon',
+ 'St. Vincent und die Grenadinen', 'Sudan', 'Suriname',
+ 'Svalbard und Jan Mayen', 'Swasiland', 'Syrien',
+ 'São Tomé und Príncipe', 'Südafrika',
+ 'Südgeorgien und die Südlichen Sandwichinseln', 'Tadschikistan',
+ 'Taiwan', 'Tansania', 'Thailand', 'Togo', 'Tokelau', 'Tonga',
+ 'Trinidad und Tobago', 'Tschad', 'Tschechische Republik', 'Tunesien',
+ 'Turkmenistan', 'Turks- und Caicosinseln', 'Tuvalu', 'Türkei',
+ 'Uganda', 'Ukraine', 'Ungarn', 'Uruguay', 'Usbekistan', 'Vanuatu',
+ 'Vatikanstadt', 'Venezuela', 'Vereinigte Arabische Emirate',
+ 'Vereinigte Staaten', 'Vereinigtes Königreich', 'Vietnam',
+ 'Wallis und Futuna', 'Weihnachtsinsel', 'Westsahara',
+ 'Zentralafrikanische Republik', 'Zypern', 'Ägypten',
+ 'Äquatorialguinea', 'Äthiopien', 'Äußeres Ozeanien', 'Österreich',
+ )
diff --git a/src/libs/faker/providers/address/de_AT/__init__.py b/src/libs/faker/providers/address/de_AT/__init__.py
new file mode 100644
index 0000000..32ae17a
--- /dev/null
+++ b/src/libs/faker/providers/address/de_AT/__init__.py
@@ -0,0 +1,90 @@
+# coding=utf-8
+
+from __future__ import unicode_literals
+from ..de import Provider as AddressProvider
+
+
+class Provider(AddressProvider):
+
+ city_formats = ('{{city_name}}', )
+
+ city_with_postcode_formats = ('{{postcode}} {{city}}', )
+
+ street_name_formats = (
+ '{{first_name}}-{{last_name}}-{{street_suffix_long}}',
+ '{{last_name}}{{street_suffix_short}}',
+ )
+ street_address_formats = ('{{street_name}} {{building_number}}', )
+ address_formats = ('{{street_address}}\n{{postcode}} {{city}}', )
+
+ building_number_formats = ('###', '##', '#', '#/#')
+
+ street_suffixes_long = (
+ 'Gasse', 'Platz', 'Ring', 'Straße', 'Weg',
+ )
+ street_suffixes_short = (
+ 'gasse', 'platz', 'ring', 'straße', 'str.', 'weg',
+ )
+
+ # https://en.wikipedia.org/wiki/List_of_postal_codes_in_Austria
+ postcode_formats = (
+ '1###', '2###', '3###', '4###', '5###', '6###', '7###', '8###', '9###',
+ )
+
+ # https://en.wikipedia.org/wiki/List_of_cities_and_towns_in_Austria
+ cities = (
+ 'Allentsteig', 'Altheim', 'Althofen', 'Amstetten', 'Ansfelden', 'Attnang-Puchheim',
+ 'Bad Aussee', 'Bad Hall', 'Bad Ischl', 'Bad Leonfelden', 'Bad Radkersburg',
+ 'Bad Sankt Leonhard im Lavanttal', 'Bad Vöslau', 'Baden', 'Bärnbach', 'Berndorf',
+ 'Bischofshofen', 'Bleiburg', 'Bludenz', 'Braunau am Inn', 'Bregenz',
+ 'Bruck an der Leitha', 'Bruck an der Mur', 'Deutsch-Wagram', 'Deutschlandsberg',
+ 'Dornbirn', 'Drosendorf-Zissersdorf 1', 'Dürnstein', 'Ebenfurth', 'Ebreichsdorf',
+ 'Eferding', 'Eggenburg', 'Eisenerz', 'Eisenstadt', 'Enns', 'Fehring', 'Feldbach',
+ 'Feldkirch', 'Feldkirchen', 'Ferlach', 'Fischamend', 'Frauenkirchen', 'Freistadt',
+ 'Friedberg', 'Friesach', 'Frohnleiten', 'Fürstenfeld', 'Gallneukirchen', 'Gänserndorf',
+ 'Geras', 'Gerasdorf bei Wien', 'Gföhl', 'Gleisdorf', 'Gloggnitz', 'Gmünd',
+ 'Gmünd in Kärnten', 'Gmunden', 'Graz', 'Grein', 'Grieskirchen', 'Groß-Enzersdorf',
+ 'Groß-Gerungs', 'Groß-Siegharts', 'Güssing', 'Haag', 'Hainburg an der Donau', 'Hainfeld',
+ 'Hall in Tirol', 'Hallein', 'Hardegg', 'Hartberg', 'Heidenreichstein', 'Herzogenburg',
+ 'Imst', 'Innsbruck', 'Jennersdorf', 'Judenburg', 'Kapfenberg', 'Kindberg', 'Klagenfurt',
+ 'Klosterneuburg', 'Knittelfeld', 'Köflach', 'Korneuburg', 'Krems an der Donau', 'Kufstein',
+ 'Laa an der Thaya', 'Laakirchen', 'Landeck', 'Langenlois', 'Leibnitz', 'Leoben', 'Lienz',
+ 'Liezen', 'Lilienfeld', 'Linz', 'Litschau', 'Maissau', 'Mank', 'Mannersdorf am Leithagebirge',
+ 'Marchegg', 'Marchtrenk', 'Mariazell', 'Mattersburg', 'Mattighofen', 'Mautern an der Donau',
+ 'Melk', 'Mistelbach an der Zaya', 'Mödling', 'Murau', 'Mureck', 'Mürzzuschlag', 'Neulengbach',
+ 'Neumarkt am Wallersee', 'Neunkirchen', 'Neusiedl am See', 'Oberndorf bei Salzburg',
+ 'Oberpullendorf', 'Oberwart', 'Oberwälz', 'Perg', 'Peuerbach', 'Pinkafeld', 'Pöchlarn',
+ 'Poysdorf', 'Pregarten', 'Pulkau', 'Purbach am Neusiedler See', 'Purkersdorf',
+ 'Raabs an der Thaya', 'Radenthein', 'Radstadt', 'Rattenberg', 'Retz', 'Ried im Innkreis',
+ 'Rohrbach in Oberösterreich', 'Rottenmann', 'Rust', 'Saalfelden am Steinernen Meer',
+ 'Salzburg', 'Sankt Andrä im Lavanttal', 'Sankt Johann im Pongau', 'Sankt Pölten',
+ 'Sankt Valentin', 'Sankt Veit an der Glan', 'Schärding', 'Scheibbs', 'Schladming',
+ 'Schrattenthal', 'Schrems', 'Schwanenstadt', 'Schwaz', 'Schwechat', 'Spittal an der Drau',
+ 'Stadtschlaining', 'Steyr', 'Steyregg', 'Stockerau', 'Straßburg', 'Ternitz', 'Traiskirchen',
+ 'Traismauer', 'Traun', 'Trieben', 'Trofaiach', 'Tulln an der Donau', 'Villach', 'Vils',
+ 'Vöcklabruck', 'Voitsberg', 'Völkermarkt', 'Waidhofen an der Thaya', 'Waidhofen an der Ybbs',
+ 'Weitra', 'Weiz', 'Wels', 'Wien', 'Wiener Neustadt', 'Wieselburg', 'Wilhelmsburg', 'Wolfsberg',
+ 'Wolkersdorf', 'Wörgl', 'Ybbs an der Donau', 'Zell am See', 'Zeltweg', 'Zistersdorf', 'Zwettl',
+ )
+
+ # https://en.wikipedia.org/wiki/States_of_Austria
+ states = (
+ 'Wien', 'Steiermark', 'Burgenland', 'Tirol', 'Niederösterreich',
+ 'Oberösterreich', 'Salzburg', 'Kärnten', 'Vorarlberg',
+ )
+
+ def street_suffix_short(self):
+ return self.random_element(self.street_suffixes_short)
+
+ def street_suffix_long(self):
+ return self.random_element(self.street_suffixes_long)
+
+ def city_name(self):
+ return self.random_element(self.cities)
+
+ def state(self):
+ return self.random_element(self.states)
+
+ def city_with_postcode(self):
+ pattern = self.random_element(self.city_with_postcode_formats)
+ return self.generator.parse(pattern)
diff --git a/src/libs/faker/providers/address/de_DE/__init__.py b/src/libs/faker/providers/address/de_DE/__init__.py
index 707dd86..eca1252 100644
--- a/src/libs/faker/providers/address/de_DE/__init__.py
+++ b/src/libs/faker/providers/address/de_DE/__init__.py
@@ -1,13 +1,15 @@
# coding=utf-8
from __future__ import unicode_literals
-from .. import Provider as AddressProvider
+from ..de import Provider as AddressProvider
class Provider(AddressProvider):
city_formats = ('{{city_name}}', )
+ city_with_postcode_formats = ('{{postcode}} {{city}}', )
+
street_name_formats = (
'{{first_name}}-{{last_name}}-{{street_suffix_long}}',
'{{last_name}}{{street_suffix_short}}',
@@ -15,7 +17,7 @@ class Provider(AddressProvider):
street_address_formats = ('{{street_name}} {{building_number}}', )
address_formats = ('{{street_address}}\n{{postcode}} {{city}}', )
- building_number_formats = ('###', '##', '#', '#/#', )
+ building_number_formats = ('###', '##', '#', '#/#')
street_suffixes_long = (
'Gasse', 'Platz', 'Ring', 'Straße', 'Weg', 'Allee',
@@ -114,66 +116,6 @@ class Provider(AddressProvider):
'Sachsen-Anhalt', 'Schleswig-Holstein', 'Thüringen',
)
- countries = (
- 'Afghanistan', 'Alandinseln', 'Albanien', 'Algerien',
- 'Amerikanisch-Ozeanien', 'Amerikanisch-Samoa',
- 'Amerikanische Jungferninseln', 'Andorra', 'Angola', 'Anguilla',
- 'Antarktis', 'Antigua und Barbuda', 'Argentinien', 'Armenien', 'Aruba',
- 'Aserbaidschan', 'Australien', 'Bahamas', 'Bahrain', 'Bangladesch',
- 'Barbados', 'Belarus', 'Belgien', 'Belize', 'Benin', 'Bermuda',
- 'Bhutan', 'Bolivien', 'Bosnien und Herzegowina', 'Botsuana',
- 'Bouvetinsel', 'Brasilien', 'Britische Jungferninseln',
- 'Britisches Territorium im Indischen Ozean', 'Brunei Darussalam',
- 'Bulgarien', 'Burkina Faso', 'Burundi', 'Chile', 'China', 'Cookinseln',
- 'Costa Rica', 'Côte d’Ivoire', 'Demokratische Republik Kongo',
- 'Demokratische Volksrepublik Korea', 'Deutschland', 'Dominica',
- 'Dominikanische Republik', 'Dschibuti', 'Dänemark', 'Ecuador',
- 'El Salvador', 'Eritrea', 'Estland', 'Falklandinseln', 'Fidschi',
- 'Finnland', 'Frankreich', 'Französisch-Guayana',
- 'Französisch-Polynesien', 'Färöer', 'Gabun', 'Gambia', 'Georgien',
- 'Ghana', 'Gibraltar', 'Grenada', 'Griechenland', 'Grönland',
- 'Guadeloupe', 'Guam', 'Guatemala', 'Guernsey', 'Guinea',
- 'Guinea-Bissau', 'Guyana', 'Haiti', 'Heard- und McDonald-Inseln',
- 'Honduras', 'Indien', 'Indonesien', 'Irak', 'Iran', 'Irland', 'Island',
- 'Isle of Man', 'Israel', 'Italien', 'Jamaika', 'Japan', 'Jemen',
- 'Jersey', 'Jordanien', 'Kaimaninseln', 'Kambodscha', 'Kamerun',
- 'Kanada', 'Kap Verde', 'Kasachstan', 'Katar', 'Kenia', 'Kirgisistan',
- 'Kiribati', 'Kokosinseln', 'Kolumbien', 'Komoren', 'Kongo', 'Kroatien',
- 'Kuba', 'Kuwait', 'Laos', 'Lesotho', 'Lettland', 'Libanon', 'Liberia',
- 'Libyen', 'Liechtenstein', 'Litauen', 'Luxemburg', 'Madagaskar',
- 'Malawi', 'Malaysia', 'Malediven', 'Mali', 'Malta', 'Marokko',
- 'Marshallinseln', 'Martinique', 'Mauretanien', 'Mauritius', 'Mayotte',
- 'Mazedonien', 'Mexiko', 'Mikronesien', 'Monaco', 'Mongolei',
- 'Montenegro', 'Montserrat', 'Mosambik', 'Myanmar', 'Namibia', 'Nauru',
- 'Nepal', 'Neukaledonien', 'Neuseeland', 'Nicaragua', 'Niederlande',
- 'Niederländische Antillen', 'Niger', 'Nigeria', 'Niue', 'Norfolkinsel',
- 'Norwegen', 'Nördliche Marianen', 'Oman', 'Osttimor', 'Pakistan',
- 'Palau', 'Palästinensische Gebiete', 'Panama', 'Papua-Neuguinea',
- 'Paraguay', 'Peru', 'Philippinen', 'Pitcairn', 'Polen', 'Portugal',
- 'Puerto Rico', 'Republik Korea', 'Republik Moldau', 'Ruanda',
- 'Rumänien', 'Russische Föderation', 'Réunion', 'Salomonen', 'Sambia',
- 'Samoa', 'San Marino', 'Saudi-Arabien', 'Schweden', 'Schweiz',
- 'Senegal', 'Serbien', 'Serbien und Montenegro', 'Seychellen',
- 'Sierra Leone', 'Simbabwe', 'Singapur', 'Slowakei', 'Slowenien',
- 'Somalia', 'Sonderverwaltungszone Hongkong',
- 'Sonderverwaltungszone Macao', 'Spanien', 'Sri Lanka',
- 'St. Barthélemy', 'St. Helena', 'St. Kitts und Nevis', 'St. Lucia',
- 'St. Martin', 'St. Pierre und Miquelon',
- 'St. Vincent und die Grenadinen', 'Sudan', 'Suriname',
- 'Svalbard und Jan Mayen', 'Swasiland', 'Syrien',
- 'São Tomé und Príncipe', 'Südafrika',
- 'Südgeorgien und die Südlichen Sandwichinseln', 'Tadschikistan',
- 'Taiwan', 'Tansania', 'Thailand', 'Togo', 'Tokelau', 'Tonga',
- 'Trinidad und Tobago', 'Tschad', 'Tschechische Republik', 'Tunesien',
- 'Turkmenistan', 'Turks- und Caicosinseln', 'Tuvalu', 'Türkei',
- 'Uganda', 'Ukraine', 'Ungarn', 'Uruguay', 'Usbekistan', 'Vanuatu',
- 'Vatikanstadt', 'Venezuela', 'Vereinigte Arabische Emirate',
- 'Vereinigte Staaten', 'Vereinigtes Königreich', 'Vietnam',
- 'Wallis und Futuna', 'Weihnachtsinsel', 'Westsahara',
- 'Zentralafrikanische Republik', 'Zypern', 'Ägypten',
- 'Äquatorialguinea', 'Äthiopien', 'Äußeres Ozeanien', 'Österreich',
- )
-
def street_suffix_short(self):
return self.random_element(self.street_suffixes_short)
@@ -186,5 +128,6 @@ def city_name(self):
def state(self):
return self.random_element(self.states)
- def country(self):
- return self.random_element(self.countries)
+ def city_with_postcode(self):
+ pattern = self.random_element(self.city_with_postcode_formats)
+ return self.generator.parse(pattern)
diff --git a/src/libs/faker/providers/address/el_GR/__init__.py b/src/libs/faker/providers/address/el_GR/__init__.py
index 284d8bf..a4cb70d 100644
--- a/src/libs/faker/providers/address/el_GR/__init__.py
+++ b/src/libs/faker/providers/address/el_GR/__init__.py
@@ -1,37 +1,10 @@
# coding=utf-8
from __future__ import unicode_literals
-from decimal import Decimal
from .. import Provider as AddressProvider
-def contains_point(poly, point):
- """
- Given a list of 2-tuples (lat, lng) defining a convex polygon, returns
- True if the given point, which is a 2-tuple (lat, lng), is inside the
- polygon, False otherwise.
- """
- n = len(poly)
- c = False
- i = 0
- j = n - 1
- while i < n:
- if ((poly[i][0] > point[0]) != (poly[j][0] > point[0])) and \
- (point[1] < (poly[j][1] - poly[i][1]) * (point[0] - poly[i][0]) /
- (poly[j][0] - poly[i][0]) + poly[i][1]):
- c = not c
- j = i
- i += 1
- return c
-
-
class Provider(AddressProvider):
- poly = (
- (40.34026, 19.15120),
- (42.21670, 26.13934),
- (35.55680, 29.38280),
- (34.15370, 22.58810),
- )
building_number_formats = (
'###',
@@ -89,7 +62,9 @@ def line_address(self):
return self.generator.parse(pattern)
def street_prefix(self):
- return self.random_element(self.street_prefixes_short + self.street_prefixes_long)
+ return self.random_element(
+ self.street_prefixes_short +
+ self.street_prefixes_long)
def street_prefix_short(self):
return self.random_element(self.street_prefixes_short)
@@ -106,27 +81,59 @@ def city(self):
def region(self):
return self.random_element(self.regions)
- def latlng(self):
- return float(self.latitude()), float(self.longitude())
-
- def latitude(self):
- l = list(map(lambda t: int(t[0] * 10000000), self.poly))
- return Decimal(str(self.generator.random.randint(min(l), max(l)) / 10000000.0)).quantize(Decimal('.000001'))
-
- def longitude(self):
- l = list(map(lambda t: int(t[1] * 10000000), self.poly))
- return Decimal(str(self.generator.random.randint(min(l), max(l)) / 10000000.0)).quantize(Decimal('.000001'))
-
# Ονόματα πρωτευουσών νομών
cities = (
- 'Άμφισσα', 'Άρτα', 'Έδεσσα', 'Αγ. Νικόλαος', 'Αθήνα', 'Αλεξανδρούπολη',
- 'Αργοστόλι', 'Βέροια', 'Βόλος', 'Γρεβενά', 'Δράμα', 'Ερμούπολη', 'Ζάκυνθος',
- 'Ηγουμενίτσα', 'Ηράκλειο', 'Θεσσαλονίκη', 'Ιωάννινα', 'Κέρκυρα', 'Καβάλα',
- 'Καλαμάτα', 'Καρδίτσα', 'Καρπενήσι', 'Καστοριά', 'Κατερίνη', 'Κιλκίς',
- 'Κοζάνη', 'Κομοτηνή', 'Κόρινθος', 'Λάρισα', 'Λαμία', 'Λευκάδα', 'Λιβαδιά',
- 'Μεσολόγγι', 'Μυτιλήνη', 'Ναύπλιο', 'Ξάνθη', 'Πάτρα', 'Πολύγυρος',
- 'Πρέβεζα', 'Πύργος', 'Ρέθυμνο', 'Ρόδος', 'Σάμος', 'Σέρρες', 'Σπάρτη',
- 'Τρίκαλα', 'Τρίπολη', 'Φλώρινα', 'Χίος', 'Χαλκίδα', 'Χανιά',
+ 'Άμφισσα',
+ 'Άρτα',
+ 'Έδεσσα',
+ 'Αγ. Νικόλαος',
+ 'Αθήνα',
+ 'Αλεξανδρούπολη',
+ 'Αργοστόλι',
+ 'Βέροια',
+ 'Βόλος',
+ 'Γρεβενά',
+ 'Δράμα',
+ 'Ερμούπολη',
+ 'Ζάκυνθος',
+ 'Ηγουμενίτσα',
+ 'Ηράκλειο',
+ 'Θεσσαλονίκη',
+ 'Ιωάννινα',
+ 'Κέρκυρα',
+ 'Καβάλα',
+ 'Καλαμάτα',
+ 'Καρδίτσα',
+ 'Καρπενήσι',
+ 'Καστοριά',
+ 'Κατερίνη',
+ 'Κιλκίς',
+ 'Κοζάνη',
+ 'Κομοτηνή',
+ 'Κόρινθος',
+ 'Λάρισα',
+ 'Λαμία',
+ 'Λευκάδα',
+ 'Λιβαδιά',
+ 'Μεσολόγγι',
+ 'Μυτιλήνη',
+ 'Ναύπλιο',
+ 'Ξάνθη',
+ 'Πάτρα',
+ 'Πολύγυρος',
+ 'Πρέβεζα',
+ 'Πύργος',
+ 'Ρέθυμνο',
+ 'Ρόδος',
+ 'Σάμος',
+ 'Σέρρες',
+ 'Σπάρτη',
+ 'Τρίκαλα',
+ 'Τρίπολη',
+ 'Φλώρινα',
+ 'Χίος',
+ 'Χαλκίδα',
+ 'Χανιά',
)
# Ονόματα νομών
diff --git a/src/libs/faker/providers/address/en/__init__.py b/src/libs/faker/providers/address/en/__init__.py
index ca3bc78..5992c69 100644
--- a/src/libs/faker/providers/address/en/__init__.py
+++ b/src/libs/faker/providers/address/en/__init__.py
@@ -50,5 +50,5 @@ class Provider(AddressProvider):
'Vanuatu', 'Venezuela', 'Vietnam',
'Wallis and Futuna', 'Western Sahara',
'Yemen',
- 'Zambia', 'Zimbabwe'
+ 'Zambia', 'Zimbabwe',
)
diff --git a/src/libs/faker/providers/address/en_AU/__init__.py b/src/libs/faker/providers/address/en_AU/__init__.py
index ac2e2f1..6d22823 100644
--- a/src/libs/faker/providers/address/en_AU/__init__.py
+++ b/src/libs/faker/providers/address/en_AU/__init__.py
@@ -97,7 +97,8 @@ class Provider(AddressProvider):
'7###',
# NT
'08##',
- '09##', )
+ '09##',
+ )
states = ('Australian Capital Territory', 'New South Wales',
'Northern Territory', 'Queensland', 'South Australia',
@@ -108,14 +109,15 @@ class Provider(AddressProvider):
city_formats = ('{{city_prefix}} {{first_name}}{{city_suffix}}',
'{{city_prefix}} {{first_name}}',
'{{first_name}}{{city_suffix}}',
- '{{last_name}}{{city_suffix}}', )
+ '{{last_name}}{{city_suffix}}')
street_name_formats = ('{{first_name}} {{street_suffix}}',
'{{last_name}} {{street_suffix}}')
street_address_formats = (
'{{building_number}} {{street_name}}',
- '{{secondary_address}}\n {{building_number}} {{street_name}}', )
+ '{{secondary_address}}\n {{building_number}} {{street_name}}',
+ )
address_formats = (
"{{street_address}}\n{{city}}, {{state_abbr}}, {{postcode}}", )
@@ -127,7 +129,9 @@ def city_prefix(self):
return self.random_element(self.city_prefixes)
def secondary_address(self):
- return self.numerify(self.random_element(self.secondary_address_formats))
+ return self.numerify(
+ self.random_element(
+ self.secondary_address_formats))
def state(self):
return self.random_element(self.states)
diff --git a/src/libs/faker/providers/address/en_CA/__init__.py b/src/libs/faker/providers/address/en_CA/__init__.py
index a5d180a..66c4b97 100644
--- a/src/libs/faker/providers/address/en_CA/__init__.py
+++ b/src/libs/faker/providers/address/en_CA/__init__.py
@@ -13,54 +13,266 @@ class Provider(AddressProvider):
city_prefixes = ('North', 'East', 'West', 'South', 'New', 'Lake', 'Port')
city_suffixes = (
- 'town', 'ton', 'land', 'ville', 'berg', 'burgh', 'borough', 'bury', 'view', 'port', 'mouth', 'stad', 'furt',
- 'chester', 'mouth', 'fort', 'haven', 'side', 'shire')
+ 'town',
+ 'ton',
+ 'land',
+ 'ville',
+ 'berg',
+ 'burgh',
+ 'borough',
+ 'bury',
+ 'view',
+ 'port',
+ 'mouth',
+ 'stad',
+ 'furt',
+ 'chester',
+ 'mouth',
+ 'fort',
+ 'haven',
+ 'side',
+ 'shire')
building_number_formats = ('#####', '####', '###')
street_suffixes = (
- 'Alley', 'Avenue', 'Branch', 'Bridge', 'Brook', 'Brooks', 'Burg', 'Burgs', 'Bypass', 'Camp', 'Canyon', 'Cape',
- 'Causeway', 'Center', 'Centers', 'Circle', 'Circles', 'Cliff', 'Cliffs', 'Club', 'Common', 'Corner', 'Corners',
- 'Course', 'Court', 'Courts', 'Cove', 'Coves', 'Creek', 'Crescent', 'Crest', 'Crossing', 'Crossroad', 'Curve',
- 'Dale', 'Dam', 'Divide', 'Drive', 'Drive', 'Drives', 'Estate', 'Estates', 'Expressway', 'Extension',
+ 'Alley',
+ 'Avenue',
+ 'Branch',
+ 'Bridge',
+ 'Brook',
+ 'Brooks',
+ 'Burg',
+ 'Burgs',
+ 'Bypass',
+ 'Camp',
+ 'Canyon',
+ 'Cape',
+ 'Causeway',
+ 'Center',
+ 'Centers',
+ 'Circle',
+ 'Circles',
+ 'Cliff',
+ 'Cliffs',
+ 'Club',
+ 'Common',
+ 'Corner',
+ 'Corners',
+ 'Course',
+ 'Court',
+ 'Courts',
+ 'Cove',
+ 'Coves',
+ 'Creek',
+ 'Crescent',
+ 'Crest',
+ 'Crossing',
+ 'Crossroad',
+ 'Curve',
+ 'Dale',
+ 'Dam',
+ 'Divide',
+ 'Drive',
+ 'Drive',
+ 'Drives',
+ 'Estate',
+ 'Estates',
+ 'Expressway',
+ 'Extension',
'Extensions',
- 'Fall', 'Falls', 'Ferry', 'Field', 'Fields', 'Flat', 'Flats', 'Ford', 'Fords', 'Forest', 'Forge', 'Forges',
+ 'Fall',
+ 'Falls',
+ 'Ferry',
+ 'Field',
+ 'Fields',
+ 'Flat',
+ 'Flats',
+ 'Ford',
+ 'Fords',
+ 'Forest',
+ 'Forge',
+ 'Forges',
'Fork',
- 'Forks', 'Fort', 'Freeway', 'Garden', 'Gardens', 'Gateway', 'Glen', 'Glens', 'Green', 'Greens', 'Grove',
+ 'Forks',
+ 'Fort',
+ 'Freeway',
+ 'Garden',
+ 'Gardens',
+ 'Gateway',
+ 'Glen',
+ 'Glens',
+ 'Green',
+ 'Greens',
+ 'Grove',
'Groves',
- 'Harbor', 'Harbors', 'Haven', 'Heights', 'Highway', 'Hill', 'Hills', 'Hollow', 'Inlet', 'Inlet', 'Island',
+ 'Harbor',
+ 'Harbors',
+ 'Haven',
+ 'Heights',
+ 'Highway',
+ 'Hill',
+ 'Hills',
+ 'Hollow',
+ 'Inlet',
+ 'Inlet',
'Island',
- 'Islands', 'Islands', 'Isle', 'Isle', 'Junction', 'Junctions', 'Key', 'Keys', 'Knoll', 'Knolls', 'Lake',
+ 'Island',
+ 'Islands',
+ 'Islands',
+ 'Isle',
+ 'Isle',
+ 'Junction',
+ 'Junctions',
+ 'Key',
+ 'Keys',
+ 'Knoll',
+ 'Knolls',
+ 'Lake',
'Lakes',
- 'Land', 'Landing', 'Lane', 'Light', 'Lights', 'Loaf', 'Lock', 'Locks', 'Locks', 'Lodge', 'Lodge', 'Loop',
+ 'Land',
+ 'Landing',
+ 'Lane',
+ 'Light',
+ 'Lights',
+ 'Loaf',
+ 'Lock',
+ 'Locks',
+ 'Locks',
+ 'Lodge',
+ 'Lodge',
+ 'Loop',
'Mall',
- 'Manor', 'Manors', 'Meadow', 'Meadows', 'Mews', 'Mill', 'Mills', 'Mission', 'Mission', 'Motorway', 'Mount',
- 'Mountain', 'Mountain', 'Mountains', 'Mountains', 'Neck', 'Orchard', 'Oval', 'Overpass', 'Park', 'Parks',
+ 'Manor',
+ 'Manors',
+ 'Meadow',
+ 'Meadows',
+ 'Mews',
+ 'Mill',
+ 'Mills',
+ 'Mission',
+ 'Mission',
+ 'Motorway',
+ 'Mount',
+ 'Mountain',
+ 'Mountain',
+ 'Mountains',
+ 'Mountains',
+ 'Neck',
+ 'Orchard',
+ 'Oval',
+ 'Overpass',
+ 'Park',
+ 'Parks',
'Parkway',
- 'Parkways', 'Pass', 'Passage', 'Path', 'Pike', 'Pine', 'Pines', 'Place', 'Plain', 'Plains', 'Plains', 'Plaza',
- 'Plaza', 'Point', 'Points', 'Port', 'Port', 'Ports', 'Ports', 'Prairie', 'Prairie', 'Radial', 'Ramp', 'Ranch',
- 'Rapid', 'Rapids', 'Rest', 'Ridge', 'Ridges', 'River', 'Road', 'Road', 'Roads', 'Roads', 'Route', 'Row', 'Rue',
- 'Run', 'Shoal', 'Shoals', 'Shore', 'Shores', 'Skyway', 'Spring', 'Springs', 'Springs', 'Spur', 'Spurs',
+ 'Parkways',
+ 'Pass',
+ 'Passage',
+ 'Path',
+ 'Pike',
+ 'Pine',
+ 'Pines',
+ 'Place',
+ 'Plain',
+ 'Plains',
+ 'Plains',
+ 'Plaza',
+ 'Plaza',
+ 'Point',
+ 'Points',
+ 'Port',
+ 'Port',
+ 'Ports',
+ 'Ports',
+ 'Prairie',
+ 'Prairie',
+ 'Radial',
+ 'Ramp',
+ 'Ranch',
+ 'Rapid',
+ 'Rapids',
+ 'Rest',
+ 'Ridge',
+ 'Ridges',
+ 'River',
+ 'Road',
+ 'Road',
+ 'Roads',
+ 'Roads',
+ 'Route',
+ 'Row',
+ 'Rue',
+ 'Run',
+ 'Shoal',
+ 'Shoals',
+ 'Shore',
+ 'Shores',
+ 'Skyway',
+ 'Spring',
+ 'Springs',
+ 'Springs',
+ 'Spur',
+ 'Spurs',
+ 'Square',
'Square',
- 'Square', 'Squares', 'Squares', 'Station', 'Station', 'Stravenue', 'Stravenue', 'Stream', 'Stream', 'Street',
- 'Street', 'Streets', 'Summit', 'Summit', 'Terrace', 'Throughway', 'Trace', 'Track', 'Trafficway', 'Trail',
+ 'Squares',
+ 'Squares',
+ 'Station',
+ 'Station',
+ 'Stravenue',
+ 'Stravenue',
+ 'Stream',
+ 'Stream',
+ 'Street',
+ 'Street',
+ 'Streets',
+ 'Summit',
+ 'Summit',
+ 'Terrace',
+ 'Throughway',
+ 'Trace',
+ 'Track',
+ 'Trafficway',
+ 'Trail',
'Trail',
- 'Tunnel', 'Tunnel', 'Turnpike', 'Turnpike', 'Underpass', 'Union', 'Unions', 'Valley', 'Valleys', 'Via',
+ 'Tunnel',
+ 'Tunnel',
+ 'Turnpike',
+ 'Turnpike',
+ 'Underpass',
+ 'Union',
+ 'Unions',
+ 'Valley',
+ 'Valleys',
+ 'Via',
'Viaduct',
- 'View', 'Views', 'Village', 'Village', 'Villages', 'Ville', 'Vista', 'Vista', 'Walk', 'Walks', 'Wall', 'Way',
- 'Ways', 'Well', 'Wells')
+ 'View',
+ 'Views',
+ 'Village',
+ 'Village',
+ 'Villages',
+ 'Ville',
+ 'Vista',
+ 'Vista',
+ 'Walk',
+ 'Walks',
+ 'Wall',
+ 'Way',
+ 'Ways',
+ 'Well',
+ 'Wells')
postal_code_formats = ('?%? %?%', '?%?%?%')
provinces = (
'Alberta', 'British Columbia', 'Manitoba', 'New Brunswick',
'Newfoundland and Labrador', 'Northwest Territories',
- 'New Brunswick', 'Nova Scotia', 'Nunavut', 'Ontario',
+ 'New Brunswick', 'Nova Scotia', 'Nunavut', 'Ontario',
'Prince Edward Island', 'Quebec', 'Saskatchewan', 'Yukon Territory')
provinces_abbr = (
'AB', 'BC', 'MB', 'NB', 'NL', 'NT', 'NS',
- 'NV', 'ON', 'PE', 'QC', 'SK', 'YT')
+ 'NU', 'ON', 'PE', 'QC', 'SK', 'YT')
city_formats = (
'{{city_prefix}} {{first_name}}{{city_suffix}}',
@@ -70,7 +282,7 @@ class Provider(AddressProvider):
)
street_name_formats = (
'{{first_name}} {{street_suffix}}',
- '{{last_name}} {{street_suffix}}'
+ '{{last_name}} {{street_suffix}}',
)
street_address_formats = (
'{{building_number}} {{street_name}}',
@@ -93,7 +305,9 @@ def city_prefix(self):
return self.random_element(self.city_prefixes)
def secondary_address(self):
- return self.numerify(self.random_element(self.secondary_address_formats))
+ return self.numerify(
+ self.random_element(
+ self.secondary_address_formats))
def postal_code_letter(self):
"""
@@ -102,13 +316,16 @@ def postal_code_letter(self):
"""
return self.random_element(self.postal_code_letters)
- def postalcode(self):
+ def postcode(self):
"""
Replaces all question mark ('?') occurrences with a random letter
from postal_code_formats then passes result to
numerify to insert numbers
"""
temp = re.sub(r'\?',
- lambda x: self.postal_code_letter(),
- self.random_element(self.postal_code_formats))
+ lambda x: self.postal_code_letter(),
+ self.random_element(self.postal_code_formats))
return self.numerify(temp)
+
+ def postalcode(self):
+ return self.postcode()
diff --git a/src/libs/faker/providers/address/en_GB/__init__.py b/src/libs/faker/providers/address/en_GB/__init__.py
index 3e81e13..262968b 100644
--- a/src/libs/faker/providers/address/en_GB/__init__.py
+++ b/src/libs/faker/providers/address/en_GB/__init__.py
@@ -7,56 +7,268 @@
class Provider(AddressProvider):
city_prefixes = ('North', 'East', 'West', 'South', 'New', 'Lake', 'Port')
city_suffixes = (
- 'town', 'ton', 'land', 'ville', 'berg', 'burgh', 'borough', 'bury', 'view', 'port', 'mouth', 'stad', 'furt',
- 'chester', 'mouth', 'fort', 'haven', 'side', 'shire',
+ 'town',
+ 'ton',
+ 'land',
+ 'ville',
+ 'berg',
+ 'burgh',
+ 'borough',
+ 'bury',
+ 'view',
+ 'port',
+ 'mouth',
+ 'stad',
+ 'furt',
+ 'chester',
+ 'mouth',
+ 'fort',
+ 'haven',
+ 'side',
+ 'shire',
)
building_number_formats = ('#', '##', '###')
street_suffixes = (
- 'alley', 'avenue', 'branch', 'bridge', 'brook', 'brooks', 'burg', 'burgs', 'bypass', 'camp', 'canyon', 'cape',
- 'causeway', 'center', 'centers', 'circle', 'circles', 'cliff', 'cliffs', 'club', 'common', 'corner', 'corners',
- 'course', 'court', 'courts', 'cove', 'coves', 'creek', 'crescent', 'crest', 'crossing', 'crossroad', 'curve',
- 'dale', 'dam', 'divide', 'drive', 'drive', 'drives', 'estate', 'estates', 'expressway', 'extension',
+ 'alley',
+ 'avenue',
+ 'branch',
+ 'bridge',
+ 'brook',
+ 'brooks',
+ 'burg',
+ 'burgs',
+ 'bypass',
+ 'camp',
+ 'canyon',
+ 'cape',
+ 'causeway',
+ 'center',
+ 'centers',
+ 'circle',
+ 'circles',
+ 'cliff',
+ 'cliffs',
+ 'club',
+ 'common',
+ 'corner',
+ 'corners',
+ 'course',
+ 'court',
+ 'courts',
+ 'cove',
+ 'coves',
+ 'creek',
+ 'crescent',
+ 'crest',
+ 'crossing',
+ 'crossroad',
+ 'curve',
+ 'dale',
+ 'dam',
+ 'divide',
+ 'drive',
+ 'drive',
+ 'drives',
+ 'estate',
+ 'estates',
+ 'expressway',
+ 'extension',
'extensions',
- 'fall', 'falls', 'ferry', 'field', 'fields', 'flat', 'flats', 'ford', 'fords', 'forest', 'forge', 'forges',
+ 'fall',
+ 'falls',
+ 'ferry',
+ 'field',
+ 'fields',
+ 'flat',
+ 'flats',
+ 'ford',
+ 'fords',
+ 'forest',
+ 'forge',
+ 'forges',
'fork',
- 'forks', 'fort', 'freeway', 'garden', 'gardens', 'gateway', 'glen', 'glens', 'green', 'greens', 'grove',
+ 'forks',
+ 'fort',
+ 'freeway',
+ 'garden',
+ 'gardens',
+ 'gateway',
+ 'glen',
+ 'glens',
+ 'green',
+ 'greens',
+ 'grove',
'groves',
- 'harbor', 'harbors', 'haven', 'heights', 'highway', 'hill', 'hills', 'hollow', 'inlet', 'inlet', 'island',
+ 'harbor',
+ 'harbors',
+ 'haven',
+ 'heights',
+ 'highway',
+ 'hill',
+ 'hills',
+ 'hollow',
+ 'inlet',
+ 'inlet',
'island',
- 'islands', 'islands', 'isle', 'isle', 'junction', 'junctions', 'key', 'keys', 'knoll', 'knolls', 'lake',
+ 'island',
+ 'islands',
+ 'islands',
+ 'isle',
+ 'isle',
+ 'junction',
+ 'junctions',
+ 'key',
+ 'keys',
+ 'knoll',
+ 'knolls',
+ 'lake',
'lakes',
- 'land', 'landing', 'lane', 'light', 'lights', 'loaf', 'lock', 'locks', 'locks', 'lodge', 'lodge', 'loop',
+ 'land',
+ 'landing',
+ 'lane',
+ 'light',
+ 'lights',
+ 'loaf',
+ 'lock',
+ 'locks',
+ 'locks',
+ 'lodge',
+ 'lodge',
+ 'loop',
'mall',
- 'manor', 'manors', 'meadow', 'meadows', 'mews', 'mill', 'mills', 'mission', 'mission', 'motorway', 'mount',
- 'mountain', 'mountain', 'mountains', 'mountains', 'neck', 'orchard', 'oval', 'overpass', 'park', 'parks',
+ 'manor',
+ 'manors',
+ 'meadow',
+ 'meadows',
+ 'mews',
+ 'mill',
+ 'mills',
+ 'mission',
+ 'mission',
+ 'motorway',
+ 'mount',
+ 'mountain',
+ 'mountain',
+ 'mountains',
+ 'mountains',
+ 'neck',
+ 'orchard',
+ 'oval',
+ 'overpass',
+ 'park',
+ 'parks',
'parkway',
- 'parkways', 'pass', 'passage', 'path', 'pike', 'pine', 'pines', 'place', 'plain', 'plains', 'plains', 'plaza',
- 'plaza', 'point', 'points', 'port', 'port', 'ports', 'ports', 'prairie', 'prairie', 'radial', 'ramp', 'ranch',
- 'rapid', 'rapids', 'rest', 'ridge', 'ridges', 'river', 'road', 'road', 'roads', 'roads', 'route', 'row', 'rue',
- 'run', 'shoal', 'shoals', 'shore', 'shores', 'skyway', 'spring', 'springs', 'springs', 'spur', 'spurs',
+ 'parkways',
+ 'pass',
+ 'passage',
+ 'path',
+ 'pike',
+ 'pine',
+ 'pines',
+ 'place',
+ 'plain',
+ 'plains',
+ 'plains',
+ 'plaza',
+ 'plaza',
+ 'point',
+ 'points',
+ 'port',
+ 'port',
+ 'ports',
+ 'ports',
+ 'prairie',
+ 'prairie',
+ 'radial',
+ 'ramp',
+ 'ranch',
+ 'rapid',
+ 'rapids',
+ 'rest',
+ 'ridge',
+ 'ridges',
+ 'river',
+ 'road',
+ 'road',
+ 'roads',
+ 'roads',
+ 'route',
+ 'row',
+ 'rue',
+ 'run',
+ 'shoal',
+ 'shoals',
+ 'shore',
+ 'shores',
+ 'skyway',
+ 'spring',
+ 'springs',
+ 'springs',
+ 'spur',
+ 'spurs',
+ 'square',
'square',
- 'square', 'squares', 'squares', 'station', 'station', 'stravenue', 'stravenue', 'stream', 'stream', 'street',
- 'street', 'streets', 'summit', 'summit', 'terrace', 'throughway', 'trace', 'track', 'trafficway', 'trail',
+ 'squares',
+ 'squares',
+ 'station',
+ 'station',
+ 'stravenue',
+ 'stravenue',
+ 'stream',
+ 'stream',
+ 'street',
+ 'street',
+ 'streets',
+ 'summit',
+ 'summit',
+ 'terrace',
+ 'throughway',
+ 'trace',
+ 'track',
+ 'trafficway',
+ 'trail',
'trail',
- 'tunnel', 'tunnel', 'turnpike', 'turnpike', 'underpass', 'union', 'unions', 'valley', 'valleys', 'via',
+ 'tunnel',
+ 'tunnel',
+ 'turnpike',
+ 'turnpike',
+ 'underpass',
+ 'union',
+ 'unions',
+ 'valley',
+ 'valleys',
+ 'via',
'viaduct',
- 'view', 'views', 'village', 'village', 'villages', 'ville', 'vista', 'vista', 'walk', 'walks', 'wall', 'way',
- 'ways', 'well', 'wells')
+ 'view',
+ 'views',
+ 'village',
+ 'village',
+ 'villages',
+ 'ville',
+ 'vista',
+ 'vista',
+ 'walk',
+ 'walks',
+ 'wall',
+ 'way',
+ 'ways',
+ 'well',
+ 'wells')
POSTAL_ZONES = (
- 'AB', 'AL', 'B' , 'BA', 'BB', 'BD', 'BH', 'BL', 'BN', 'BR',
+ 'AB', 'AL', 'B', 'BA', 'BB', 'BD', 'BH', 'BL', 'BN', 'BR',
'BS', 'BT', 'CA', 'CB', 'CF', 'CH', 'CM', 'CO', 'CR', 'CT',
'CV', 'CW', 'DA', 'DD', 'DE', 'DG', 'DH', 'DL', 'DN', 'DT',
- 'DY', 'E' , 'EC', 'EH', 'EN', 'EX', 'FK', 'FY', 'G' , 'GL',
+ 'DY', 'E', 'EC', 'EH', 'EN', 'EX', 'FK', 'FY', 'G', 'GL',
'GY', 'GU', 'HA', 'HD', 'HG', 'HP', 'HR', 'HS', 'HU', 'HX',
- 'IG', 'IM', 'IP', 'IV', 'JE', 'KA', 'KT', 'KW', 'KY', 'L' ,
- 'LA', 'LD', 'LE', 'LL', 'LN', 'LS', 'LU', 'M' , 'ME', 'MK',
- 'ML', 'N' , 'NE', 'NG', 'NN', 'NP', 'NR', 'NW', 'OL', 'OX',
- 'PA', 'PE', 'PH', 'PL', 'PO', 'PR', 'RG', 'RH', 'RM', 'S' ,
+ 'IG', 'IM', 'IP', 'IV', 'JE', 'KA', 'KT', 'KW', 'KY', 'L',
+ 'LA', 'LD', 'LE', 'LL', 'LN', 'LS', 'LU', 'M', 'ME', 'MK',
+ 'ML', 'N', 'NE', 'NG', 'NN', 'NP', 'NR', 'NW', 'OL', 'OX',
+ 'PA', 'PE', 'PH', 'PL', 'PO', 'PR', 'RG', 'RH', 'RM', 'S',
'SA', 'SE', 'SG', 'SK', 'SL', 'SM', 'SN', 'SO', 'SP', 'SR',
'SS', 'ST', 'SW', 'SY', 'TA', 'TD', 'TF', 'TN', 'TQ', 'TR',
- 'TS', 'TW', 'UB', 'W' , 'WA', 'WC', 'WD', 'WF', 'WN', 'WR',
- 'WS', 'WV', 'YO', 'ZE'
+ 'TS', 'TW', 'UB', 'W', 'WA', 'WC', 'WD', 'WF', 'WN', 'WR',
+ 'WS', 'WV', 'YO', 'ZE',
)
POSTAL_ZONES_ONE_CHAR = [zone for zone in POSTAL_ZONES if len(zone) == 1]
@@ -90,7 +302,7 @@ class Provider(AddressProvider):
)
street_name_formats = (
'{{first_name}} {{street_suffix}}',
- '{{last_name}} {{street_suffix}}'
+ '{{last_name}} {{street_suffix}}',
)
street_address_formats = (
'{{building_number}} {{street_name}}',
@@ -99,11 +311,13 @@ class Provider(AddressProvider):
address_formats = (
"{{street_address}}\n{{city}}\n{{postcode}}",
)
- secondary_address_formats = ('Flat #', 'Flat ##', 'Flat ##?', 'Studio #', 'Studio ##', 'Studio ##?')
+ secondary_address_formats = (
+ 'Flat #', 'Flat ##', 'Flat ##?', 'Studio #', 'Studio ##', 'Studio ##?')
def postcode(self):
"""
- See http://web.archive.org/web/20090930140939/http://www.govtalk.gov.uk/gdsc/html/noframes/PostCode-2-1-Release.htm
+ See
+ http://web.archive.org/web/20090930140939/http://www.govtalk.gov.uk/gdsc/html/noframes/PostCode-2-1-Release.htm
"""
postcode = ''
pattern = self.random_element(self.postcode_formats)
diff --git a/src/libs/faker/providers/address/en_NZ/__init__.py b/src/libs/faker/providers/address/en_NZ/__init__.py
new file mode 100644
index 0000000..6989698
--- /dev/null
+++ b/src/libs/faker/providers/address/en_NZ/__init__.py
@@ -0,0 +1,254 @@
+# -*- coding: utf-8 -*-
+from __future__ import unicode_literals
+from ..en import Provider as AddressProvider
+
+
+class Provider(AddressProvider):
+
+ city_prefixes = (
+ 'North',
+ 'East',
+ 'West',
+ 'South',
+ 'New',
+ 'Lake',
+ 'Port',
+ 'Upper',
+ 'Lower',
+ 'High',
+ 'Mount',
+ )
+
+ city_suffixes = (
+ 'town', 'ton', 'land', 'ville', 'berg', 'burgh',
+ 'borough', 'bury', 'burn', 'ing', 'port', 'mouth', 'stone', 'ings'
+ 'mouth', 'fort', 'haven', 'leigh', 'side', 'gate', 'neath', 'side',
+ ' Flats', ' Hill',
+ )
+
+ building_number_formats = ('%##', '%#', '%')
+
+ street_suffixes = (
+ # Most common:
+ 'Arcade', 'Arcade', 'Arcade',
+ 'Avenue', 'Avenue', 'Avenue', 'Avenue',
+ 'Avenue', 'Avenue', 'Avenue', 'Avenue',
+ 'Beach Road', 'Beach Road', 'Beach Road', 'Beach Road',
+ 'Crescent', 'Crescent', 'Crescent', 'Crescent', 'Crescent',
+ 'Drive', 'Drive', 'Drive', 'Drive',
+ 'Mews', 'Mews', 'Mews',
+ 'Place', 'Place', 'Place', 'Place',
+ 'Range Road', 'Range Road',
+ 'Road', 'Road', 'Road', 'Road', 'Road', 'Road', 'Road', 'Road', 'Road',
+ 'Street', 'Street', 'Street', 'Street', 'Street', 'Street', 'Street',
+ 'Street', 'Street', 'Street', 'Street', 'Street', 'Street', 'Street',
+ 'Street', 'Street', 'Street', 'Street', 'Street', 'Street', 'Street',
+ 'Terrace', 'Terrace', 'Terrace',
+ 'Way', 'Way', 'Way',
+
+ # Other:
+ 'Access', 'Alley', 'Alleyway', 'Amble', 'Anchorage', 'Approach',
+ 'Broadway', 'Bypass', 'Causeway', 'Centre',
+ 'Circle', 'Circuit', 'Close', 'Concourse', 'Copse', 'Corner', 'Court',
+ 'Cove',
+ 'Crest', 'Cross', 'Crossing',
+ 'Cutting',
+ 'Esplanade',
+ 'Flats',
+ 'Gardens', 'Grove', 'Heights', 'Highway',
+ 'Lane', 'Line', 'Keys',
+ 'Parade', 'Park', 'Pass',
+ 'Plaza',
+ 'Point', 'Quay',
+ 'Reserve',
+ 'Ridge',
+ 'Rise',
+ 'Square',
+ 'Track', 'Trail',
+ 'View',
+ )
+
+ # Māori nouns commonly present in placenames.
+ te_reo_parts = (
+ 'ara',
+ 'awa',
+ 'horo',
+ 'kawa',
+ 'koro',
+ 'kowhai',
+ 'manawa',
+ 'mata',
+ 'maunga',
+ 'moko',
+ 'motu',
+ 'ngauru',
+ 'pa'
+ 'papa',
+ 'po',
+ 'puke',
+ 'rangi',
+ 'rohe',
+ 'rongo',
+ 'roto',
+ 'tahi',
+ 'tai',
+ 'tangi',
+ 'tau',
+ 'tere',
+ 'tipu',
+ 'wai',
+ 'waka',
+ 'whaka',
+ 'whanga',
+ 'whare',
+ 'weka',
+ )
+
+ # Māori endings (usually adjectives) commonly present in placenames.
+ te_reo_endings = (
+ 'hanga',
+ 'hope',
+ 'iti',
+ 'iti',
+ 'kiwi',
+ 'makau',
+ 'nui',
+ 'nui',
+ 'nui',
+ 'nuku',
+ 'roa',
+ 'rua',
+ 'tanga',
+ 'tapu',
+ 'toa',
+ 'whenua',
+ 'whero',
+ 'whitu',
+ )
+
+ postcode_formats = (
+ # as per https://en.wikipedia.org/wiki/Postcodes_in_New_Zealand
+ # Northland
+ '0%##',
+ # Auckland
+ '1###',
+ '20##',
+ '21##',
+ '22##',
+ '23##',
+ '24##',
+ '25##',
+ '26##',
+ # Central North Island
+ '3###',
+ '4###',
+ # Lower North Island
+ '50##',
+ '51##',
+ '52##',
+ '53##',
+ '55##',
+ '57##',
+ '58##',
+ # Wellington
+ '60##',
+ '61##',
+ '62##',
+ '64##',
+ '69##',
+ # Upper South Island
+ '7###',
+ # Christchurch
+ '80##',
+ '81##',
+ '82##',
+ '84##',
+ '85##',
+ '86##',
+ '88##',
+ '89##',
+ # Southland
+ '90##',
+ '92##',
+ '93##',
+ '94##',
+ '95##',
+ '96##',
+ '97##',
+ '98##',
+ )
+
+ city_formats = (
+ '{{first_name}}{{city_suffix}}',
+ '{{last_name}}{{city_suffix}}',
+ '{{last_name}}{{city_suffix}}',
+ '{{last_name}}{{city_suffix}}',
+ '{{last_name}}{{city_suffix}}',
+ '{{last_name}}{{city_suffix}}',
+ '{{city_prefix}} {{last_name}}{{city_suffix}}',
+ '{{te_reo_first}}{{te_reo_ending}}',
+ '{{te_reo_first}}{{te_reo_ending}}',
+ '{{te_reo_first}}{{te_reo_ending}}',
+ '{{te_reo_first}}{{te_reo_ending}}',
+ '{{te_reo_first}}{{te_reo_part}}{{te_reo_ending}}',
+ '{{te_reo_first}}{{te_reo_part}}{{te_reo_ending}}',
+ )
+
+ street_name_formats = (
+ '{{first_name}} {{street_suffix}}',
+ '{{last_name}} {{street_suffix}}',
+ '{{last_name}} {{street_suffix}}',
+ '{{last_name}} {{street_suffix}}',
+ '{{last_name}}-{{last_name}} {{street_suffix}}',
+ '{{te_reo_first}}{{te_reo_ending}} {{street_suffix}}',
+ '{{te_reo_first}}{{te_reo_ending}} {{street_suffix}}',
+ '{{te_reo_first}}{{te_reo_part}}{{te_reo_ending}} {{street_suffix}}',
+ )
+
+ street_address_formats = (
+ '{{building_number}} {{street_name}}',
+ '{{building_number}} {{street_name}}',
+ '{{building_number}} {{street_name}}',
+ '{{building_number}} {{street_name}}\nRD {{rd_number}}',
+ '{{secondary_address}}\n{{building_number}} {{street_name}}',
+ 'PO Box {{building_number}}',
+ )
+
+ address_formats = (
+ "{{street_address}}\n{{city}} {{postcode}}",
+ )
+
+ secondary_address_formats = (
+ 'Apt. %##',
+ 'Flat %#',
+ 'Suite %##',
+ 'Unit %#',
+ 'Level %',
+ )
+
+ def state(self):
+ # New Zealand does not have states.
+ return ''
+
+ def te_reo_part(self):
+ return self.random_element(self.te_reo_parts)
+
+ def te_reo_first(self):
+ return self.random_element(self.te_reo_parts).capitalize()
+
+ def te_reo_ending(self):
+ return self.random_element(self.te_reo_parts + self.te_reo_endings)
+
+ def city_prefix(self):
+ return self.random_element(self.city_prefixes)
+
+ def city_suffix(self):
+ return self.random_element(self.city_suffixes)
+
+ def rd_number(self):
+ return self.random_element([str(i) for i in range(1, 11)])
+
+ def secondary_address(self):
+ return self.numerify(
+ self.random_element(
+ self.secondary_address_formats))
diff --git a/src/libs/faker/providers/address/en_US/__init__.py b/src/libs/faker/providers/address/en_US/__init__.py
index 8520ccf..3e15a83 100644
--- a/src/libs/faker/providers/address/en_US/__init__.py
+++ b/src/libs/faker/providers/address/en_US/__init__.py
@@ -8,42 +8,254 @@ class Provider(AddressProvider):
city_prefixes = ('North', 'East', 'West', 'South', 'New', 'Lake', 'Port')
city_suffixes = (
- 'town', 'ton', 'land', 'ville', 'berg', 'burgh', 'borough', 'bury', 'view', 'port', 'mouth', 'stad', 'furt',
- 'chester', 'mouth', 'fort', 'haven', 'side', 'shire')
+ 'town',
+ 'ton',
+ 'land',
+ 'ville',
+ 'berg',
+ 'burgh',
+ 'borough',
+ 'bury',
+ 'view',
+ 'port',
+ 'mouth',
+ 'stad',
+ 'furt',
+ 'chester',
+ 'mouth',
+ 'fort',
+ 'haven',
+ 'side',
+ 'shire')
building_number_formats = ('#####', '####', '###')
street_suffixes = (
- 'Alley', 'Avenue', 'Branch', 'Bridge', 'Brook', 'Brooks', 'Burg', 'Burgs', 'Bypass', 'Camp', 'Canyon', 'Cape',
- 'Causeway', 'Center', 'Centers', 'Circle', 'Circles', 'Cliff', 'Cliffs', 'Club', 'Common', 'Corner', 'Corners',
- 'Course', 'Court', 'Courts', 'Cove', 'Coves', 'Creek', 'Crescent', 'Crest', 'Crossing', 'Crossroad', 'Curve',
- 'Dale', 'Dam', 'Divide', 'Drive', 'Drive', 'Drives', 'Estate', 'Estates', 'Expressway', 'Extension',
+ 'Alley',
+ 'Avenue',
+ 'Branch',
+ 'Bridge',
+ 'Brook',
+ 'Brooks',
+ 'Burg',
+ 'Burgs',
+ 'Bypass',
+ 'Camp',
+ 'Canyon',
+ 'Cape',
+ 'Causeway',
+ 'Center',
+ 'Centers',
+ 'Circle',
+ 'Circles',
+ 'Cliff',
+ 'Cliffs',
+ 'Club',
+ 'Common',
+ 'Corner',
+ 'Corners',
+ 'Course',
+ 'Court',
+ 'Courts',
+ 'Cove',
+ 'Coves',
+ 'Creek',
+ 'Crescent',
+ 'Crest',
+ 'Crossing',
+ 'Crossroad',
+ 'Curve',
+ 'Dale',
+ 'Dam',
+ 'Divide',
+ 'Drive',
+ 'Drive',
+ 'Drives',
+ 'Estate',
+ 'Estates',
+ 'Expressway',
+ 'Extension',
'Extensions',
- 'Fall', 'Falls', 'Ferry', 'Field', 'Fields', 'Flat', 'Flats', 'Ford', 'Fords', 'Forest', 'Forge', 'Forges',
+ 'Fall',
+ 'Falls',
+ 'Ferry',
+ 'Field',
+ 'Fields',
+ 'Flat',
+ 'Flats',
+ 'Ford',
+ 'Fords',
+ 'Forest',
+ 'Forge',
+ 'Forges',
'Fork',
- 'Forks', 'Fort', 'Freeway', 'Garden', 'Gardens', 'Gateway', 'Glen', 'Glens', 'Green', 'Greens', 'Grove',
+ 'Forks',
+ 'Fort',
+ 'Freeway',
+ 'Garden',
+ 'Gardens',
+ 'Gateway',
+ 'Glen',
+ 'Glens',
+ 'Green',
+ 'Greens',
+ 'Grove',
'Groves',
- 'Harbor', 'Harbors', 'Haven', 'Heights', 'Highway', 'Hill', 'Hills', 'Hollow', 'Inlet', 'Inlet', 'Island',
+ 'Harbor',
+ 'Harbors',
+ 'Haven',
+ 'Heights',
+ 'Highway',
+ 'Hill',
+ 'Hills',
+ 'Hollow',
+ 'Inlet',
+ 'Inlet',
'Island',
- 'Islands', 'Islands', 'Isle', 'Isle', 'Junction', 'Junctions', 'Key', 'Keys', 'Knoll', 'Knolls', 'Lake',
+ 'Island',
+ 'Islands',
+ 'Islands',
+ 'Isle',
+ 'Isle',
+ 'Junction',
+ 'Junctions',
+ 'Key',
+ 'Keys',
+ 'Knoll',
+ 'Knolls',
+ 'Lake',
'Lakes',
- 'Land', 'Landing', 'Lane', 'Light', 'Lights', 'Loaf', 'Lock', 'Locks', 'Locks', 'Lodge', 'Lodge', 'Loop',
+ 'Land',
+ 'Landing',
+ 'Lane',
+ 'Light',
+ 'Lights',
+ 'Loaf',
+ 'Lock',
+ 'Locks',
+ 'Locks',
+ 'Lodge',
+ 'Lodge',
+ 'Loop',
'Mall',
- 'Manor', 'Manors', 'Meadow', 'Meadows', 'Mews', 'Mill', 'Mills', 'Mission', 'Mission', 'Motorway', 'Mount',
- 'Mountain', 'Mountain', 'Mountains', 'Mountains', 'Neck', 'Orchard', 'Oval', 'Overpass', 'Park', 'Parks',
+ 'Manor',
+ 'Manors',
+ 'Meadow',
+ 'Meadows',
+ 'Mews',
+ 'Mill',
+ 'Mills',
+ 'Mission',
+ 'Mission',
+ 'Motorway',
+ 'Mount',
+ 'Mountain',
+ 'Mountain',
+ 'Mountains',
+ 'Mountains',
+ 'Neck',
+ 'Orchard',
+ 'Oval',
+ 'Overpass',
+ 'Park',
+ 'Parks',
'Parkway',
- 'Parkways', 'Pass', 'Passage', 'Path', 'Pike', 'Pine', 'Pines', 'Place', 'Plain', 'Plains', 'Plains', 'Plaza',
- 'Plaza', 'Point', 'Points', 'Port', 'Port', 'Ports', 'Ports', 'Prairie', 'Prairie', 'Radial', 'Ramp', 'Ranch',
- 'Rapid', 'Rapids', 'Rest', 'Ridge', 'Ridges', 'River', 'Road', 'Road', 'Roads', 'Roads', 'Route', 'Row', 'Rue',
- 'Run', 'Shoal', 'Shoals', 'Shore', 'Shores', 'Skyway', 'Spring', 'Springs', 'Springs', 'Spur', 'Spurs',
+ 'Parkways',
+ 'Pass',
+ 'Passage',
+ 'Path',
+ 'Pike',
+ 'Pine',
+ 'Pines',
+ 'Place',
+ 'Plain',
+ 'Plains',
+ 'Plains',
+ 'Plaza',
+ 'Plaza',
+ 'Point',
+ 'Points',
+ 'Port',
+ 'Port',
+ 'Ports',
+ 'Ports',
+ 'Prairie',
+ 'Prairie',
+ 'Radial',
+ 'Ramp',
+ 'Ranch',
+ 'Rapid',
+ 'Rapids',
+ 'Rest',
+ 'Ridge',
+ 'Ridges',
+ 'River',
+ 'Road',
+ 'Road',
+ 'Roads',
+ 'Roads',
+ 'Route',
+ 'Row',
+ 'Rue',
+ 'Run',
+ 'Shoal',
+ 'Shoals',
+ 'Shore',
+ 'Shores',
+ 'Skyway',
+ 'Spring',
+ 'Springs',
+ 'Springs',
+ 'Spur',
+ 'Spurs',
+ 'Square',
'Square',
- 'Square', 'Squares', 'Squares', 'Station', 'Station', 'Stravenue', 'Stravenue', 'Stream', 'Stream', 'Street',
- 'Street', 'Streets', 'Summit', 'Summit', 'Terrace', 'Throughway', 'Trace', 'Track', 'Trafficway', 'Trail',
+ 'Squares',
+ 'Squares',
+ 'Station',
+ 'Station',
+ 'Stravenue',
+ 'Stravenue',
+ 'Stream',
+ 'Stream',
+ 'Street',
+ 'Street',
+ 'Streets',
+ 'Summit',
+ 'Summit',
+ 'Terrace',
+ 'Throughway',
+ 'Trace',
+ 'Track',
+ 'Trafficway',
+ 'Trail',
'Trail',
- 'Tunnel', 'Tunnel', 'Turnpike', 'Turnpike', 'Underpass', 'Union', 'Unions', 'Valley', 'Valleys', 'Via',
+ 'Tunnel',
+ 'Tunnel',
+ 'Turnpike',
+ 'Turnpike',
+ 'Underpass',
+ 'Union',
+ 'Unions',
+ 'Valley',
+ 'Valleys',
+ 'Via',
'Viaduct',
- 'View', 'Views', 'Village', 'Village', 'Villages', 'Ville', 'Vista', 'Vista', 'Walk', 'Walks', 'Wall', 'Way',
- 'Ways', 'Well', 'Wells')
+ 'View',
+ 'Views',
+ 'Village',
+ 'Village',
+ 'Villages',
+ 'Ville',
+ 'Vista',
+ 'Vista',
+ 'Walk',
+ 'Walks',
+ 'Wall',
+ 'Way',
+ 'Ways',
+ 'Well',
+ 'Wells')
postcode_formats = ('#####', '#####-####')
@@ -60,13 +272,39 @@ class Provider(AddressProvider):
'West Virginia', 'Wisconsin', 'Wyoming',
)
states_abbr = (
- 'AL', 'AK', 'AS', 'AZ', 'AR', 'CA', 'CO', 'CT', 'DE', 'DC', 'FM', 'FL',
- 'GA', 'GU', 'HI', 'ID', 'IL', 'IN', 'IA', 'KS', 'KY', 'LA', 'ME', 'MH',
- 'MD', 'MA', 'MI', 'MN', 'MS', 'MO', 'MT', 'NE', 'NV', 'NH', 'NJ', 'NM',
- 'NY', 'NC', 'ND', 'MP', 'OH', 'OK', 'OR', 'PW', 'PA', 'PR', 'RI', 'SC',
- 'SD', 'TN', 'TX', 'UT', 'VT', 'VI', 'VA', 'WA', 'WV', 'WI', 'WY',
+ 'AL', 'AK', 'AZ', 'AR', 'CA', 'CO', 'CT', 'DE', 'DC', 'FL', 'GA', 'HI',
+ 'ID', 'IL', 'IN', 'IA', 'KS', 'KY', 'LA', 'ME', 'MD', 'MA', 'MI', 'MN',
+ 'MS', 'MO', 'MT', 'NE', 'NV', 'NH', 'NJ', 'NM', 'NY', 'NC', 'ND', 'OH',
+ 'OK', 'OR', 'PA', 'RI', 'SC', 'SD', 'TN', 'TX', 'UT', 'VT', 'VA', 'WA',
+ 'WV', 'WI', 'WY',
+ )
+
+ states_postcode = {
+ 'AL': (35004, 36925), 'AK': (99501, 99950), 'AZ': (85001, 86556),
+ 'AR': (71601, 72959), 'CA': (90001, 96162), 'CO': (80001, 81658),
+ 'CT': (6001, 6389), 'DE': (19701, 19980), 'DC': (20001, 20039),
+ 'FL': (32004, 34997), 'GA': (30001, 31999), 'HI': (96701, 96898),
+ 'ID': (83201, 83876), 'IL': (60001, 62999), 'IN': (46001, 47997),
+ 'IA': (50001, 52809), 'KS': (66002, 67954), 'KY': (40003, 42788),
+ 'LA': (70001, 71232), 'ME': (3901, 4992), 'MD': (20331, 20331),
+ 'MA': (1001, 2791), 'MI': (48001, 49971), 'MN': (55001, 56763),
+ 'MS': (38601, 39776), 'MO': (63001, 65899), 'MT': (59001, 59937),
+ 'NE': (68001, 68118), 'NV': (88901, 89883), 'NH': (3031, 3897),
+ 'NJ': (7001, 8989), 'NM': (87001, 88441), 'NY': (6390, 6390),
+ 'NC': (27006, 28909), 'ND': (58001, 58856), 'OH': (43001, 45999),
+ 'OK': (73001, 73199), 'OR': (97001, 97920), 'PA': (15001, 19640),
+ 'RI': (2801, 2940), 'SC': (29001, 29948), 'SD': (57001, 57799),
+ 'TN': (37010, 38589), 'TX': (73301, 73301), 'UT': (84001, 84784),
+ 'VT': (5001, 5495), 'VA': (20040, 20041), 'WA': (98001, 99403),
+ 'WV': (24701, 26886), 'WI': (53001, 54990), 'WY': (82001, 83128),
+ }
+
+ territories_abbr = (
+ 'AS', 'FM', 'GU', 'MH', 'MP', 'PW', 'PR', 'VI',
)
+ states_and_territories_abbr = states_abbr + territories_abbr
+
military_state_abbr = ('AE', 'AA', 'AP')
military_ship_prefix = ('USS', 'USNS', 'USNV', 'USCGC')
@@ -84,7 +322,7 @@ class Provider(AddressProvider):
street_name_formats = (
'{{first_name}} {{street_suffix}}',
- '{{last_name}} {{street_suffix}}'
+ '{{last_name}} {{street_suffix}}',
)
street_address_formats = (
@@ -110,19 +348,52 @@ def city_prefix(self):
return self.random_element(self.city_prefixes)
def secondary_address(self):
- return self.numerify(self.random_element(self.secondary_address_formats))
+ return self.numerify(
+ self.random_element(
+ self.secondary_address_formats))
def state(self):
return self.random_element(self.states)
- def state_abbr(self):
+ def state_abbr(self, include_territories=True):
+ """
+ :returns: A random state or territory abbreviation.
+
+ :param include_territories: If True, territories will be included.
+ If False, only states will be returned.
+ """
+ if include_territories:
+ self.random_element(self.states_and_territories_abbr)
return self.random_element(self.states_abbr)
- def zipcode(self):
+ def postcode(self):
return "%05d" % self.generator.random.randint(501, 99950)
def zipcode_plus4(self):
- return "%s-%04d" % (self.zipcode(), self.generator.random.randint(1, 9999))
+ return "%s-%04d" % (self.zipcode(),
+ self.generator.random.randint(1, 9999))
+
+ def postcode_in_state(self, state_abbr=None):
+ """
+ :returns: A random postcode within the provided state abbreviation
+
+ :param state_abbr: A state abbreviation
+ """
+ if state_abbr is None:
+ state_abbr = self.random_element(self.states_abbr)
+
+ if state_abbr in self.states_abbr:
+ postcode = "%d" % (self.generator.random.randint(
+ self.states_postcode[state_abbr][0],
+ self.states_postcode[state_abbr][1]))
+
+ if len(postcode) == 4:
+ postcode = "0%s" % postcode
+
+ return postcode
+
+ else:
+ raise Exception('State Abbreviation not found in list')
def military_ship(self):
"""
@@ -149,8 +420,17 @@ def military_dpo(self):
return self.numerify(self.military_dpo_format)
# Aliases
+ def zipcode(self):
+ return self.postcode()
+
+ def zipcode_in_state(self, state_abbr=None):
+ return self.postcode_in_state(state_abbr)
+
def postalcode(self):
- return self.zipcode()
+ return self.postcode()
+
+ def postalcode_in_state(self, state_abbr=None):
+ return self.postcode_in_state(state_abbr)
def postalcode_plus4(self):
return self.zipcode_plus4()
diff --git a/src/libs/faker/providers/address/es_ES/__init__.py b/src/libs/faker/providers/address/es_ES/__init__.py
index 316bc1a..c60f1b2 100644
--- a/src/libs/faker/providers/address/es_ES/__init__.py
+++ b/src/libs/faker/providers/address/es_ES/__init__.py
@@ -13,15 +13,58 @@ class Provider(AddressProvider):
)
postcode_formats = ('#####', )
states = (
- 'Álava', 'Albacete', 'Alicante', 'Almería', 'Asturias', 'Ávila', 'Badajoz',
- 'Baleares', 'Barcelona', 'Burgos', 'Cáceres', 'Cádiz', 'Cantabria', 'Castellón',
- 'Ceuta', 'Ciudad', 'Córdoba', 'Cuenca', 'Girona', 'Granada', 'Guadalajara',
- 'Guipúzcoa', 'Huelva', 'Huesca', 'Jaén', 'La Coruña', 'La Rioja', 'Las Palmas',
- 'León', 'Lleida', 'Lugo', 'Madrid', 'Málaga', 'Melilla', 'Murcia', 'Navarra',
- 'Ourense', 'Palencia', 'Pontevedra', 'Salamanca', 'Santa Cruz de Tenerife',
- 'Segovia', 'Sevilla', 'Soria', 'Tarragona', 'Teruel', 'Toledo', 'Valencia',
- 'Valladolid', 'Vizcaya', 'Zamora', 'Zaragoza'
- )
+ 'Álava',
+ 'Albacete',
+ 'Alicante',
+ 'Almería',
+ 'Asturias',
+ 'Ávila',
+ 'Badajoz',
+ 'Baleares',
+ 'Barcelona',
+ 'Burgos',
+ 'Cáceres',
+ 'Cádiz',
+ 'Cantabria',
+ 'Castellón',
+ 'Ceuta',
+ 'Ciudad',
+ 'Córdoba',
+ 'Cuenca',
+ 'Girona',
+ 'Granada',
+ 'Guadalajara',
+ 'Guipúzcoa',
+ 'Huelva',
+ 'Huesca',
+ 'Jaén',
+ 'La Coruña',
+ 'La Rioja',
+ 'Las Palmas',
+ 'León',
+ 'Lleida',
+ 'Lugo',
+ 'Madrid',
+ 'Málaga',
+ 'Melilla',
+ 'Murcia',
+ 'Navarra',
+ 'Ourense',
+ 'Palencia',
+ 'Pontevedra',
+ 'Salamanca',
+ 'Santa Cruz de Tenerife',
+ 'Segovia',
+ 'Sevilla',
+ 'Soria',
+ 'Tarragona',
+ 'Teruel',
+ 'Toledo',
+ 'Valencia',
+ 'Valladolid',
+ 'Vizcaya',
+ 'Zamora',
+ 'Zaragoza')
city_formats = (
'{{state_name}}',
@@ -48,7 +91,9 @@ def street_prefix(self):
return self.random_element(self.street_prefixes)
def secondary_address(self):
- return self.numerify(self.random_element(self.secondary_address_formats))
+ return self.numerify(
+ self.random_element(
+ self.secondary_address_formats))
def state(self):
return self.random_element(self.states)
diff --git a/src/libs/faker/providers/address/es_MX/__init__.py b/src/libs/faker/providers/address/es_MX/__init__.py
index 7fdd436..03c9846 100644
--- a/src/libs/faker/providers/address/es_MX/__init__.py
+++ b/src/libs/faker/providers/address/es_MX/__init__.py
@@ -6,9 +6,9 @@
class Provider(AddressProvider):
- city_prefixes = ('Sur', 'Norte',)
- city_adjetives = ('Nueva', 'Vieja',)
- city_suffixies = ('de la Montaña', 'los bajos', 'los altos', )
+ city_prefixes = ('Sur', 'Norte')
+ city_adjetives = ('Nueva', 'Vieja')
+ city_suffixies = ('de la Montaña', 'los bajos', 'los altos')
street_prefixes = (
'Ampliación', 'Andador', 'Avenida', 'Boulevard', 'Calle', 'Callejón',
'Calzada', 'Cerrada', 'Circuito', 'Circunvalación', 'Continuación',
@@ -35,7 +35,7 @@ class Provider(AddressProvider):
('SIN', 'Sinaloa'), ('SON', 'Sonora'), ('TAB', 'Tabasco'),
('TAMPS', 'Tamaulipas'), ('TLAX', 'Tlaxcala'),
('VER', 'Veracruz de Ignacio de la Llave'),
- ('YUC', 'Yucatán'), ('ZAC', 'Zacatecas'),)
+ ('YUC', 'Yucatán'), ('ZAC', 'Zacatecas'))
zip_codes = OrderedDict((
# The ZipCodes has a begin & final range
@@ -82,7 +82,7 @@ class Provider(AddressProvider):
'{{street_prefix}} {{last_name}}',
'{{street_prefix}} {{country}}',
'{{street_prefix}} {{state}}',
- '{{street_prefix}} {{city_prefix}} {{last_name}}'
+ '{{street_prefix}} {{city_prefix}} {{last_name}}',
)
street_address_formats = (
'{{street_name}} {{secondary_address}}',
@@ -91,7 +91,7 @@ class Provider(AddressProvider):
"{{street_address}}\n{{city}}, {{state_abbr}} {{postcode}}",
)
secondary_address_formats = ('### ###', '### Interior ###',
- '### Edif. ### , Depto. ###')
+ '### Edif. ### , Depto. ###')
def city_prefix(self):
return self.random_element(self.city_prefixes)
@@ -112,7 +112,9 @@ def secondary_address(self):
"""
:example '020 Interior 999'
"""
- return self.numerify(self.random_element(self.secondary_address_formats))
+ return self.numerify(
+ self.random_element(
+ self.secondary_address_formats))
def state(self):
"""
diff --git a/src/libs/faker/providers/address/fa_IR/__init__.py b/src/libs/faker/providers/address/fa_IR/__init__.py
index 0f37b92..13ec45e 100644
--- a/src/libs/faker/providers/address/fa_IR/__init__.py
+++ b/src/libs/faker/providers/address/fa_IR/__init__.py
@@ -14,7 +14,7 @@ class Provider(AddressProvider):
'کوچه', 'خیابان', 'پل', 'دره', 'میدان', 'چهار راه', 'بن بست', 'بلوار',
'جنب', 'تقاطع', 'آزاد راه', 'بزرگ راه', 'جزیره', 'کوه', 'جاده', 'تونل',
)
- postcode_formats = ('###', '####', '#####', '######', '##########',)
+ postcode_formats = ('###', '####', '#####', '######', '##########')
states = (
'آذربایجان شرقی', 'آذربایجان غربی', 'اردبیل', 'خراسان', 'کردستان',
'گیلان', 'اصفهان', 'البرز', 'ایلام', 'بوشهر', 'تهران',
@@ -66,7 +66,7 @@ class Provider(AddressProvider):
)
street_name_formats = (
'{{first_name}} {{street_suffix}}',
- '{{last_name}} {{street_suffix}}'
+ '{{last_name}} {{street_suffix}}',
)
street_address_formats = (
'{{building_number}} {{street_name}}',
@@ -81,7 +81,9 @@ def city_prefix(self):
return self.random_element(self.city_prefixes)
def secondary_address(self):
- return self.numerify(self.random_element(self.secondary_address_formats))
+ return self.numerify(
+ self.random_element(
+ self.secondary_address_formats))
def state(self):
return self.random_element(self.states)
diff --git a/src/libs/faker/providers/address/fi_FI/__init__.py b/src/libs/faker/providers/address/fi_FI/__init__.py
index cd8a9e6..b8ce1a3 100644
--- a/src/libs/faker/providers/address/fi_FI/__init__.py
+++ b/src/libs/faker/providers/address/fi_FI/__init__.py
@@ -4,39 +4,55 @@
class Provider(AddressProvider):
-
building_number_formats = ('###', '##', '#')
postcode_formats = ('#####', )
city_formats = ('{{city_name}}', )
- street_name_formats = ('{{fruit}}{{street_suffix}}', )
+ street_name_formats = ('{{street_prefix}}{{street_suffix}}', )
- street_address_formats = ('{{street_name}} {{building_number}}',)
+ street_address_formats = ('{{street_name}} {{building_number}}', )
address_formats = ("{{street_address}}\n{{postcode}} {{city}}", )
+ # Data from:
+ # https://www.avoindata.fi/data/en/dataset/kunnat/resource/b1cb9870-191f-4616-9c53-5388b7ca6beb
cities = (
- 'Akaa', 'Alajärvi', 'Alavus', 'Espoo', 'Forssa', 'Haapajärvi',
- 'Haapavesi', 'Hämeenlinna', 'Hamina', 'Hanko', 'Harjavalta',
- 'Haukipudas', 'Heinola', 'Helsinki', 'Huittinen', 'Hyvinkää',
- 'Iisalmi', 'Ikaalinen', 'Imatra', 'Jakobstad', 'Joensuu', 'Juankoski',
- 'Jyväskylä', 'Jämsä', 'Järvenpää', 'Kaarina', 'Kajaani', 'Kalajoki',
- 'Kankaanpää', 'Kannus', 'Karkkila', 'Kaskinen', 'Kauhajoki', 'Kauhava',
- 'Kauniainen', 'Kemi', 'Kemijärvi', 'Kerava', 'Keuruu', 'Kitee',
- 'Kiuruvesi', 'Kokemäki', 'Kokkola', 'Kotka', 'Kouvola', 'Kristinestad',
- 'Kuhmo', 'Kuopio', 'Kurikka', 'Kuusamo', 'Lahti', 'Laitila',
- 'Lappeenranta', 'Lapua', 'Lieksa', 'Lohja', 'Loimaa', 'Loviisa',
- 'Mänttä-Vilppula', 'Mariehamn', 'Mikkeli', 'Naantali', 'Närpes',
- 'Nilsiä', 'Nivala', 'Nokia', 'Nurmes', 'Nykarleby', 'Orimattila',
- 'Orivesi', 'Oulainen', 'Oulu', 'Outokumpu', 'Paimio', 'Pargas',
- 'Parkano', 'Pieksämäki', 'Pori', 'Porvoo', 'Pudasjärvi', 'Pyhäjärvi',
- 'Raahe', 'Raseborg', 'Rauma', 'Raisio', 'Riihimäki', 'Rovaniemi',
- 'Saarijärvi', 'Salo', 'Sastamala', 'Savonlinna', 'Seinäjoki', 'Siuntio',
- 'Somero', 'Suonenjoki', 'Tampere', 'Tornio', 'Turku', 'Ulvila',
- 'Uusikaupunki', 'Vaasa', 'Valkeakoski', 'Vantaa', 'Varkaus',
- 'Viitasaari', 'Virrat', 'Ylivieska', 'Ylöjärvi', 'Äänekoski', 'Ähtäri',
+ 'Alajärvi', 'Alavieska', 'Alavus', 'Asikkala', 'Askola', 'Aura', 'Akaa', 'Brändö', 'Eckerö', 'Enonkoski',
+ 'Enontekiö', 'Espoo', 'Eura', 'Eurajoki', 'Evijärvi', 'Finström', 'Forssa', 'Föglö', 'Geta', 'Haapajärvi',
+ 'Haapavesi', 'Hailuoto', 'Halsua', 'Hamina', 'Hammarland', 'Hankasalmi', 'Hanko', 'Harjavalta', 'Hartola',
+ 'Hattula', 'Hausjärvi', 'Heinävesi', 'Helsinki', 'Vantaa', 'Hirvensalmi', 'Hollola', 'Honkajoki', 'Huittinen',
+ 'Humppila', 'Hyrynsalmi', 'Hyvinkää', 'Hämeenkyrö', 'Hämeenlinna', 'Heinola', 'Ii', 'Iisalmi', 'Iitti',
+ 'Ikaalinen', 'Ilmajoki', 'Ilomantsi', 'Inari', 'Inkoo', 'Isojoki', 'Isokyrö', 'Imatra', 'Janakkala', 'Joensuu',
+ 'Jokioinen', 'Jomala', 'Joroinen', 'Joutsa', 'Juuka', 'Juupajoki', 'Juva', 'Jyväskylä', 'Jämijärvi', 'Jämsä',
+ 'Järvenpää', 'Kaarina', 'Kaavi', 'Kajaani', 'Kalajoki', 'Kangasala', 'Kangasniemi', 'Kankaanpää', 'Kannonkoski',
+ 'Kannus', 'Karijoki', 'Karkkila', 'Karstula', 'Karvia', 'Kaskinen', 'Kauhajoki', 'Kauhava', 'Kauniainen',
+ 'Kaustinen', 'Keitele', 'Kemi', 'Keminmaa', 'Kempele', 'Kerava', 'Keuruu', 'Kihniö', 'Kinnula', 'Kirkkonummi',
+ 'Kitee', 'Kittilä', 'Kiuruvesi', 'Kivijärvi', 'Kokemäki', 'Kokkola', 'Kolari', 'Konnevesi', 'Kontiolahti',
+ 'Korsnäs', 'Koski Tl', 'Kotka', 'Kouvola', 'Kristiinankaupunki', 'Kruunupyy', 'Kuhmo', 'Kuhmoinen', 'Kumlinge',
+ 'Kuopio', 'Kuortane', 'Kurikka', 'Kustavi', 'Kuusamo', 'Outokumpu', 'Kyyjärvi', 'Kärkölä', 'Kärsämäki', 'Kökar',
+ 'Kemijärvi', 'Kemiönsaari', 'Lahti', 'Laihia', 'Laitila', 'Lapinlahti', 'Lappajärvi', 'Lappeenranta',
+ 'Lapinjärvi', 'Lapua', 'Laukaa', 'Lemi', 'Lemland', 'Lempäälä', 'Leppävirta', 'Lestijärvi', 'Lieksa', 'Lieto',
+ 'Liminka', 'Liperi', 'Loimaa', 'Loppi', 'Loviisa', 'Luhanka', 'Lumijoki', 'Lumparland', 'Luoto', 'Luumäki',
+ 'Lohja', 'Parainen', 'Maalahti', 'Maarianhamina', 'Marttila', 'Masku', 'Merijärvi', 'Merikarvia', 'Miehikkälä',
+ 'Mikkeli', 'Muhos', 'Multia', 'Muonio', 'Mustasaari', 'Muurame', 'Mynämäki', 'Myrskylä', 'Mäntsälä',
+ 'Mäntyharju', 'Mänttä-Vilppula', 'Naantali', 'Nakkila', 'Nivala', 'Nokia', 'Nousiainen', 'Nurmes', 'Nurmijärvi',
+ 'Närpiö', 'Orimattila', 'Oripää', 'Orivesi', 'Oulainen', 'Oulu', 'Padasjoki', 'Paimio', 'Paltamo', 'Parikkala',
+ 'Parkano', 'Pelkosenniemi', 'Perho', 'Pertunmaa', 'Petäjävesi', 'Pieksämäki', 'Pielavesi', 'Pietarsaari',
+ 'Pedersören kunta', 'Pihtipudas', 'Pirkkala', 'Polvijärvi', 'Pomarkku', 'Pori', 'Pornainen', 'Posio',
+ 'Pudasjärvi', 'Pukkila', 'Punkalaidun', 'Puolanka', 'Puumala', 'Pyhtää', 'Pyhäjoki', 'Pyhäjärvi', 'Pyhäntä',
+ 'Pyhäranta', 'Pälkäne', 'Pöytyä', 'Porvoo', 'Raahe', 'Raisio', 'Rantasalmi', 'Ranua', 'Rauma', 'Rautalampi',
+ 'Rautavaara', 'Rautjärvi', 'Reisjärvi', 'Riihimäki', 'Ristijärvi', 'Rovaniemi', 'Ruokolahti', 'Ruovesi',
+ 'Rusko', 'Rääkkylä', 'Raasepori', 'Saarijärvi', 'Salla', 'Salo', 'Saltvik', 'Sauvo', 'Savitaipale',
+ 'Savonlinna', 'Savukoski', 'Seinäjoki', 'Sievi', 'Siikainen', 'Siikajoki', 'Siilinjärvi', 'Simo', 'Sipoo',
+ 'Siuntio', 'Sodankylä', 'Soini', 'Somero', 'Sonkajärvi', 'Sotkamo', 'Sottunga', 'Sulkava', 'Sund',
+ 'Suomussalmi', 'Suonenjoki', 'Sysmä', 'Säkylä', 'Vaala', 'Sastamala', 'Siikalatva', 'Taipalsaari',
+ 'Taivalkoski', 'Taivassalo', 'Tammela', 'Tampere', 'Tervo', 'Tervola', 'Teuva', 'Tohmajärvi', 'Toholampi',
+ 'Toivakka', 'Tornio', 'Turku', 'Pello', 'Tuusniemi', 'Tuusula', 'Tyrnävä', 'Ulvila', 'Urjala', 'Utajärvi',
+ 'Utsjoki', 'Uurainen', 'Uusikaarlepyy', 'Uusikaupunki', 'Vaasa', 'Valkeakoski', 'Valtimo', 'Varkaus', 'Vehmaa',
+ 'Vesanto', 'Vesilahti', 'Veteli', 'Vieremä', 'Vihti', 'Viitasaari', 'Vimpeli', 'Virolahti', 'Virrat', 'Värdö',
+ 'Vöyri', 'Ylitornio', 'Ylivieska', 'Ylöjärvi', 'Ypäjä', 'Ähtäri', 'Äänekoski',
)
countries = (
@@ -99,44 +115,47 @@ class Provider(AddressProvider):
'Hämeen lääni', 'Mikkelin lääni', 'Kuopion lääni', 'Ahvenanmaan lääni',
'Petsamon lääni', 'Lapin lääni', 'Kymen lääni', 'Keski-Suomen lääni',
'Pohjois-Karjalan lääni', 'Etelä-Suomen lääni', 'Länsi-Suomen lääni',
- 'Itä-Suomen lääni'
+ 'Itä-Suomen lääni',
)
street_suffixes = ('tie', 'katu', 'polku', 'kuja', 'bulevardi')
- # Using fruits to generate street names, since it doesn't make
- # much grammatical sense to use first names
-
- fruits = (
- 'Ananas', 'Ananaskirsikka', 'Annoona', 'Appelsiini', 'Aprikoosi',
- 'Avokado', 'Banaani', 'Cantaloupemeloni', 'Durio', 'Feijoa',
- 'Galiameloni', 'Granaattiomena', 'Granadilla', 'Greippi', 'Guava',
- 'Hunajameloni', 'Jakkihedelmä', 'Kaki', 'Kaktusviikuna', 'Karambola',
- 'Kastanja', 'Keittobanaani', 'Keltainen', 'kiivi', 'Keltapassio',
- 'Kiivi', 'Kirsikka', 'Kirsikkaluumu', 'Kiwai', 'Kiwano', 'Kookospähkinä',
- 'Kumkvatti', 'Limetti', 'Limkvatti', 'Litsi', 'Longaani', 'Luumu',
- 'Mandariini', 'Mango', 'Mangostaani', 'Maracuya', 'Meloni', 'Nashi',
- 'Nektariini', 'Omena', 'Papaija', 'Passionhedelmä', 'Persikka', 'Pepino',
- 'Pikkusitrukset', 'Pitahaya', 'Pomelo', 'Pähkinä', 'Päärynä',
- 'Rambutani', 'Rumeliini', 'Sapodilla', 'Salaki', 'Sitruuna',
- 'Sokerimeloni', 'Sweetie', 'Taateli', 'Tamarillo', 'Tomaatti',
- 'Verkkomeloni', 'Vesimeloni', 'Viikuna', 'Viinirypäle', 'Ananas',
- 'Annoona', 'Appelsiini', 'Aprikoosi', 'Avokado', 'Banaani',
- 'Cantaloupemeloni', 'Durio', 'Feijoa', 'Galiameloni', 'Granaattiomena',
- 'Granadilla', 'Greippi', 'Guava', 'Hunajameloni', 'Jakkihedelmä', 'Kaki',
- 'Kaktusviikuna', 'Karambola', 'Kastanja', 'Keittobanaani', 'Keltapassio',
- 'Kiivi', 'Kirsikka', 'Kirsikkaluumu', 'Kiwai', 'Kiwano', 'Kookospähkinä',
- 'Kumkvatti', 'Limetti', 'Limkvatti', 'Litsi', 'Longaani', 'Luumu',
- 'Mandariini', 'Mango', 'Mangostaani', 'Maracuya', 'Meloni', 'Nashi',
- 'Nektariini', 'Omena', 'Papaija', 'Passionhedelmä', 'Persikka', 'Pepino',
- 'Pikkusitrukset', 'Pitahaya', 'Pomelo', 'Pähkinä', 'Päärynä',
- 'Rambutani', 'Rumeliini', 'Sapodilla', 'Salaki', 'Sitruuna',
- 'Sokerimeloni', 'Sweetie', 'Taateli', 'Tamarillo', 'Tomaatti',
- 'Verkkomeloni', 'Vesimeloni', 'Viikuna', 'Viinirypäle'
+ # Prefixes parsed from a street list of Helsinki:
+ # http://kartta.hel.fi/ws/geoserver/avoindata/wfs?outputFormat=application/json&REQUEST=GetFeature&typeNames=avoindata:Helsinki_osoiteluettelo
+
+ street_prefixes = (
+ 'Adolf Lindforsin ', 'Agnes Sjöbergin ', 'Agnetan', 'Agricolan', 'Ahomäen', 'Ahvenkosken', 'Aidasmäen',
+ 'Agroksen', 'Agronomin', 'Ahdekaunokin', 'Bertel Jungin ', 'Bertha Pauligin ', 'Betlehemin', 'Betoni',
+ 'Biologin', 'Birger Kaipiaisen ', 'Bysantin', 'Böstaksen', 'Bengalin', 'Benktan', 'Bergan', 'Caloniuksen',
+ 'Capellan puisto', 'Castrénin', 'Chydeniuksen', 'Cygnaeuksen', 'Dagmarin', 'Damaskuksen', 'Degermosan', 'Disan',
+ 'Dosentin', 'Dunckerin', 'Döbelnin', 'Ehrensvärdin', 'Eino Leinon ', 'Elimäen', 'Elisabeth Kochin ', 'Eljaksen',
+ 'Elon', 'Elon', 'Edelfeltin', 'Eduskunta', 'Eerik Pyhän ', 'Franzénin', 'Fredrikin', 'Freesen',
+ 'Fabianin', 'Fagotti', 'Fahlanderin puisto', 'Fallin', 'Fallkullan', 'Fallpakan', 'Fastbölen', 'Gadolinin',
+ 'Gneissi', 'Granfeltin', 'Gunillan', 'Gunnel Nymanin ', 'Graniitti', 'Gustav Pauligin ', 'Gyldénin',
+ 'Gotlannin', 'Haapa', 'Haagan pappilan', 'Haahka', 'Haakoninlahden', 'Haaksi', 'Hankasuon', 'Hannukselan',
+ 'Harakkamyllyn', 'Harava', 'Harbon', 'Ilmattaren', 'Ilomäen', 'Ilotulitus', 'Iltaruskon', 'Iltatähden', 'Ilves',
+ 'Immolan', 'Ilkan', 'Ida Ekmanin ', 'Ies', 'Jälsi', 'Jämsän', 'Jänkä', 'Jänne', 'Järkäle', 'Jätkäsaaren',
+ 'Jättiläisen', 'Jyvä', 'Jägerhornin', 'Jäkälä', 'Kukkaniityn', 'Kolsin', 'Kolu', 'Kolvi', 'Kuhankeittäjän',
+ 'Katajaharjun', 'Kiitäjän', 'Kilpolan', 'Kimalais', 'Kimmon', 'Laajasalon', 'Laakavuoren', 'Lemun',
+ 'Lentokapteenin ', 'Lepolan', 'Louhen', 'Louhikko', 'Lukkarimäen', 'Laurinniityn', 'Lautamiehen',
+ 'Mamsellimyllyn', 'Mannerheimin', 'Maanmittarin', 'Maapadon', 'Maa', 'Maasalon', 'Maasälvän', 'Maatullin',
+ 'Malminkartanon', 'Maneesi', 'Niittylän', 'Niemi', 'Niitynperän', 'Nikon', 'Nils Westermarckin ',
+ 'Nordenskiöldin', 'Nelikko', 'Neon', 'Nervanderin', 'Neulapadon', 'Ostos', 'Orapihlaja', 'Oras', 'Orava',
+ 'Osmon', 'Osuuskunnan', 'Orisaaren', 'Ormus', 'Orvokki', 'Oterman', 'Pore', 'Porin', 'Porkkalan', 'Pyörökiven',
+ 'Puusepän', 'Puuska', 'Pohjolan', 'Poikasaarten', 'Purjetuulen', 'Puroniityn', 'Rukkilan', 'Ruko',
+ 'Rukoushuoneen', 'Runebergin', 'Runoilijan', 'Runokylän', 'Runonlaulajan', 'Rantavaraston', 'Rapakiven',
+ 'Rapolan', 'Santerlan', 'Saparon', 'Sapilas', 'Saramäen', 'Saanatunturin', 'Sade', 'Sahaajan', 'Salakka',
+ 'Salama', 'Salava', 'Tuomarinkylän', 'Tuulilasin', 'Taavetti Laitisen ', 'Taavin', 'Tahti', 'Taimiston',
+ 'Tukkisillan', 'Tuohikoivun', 'Tyynelän', 'Tyynylaavan', 'Uussillan', 'Urheilu', 'Urkurin', 'Urpu', 'Uskalikon',
+ 'Usva', 'Uudenkaupungin', 'Uunilinnun', 'Uunisepän', 'Uurtajan', 'Vanha Raja', 'Veropellon', 'Veräjämäen',
+ 'Vesakko', 'Vesalan', 'Vellikellon', 'Verkko', 'Verso', 'Vaakalinnun', 'Vaarna', 'Wavulinin',
+ 'Walentin Chorellin ', 'Wallinin', 'Waseniuksen puisto', 'Wecksellin', 'Willebrandin', 'Winqvistin',
+ 'Wäinö Aaltosen ', 'Werner Wirénin ', 'Yhteiskoulun', 'Ylipalon', 'Yllästunturin', 'Ylä-Fallin ', 'Yläkasken',
+ 'Ylänkö', 'Ylätuvan', 'Yrjö-Koskisen ', 'Yrjön', 'Yrttimaan', 'Zaidan',
)
- def fruit(self):
- return self.random_element(self.fruits)
+ def street_prefix(self):
+ return self.random_element(self.street_prefixes)
def city_name(self):
return self.random_element(self.cities)
diff --git a/src/libs/faker/providers/address/fr_CH/__init__.py b/src/libs/faker/providers/address/fr_CH/__init__.py
index f585dc3..8216d97 100644
--- a/src/libs/faker/providers/address/fr_CH/__init__.py
+++ b/src/libs/faker/providers/address/fr_CH/__init__.py
@@ -10,7 +10,7 @@ class Provider(AddressProvider):
city_prefixes = ('Saint ', 'Sainte ', 'San ', 'Ober', 'Unter')
street_prefixes = ('rue', 'rue', 'chemin', 'avenue', 'boulevard')
- address_formats = ("{{street_address}}\n{{postcode}} {{city}}",)
+ address_formats = ("{{street_address}}\n{{postcode}} {{city}}", )
building_number_formats = ('%', '%#', '%#', '%#', '%##')
@@ -21,36 +21,29 @@ class Provider(AddressProvider):
'{{last_name}}-près-{{last_name}}',
'{{last_name}}-sur-{{last_name}}',
'{{city_prefix}}{{last_name}}',
- '{{last_name}} ({{canton_code}})',)
+ '{{last_name}} ({{canton_code}})')
street_address_formats = ('{{street_name}}',
'{{street_name}} {{building_number}}',
'{{street_name}} {{building_number}}',
'{{street_name}} {{building_number}}',
'{{street_name}} {{building_number}}',
- '{{street_name}} {{building_number}}',)
+ '{{street_name}} {{building_number}}')
street_name_formats = ('{{street_prefix}} {{last_name}}',
'{{street_prefix}} {{first_name}} {{last_name}}',
- '{{street_prefix}} de {{last_name}}',)
+ '{{street_prefix}} de {{last_name}}')
postcode_formats = ('1###', '2###', '3###', '4###', '5###', '6###', '7###',
'8###', '9###')
cantons = (('AG', 'Argovie'), ('AI', 'Appenzell Rhodes-Intérieures'),
('AR', 'Appenzell Rhodes-Extérieures'), ('BE', 'Berne'),
- ('BL', 'Bâle-Campagne'), ('BS', 'Bâle-Ville'), ('FR',
- 'Fribourg'),
- ('GE', 'Genève'), ('GL', 'Glaris'), ('GR', 'Grisons'), ('JU',
- 'Jura'),
- ('LU', 'Lucerne'), ('NE', 'Neuchâtel'), ('NW',
- 'Nidwald'), ('OW',
- 'Obwald'),
+ ('BL', 'Bâle-Campagne'), ('BS', 'Bâle-Ville'), ('FR', 'Fribourg'),
+ ('GE', 'Genève'), ('GL', 'Glaris'), ('GR', 'Grisons'), ('JU', 'Jura'),
+ ('LU', 'Lucerne'), ('NE', 'Neuchâtel'), ('NW', 'Nidwald'), ('OW', 'Obwald'),
('SG', 'Saint-Gall'), ('SH', 'Schaffhouse'), ('SO', 'Soleure'),
- ('SZ', 'Schwytz'), ('TG', 'Thurgovie'), ('TI',
- 'Tessin'), ('UR',
- 'Uri'),
- ('VD', 'Vaud'), ('VS', 'Valais'), ('ZG', 'Zoug'), ('ZH',
- 'Zurich'),)
+ ('SZ', 'Schwytz'), ('TG', 'Thurgovie'), ('TI', 'Tessin'), ('UR', 'Uri'),
+ ('VD', 'Vaud'), ('VS', 'Valais'), ('ZG', 'Zoug'), ('ZH', 'Zurich'))
countries = (
'Afghanistan', 'Afrique du sud', 'Albanie', 'Algérie', 'Allemagne',
@@ -104,7 +97,7 @@ class Provider(AddressProvider):
'Turks et Caïques (Îles)', 'Turquie', 'Tuvalu', 'Ukraine', 'Uruguay',
'Vanuatu', 'Vatican (Etat du)', 'Venezuela', 'Vierges (Îles)',
'Vierges britanniques (Îles)', 'Vietnam', 'Wallis et Futuna (Îles)',
- 'Yemen', 'Yougoslavie', 'Zambie', 'Zaïre', 'Zimbabwe',)
+ 'Yemen', 'Yougoslavie', 'Zambie', 'Zaïre', 'Zimbabwe')
def street_prefix(self):
"""
diff --git a/src/libs/faker/providers/address/fr_FR/__init__.py b/src/libs/faker/providers/address/fr_FR/__init__.py
index 353d4c7..1f4a38b 100644
--- a/src/libs/faker/providers/address/fr_FR/__init__.py
+++ b/src/libs/faker/providers/address/fr_FR/__init__.py
@@ -4,7 +4,8 @@
class Provider(AddressProvider):
- city_suffixes = ('Ville', 'Bourg', '-les-Bains', '-sur-Mer', '-la-Forêt', 'boeuf', 'nec', 'dan')
+ city_suffixes = ('Ville', 'Bourg', '-les-Bains',
+ '-sur-Mer', '-la-Forêt', 'boeuf', 'nec', 'dan')
city_prefixes = ('Saint', 'Sainte')
street_prefixes = ('rue', 'rue', 'chemin', 'avenue', 'boulevard')
city_formats = (
@@ -75,16 +76,42 @@ class Provider(AddressProvider):
'Tokelau', 'Tonga', 'Trinité et Tobago', 'Tunisie', 'Turkménistan', 'Turks et Caïques (Îles)', 'Turquie',
'Tuvalu', 'Ukraine', 'Uruguay', 'Vanuatu', 'Vatican (Etat du)', 'Venezuela', 'Vierges (Îles)',
'Vierges britanniques (Îles)', 'Vietnam', 'Wallis et Futuna (Îles)', 'Yemen', 'Yougoslavie', 'Zambie', 'Zaïre',
- 'Zimbabwe'
+ 'Zimbabwe',
)
regions = (
- 'Alsace', 'Aquitaine', 'Auvergne', 'Bourgogne', 'Bretagne', 'Centre', 'Champagne-Ardenne',
- 'Corse', 'Franche-Comté', 'Île-de-France', 'Languedoc-Roussillon', 'Limousin',
- 'Lorraine', 'Midi-Pyrénées', 'Nord-Pas-de-Calais', 'Basse-Normandie', 'Haute-Normandie',
- 'Pays-de-Loire', 'Picardie', 'Poitou-Charentes', "Province-Alpes-Côte d'Azur", 'Rhone-Alpes',
- 'Guadeloupe', 'Martinique', 'Guyane', 'Réunion', 'Saint-Pierre-et-Miquelon', 'Mayotte',
- 'Saint-Barthélémy', 'Saint-Martin', 'Wallis-et-Futuna', 'Polynésie française', 'Nouvelle-Calédonie'
- )
+ 'Alsace',
+ 'Aquitaine',
+ 'Auvergne',
+ 'Bourgogne',
+ 'Bretagne',
+ 'Centre',
+ 'Champagne-Ardenne',
+ 'Corse',
+ 'Franche-Comté',
+ 'Île-de-France',
+ 'Languedoc-Roussillon',
+ 'Limousin',
+ 'Lorraine',
+ 'Midi-Pyrénées',
+ 'Nord-Pas-de-Calais',
+ 'Basse-Normandie',
+ 'Haute-Normandie',
+ 'Pays-de-Loire',
+ 'Picardie',
+ 'Poitou-Charentes',
+ "Province-Alpes-Côte d'Azur",
+ 'Rhone-Alpes',
+ 'Guadeloupe',
+ 'Martinique',
+ 'Guyane',
+ 'Réunion',
+ 'Saint-Pierre-et-Miquelon',
+ 'Mayotte',
+ 'Saint-Barthélémy',
+ 'Saint-Martin',
+ 'Wallis-et-Futuna',
+ 'Polynésie française',
+ 'Nouvelle-Calédonie')
departments = (
('01', 'Ain'), ('02', 'Aisne'), ('03', 'Allier'), ('04', 'Alpes-de-Haute-Provence'), ('05', 'Hautes-Alpes'),
@@ -95,19 +122,19 @@ class Provider(AddressProvider):
('25', 'Doubs'), ('26', 'Drôme'), ('27', 'Eure'), ('28', 'Eure-et-Loir'), ('29', 'Finistère'), ('30', 'Gard'),
('31', 'Haute-Garonne'), ('32', 'Gers'), ('33', 'Gironde'), ('34', 'Hérault'), ('35', 'Ille-et-Vilaine'),
('36', 'Indre'), ('37', 'Indre-et-Loire'), ('38', 'Isère'), ('39', 'Jura'), ('40', 'Landes'),
- ('41', 'Loir-et-Cher'),
- ('42', 'Loire'), ('43', 'Haute-Loire'), ('44', 'Loire-Atlantique'), ('45', 'Loiret'), ('46', 'Lot'),
- ('47', 'Lot-et-Garonne'), ('48', 'Lozère'), ('49', 'Maine-et-Loire'), ('50', 'Manche'), ('51', 'Marne'),
- ('52', 'Haute-Marne'), ('53', 'Mayenne'), ('54', 'Meurthe-et-Moselle'), ('55', 'Meuse'), ('56', 'Morbihan'),
- ('57', 'Moselle'), ('58', 'Nièvre'), ('59', 'Nord'), ('60', 'Oise'), ('61', 'Orne'), ('62', 'Pas-de-Calais'),
- ('63', 'Puy-de-Dôme'), ('64', 'Pyrénées-Atlantiques'), ('65', 'Hautes-Pyrénées'), ('66', 'Pyrénées-Orientales'),
- ('67', 'Bas-Rhin'), ('68', 'Haut-Rhin'), ('69', 'Rhône'), ('70', 'Haute-Saône'), ('71', 'Saône-et-Loire'),
- ('72', 'Sarthe'), ('73', 'Savoie'), ('74', 'Haute-Savoie'), ('75', 'Paris'), ('76', 'Seine-Maritime'),
- ('77', 'Seine-et-Marne'), ('78', 'Yvelines'), ('79', 'Deux-Sèvres'), ('80', 'Somme'), ('81', 'Tarn'),
- ('82', 'Tarn-et-Garonne'), ('83', 'Var'), ('84', 'Vaucluse'), ('85', 'Vendée'), ('86', 'Vienne'),
- ('87', 'Haute-Vienne'), ('88', 'Vosges'), ('89', 'Yonne'), ('90', 'Territoire de Belfort'), ('91', 'Essonne'),
- ('92', 'Hauts-de-Seine'), ('93', 'Seine-Saint-Denis'), ('94', 'Val-de-Marne'), ('95', "Val-d'Oise"),
- ('971', 'Guadeloupe'), ('972', 'Martinique'), ('973', 'Guyane'), ('974', 'La Réunion'), ('976', 'Mayotte')
+ ('41', 'Loir-et-Cher'), ('42', 'Loire'), ('43', 'Haute-Loire'), ('44', 'Loire-Atlantique'), ('45', 'Loiret'),
+ ('46', 'Lot'), ('47', 'Lot-et-Garonne'), ('48', 'Lozère'), ('49', 'Maine-et-Loire'), ('50', 'Manche'),
+ ('51', 'Marne'), ('52', 'Haute-Marne'), ('53', 'Mayenne'), ('54', 'Meurthe-et-Moselle'), ('55', 'Meuse'),
+ ('56', 'Morbihan'), ('57', 'Moselle'), ('58', 'Nièvre'), ('59', 'Nord'), ('60', 'Oise'), ('61', 'Orne'),
+ ('62', 'Pas-de-Calais'), ('63', 'Puy-de-Dôme'), ('64', 'Pyrénées-Atlantiques'), ('65', 'Hautes-Pyrénées'),
+ ('66', 'Pyrénées-Orientales'), ('67', 'Bas-Rhin'), ('68', 'Haut-Rhin'), ('69', 'Rhône'), ('70', 'Haute-Saône'),
+ ('71', 'Saône-et-Loire'), ('72', 'Sarthe'), ('73', 'Savoie'), ('74', 'Haute-Savoie'), ('75', 'Paris'),
+ ('76', 'Seine-Maritime'), ('77', 'Seine-et-Marne'), ('78', 'Yvelines'), ('79', 'Deux-Sèvres'), ('80', 'Somme'),
+ ('81', 'Tarn'), ('82', 'Tarn-et-Garonne'), ('83', 'Var'), ('84', 'Vaucluse'), ('85', 'Vendée'),
+ ('86', 'Vienne'), ('87', 'Haute-Vienne'), ('88', 'Vosges'), ('89', 'Yonne'), ('90', 'Territoire de Belfort'),
+ ('91', 'Essonne'), ('92', 'Hauts-de-Seine'), ('93', 'Seine-Saint-Denis'), ('94', 'Val-de-Marne'),
+ ('95', "Val-d'Oise"), ('971', 'Guadeloupe'), ('972', 'Martinique'), ('973', 'Guyane'), ('974', 'La Réunion'),
+ ('976', 'Mayotte'),
)
def street_prefix(self):
diff --git a/src/libs/faker/providers/address/hi_IN/__init__.py b/src/libs/faker/providers/address/hi_IN/__init__.py
index a7f5771..8465249 100644
--- a/src/libs/faker/providers/address/hi_IN/__init__.py
+++ b/src/libs/faker/providers/address/hi_IN/__init__.py
@@ -9,41 +9,232 @@ class Provider(AddressProvider):
street_name_formats = (
'{{first_name}} {{last_name}}',
- '{{last_name}}'
+ '{{last_name}}',
)
street_address_formats = ('{{building_number}} {{street_name}}', )
- address_formats = ('{{street_address}}\n{{city}} {{postcode}}', '{{street_address}}\n{{city}}-{{postcode}}',)
+ address_formats = ('{{street_address}}\n{{city}} {{postcode}}',
+ '{{street_address}}\n{{city}}-{{postcode}}')
- building_number_formats = ('####', '###', '##', '#', '#/#', '##/##', '##/###', '##/####')
+ building_number_formats = (
+ '####', '###', '##', '#', '#/#', '##/##', '##/###', '##/####')
postcode_formats = ('######', )
cities = (
- 'आदिलाबाद', 'अगरतला', 'अहमदाबाद', 'अहमदनगर', 'अजमेर', 'अम्बाजी', 'अमरपुर', 'इलाहाबाद', 'अकोला', 'अखनूर',
- 'अन्तर्गत', 'अलांग', 'अलीगढ', 'दादरा और नागर हवेली', 'अमरावती', 'अमरोहा', 'अनन्तपुर', 'करना', 'जिससेबेलारी',
- 'अनंतनाग', 'भागलपुर', 'पेपरबोर्डस', 'त्रिबेनी', 'टिसूज', 'भद्रक', 'बचेली', 'बहादुरगंज', 'बहादुरगढ', 'चिरमिरी', 'चिराला', 'चित्रदुर्ग',
- 'चित्तूर', 'चित्रकूट', 'देवगढ़', 'दालखोला', 'देवास', 'चंडीगढ', 'फादर', 'चिन्नफ', 'चिपलुन', 'चक्रधरपुर', 'चंबा', 'फतहपुर', 'फतेहपुर',
- 'फतेहगढ', 'फतहपुर', 'फतहपुर', 'चित्तूर', 'चित्रकूट', 'सभापतिने', 'देवगढ़', 'द्वारारस्वीकृति', 'दालखोला',
- 'धर्मापुरी', 'पाकाला', 'धारवाड', 'असम', 'देहरा', 'रानीताल', 'खडगपुर', 'मोकामा', 'मोकोकचुंग', 'जिलोंपर', 'विस्तारण', 'मोतिहारी',
+ 'आदिलाबाद',
+ 'अगरतला',
+ 'अहमदाबाद',
+ 'अहमदनगर',
+ 'अजमेर',
+ 'अम्बाजी',
+ 'अमरपुर',
+ 'इलाहाबाद',
+ 'अकोला',
+ 'अखनूर',
+ 'अन्तर्गत',
+ 'अलांग',
+ 'अलीगढ',
+ 'दादरा और नागर हवेली',
+ 'अमरावती',
+ 'अमरोहा',
+ 'अनन्तपुर',
+ 'करना',
+ 'जिससेबेलारी',
+ 'अनंतनाग',
+ 'भागलपुर',
+ 'पेपरबोर्डस',
+ 'त्रिबेनी',
+ 'टिसूज',
+ 'भद्रक',
+ 'बचेली',
+ 'बहादुरगंज',
+ 'बहादुरगढ',
+ 'चिरमिरी',
+ 'चिराला',
+ 'चित्रदुर्ग',
+ 'चित्तूर',
+ 'चित्रकूट',
+ 'देवगढ़',
+ 'दालखोला',
+ 'देवास',
+ 'चंडीगढ',
+ 'फादर',
+ 'चिन्नफ',
+ 'चिपलुन',
+ 'चक्रधरपुर',
+ 'चंबा',
+ 'फतहपुर',
+ 'फतेहपुर',
+ 'फतेहगढ',
+ 'फतहपुर',
+ 'फतहपुर',
+ 'चित्तूर',
+ 'चित्रकूट',
+ 'सभापतिने',
+ 'देवगढ़',
+ 'द्वारारस्वीकृति',
+ 'दालखोला',
+ 'धर्मापुरी',
+ 'पाकाला',
+ 'धारवाड',
+ 'असम',
+ 'देहरा',
+ 'रानीताल',
+ 'खडगपुर',
+ 'मोकामा',
+ 'मोकोकचुंग',
+ 'जिलोंपर',
+ 'विस्तारण',
+ 'मोतिहारी',
)
states = (
- 'अरूणाचल प्रदेश', 'बिहार', 'असम', 'आंध्र प्रदेश', 'छत्तीसगढ', 'हरियाणा', 'गुजरात', 'हिमाचल प्रदेश', 'गोवा', 'मध्य प्रदेश', 'महाराष्ट्र', 'कश्मीर',
- 'केरल', 'कर्नाटक', 'मणिपुर', 'मिजोरम', 'मेघालय', 'सिबक्कम', 'राजस्थान', 'पंजाब', 'उडीसा', 'उत्तरांचल', 'उत्तर प्रदेश', 'तमिलनाडु', 'त्रिपुरा',
- 'पश्चिमी बंगाल', 'अंडमान और निकोबार', 'द्वीप समूह', 'दमन और दीव', 'दादरा और नागर हवेली', 'दिल्ली', 'पांडिचेरी', 'लक्षद्वीप'
- )
+ 'अरूणाचल प्रदेश',
+ 'बिहार',
+ 'असम',
+ 'आंध्र प्रदेश',
+ 'छत्तीसगढ',
+ 'हरियाणा',
+ 'गुजरात',
+ 'हिमाचल प्रदेश',
+ 'गोवा',
+ 'मध्य प्रदेश',
+ 'महाराष्ट्र',
+ 'कश्मीर',
+ 'केरल',
+ 'कर्नाटक',
+ 'मणिपुर',
+ 'मिजोरम',
+ 'मेघालय',
+ 'सिबक्कम',
+ 'राजस्थान',
+ 'पंजाब',
+ 'उडीसा',
+ 'उत्तरांचल',
+ 'उत्तर प्रदेश',
+ 'तमिलनाडु',
+ 'त्रिपुरा',
+ 'पश्चिमी बंगाल',
+ 'अंडमान और निकोबार',
+ 'द्वीप समूह',
+ 'दमन और दीव',
+ 'दादरा और नागर हवेली',
+ 'दिल्ली',
+ 'पांडिचेरी',
+ 'लक्षद्वीप')
countries = (
- 'आर्मेनिया', 'यू.के.', 'फ्रांस', 'अजेपटीना', 'ब्राजील', 'ईरान', 'यूनान', 'स्पेन', 'हमारे', 'जॉजिऩया', 'लेबनान', 'सायप्रस', 'सीरिया', 'कनाडा', 'रूस',
- 'संयुक्त राज्य अमरीका', 'नेदर्लान्ड', 'फ्रांस', 'ऑस्ट्रेलिया', 'एंटीगुआ', 'बार्बुडा', 'अर्जेंटीना', 'आर्मेनिया', 'ऑस्ट्रिया', 'अज़रबाइजान', 'बारबाडोस', 'बेलारूस', 'बेल्जियम',
- 'बेलीज़', 'बेनिन', 'बहामास', 'बहरीन', 'बांग्लादेश', 'भूटान', 'बोलिविया', 'बोस्निया', 'हर्जेगोविना', 'बोत्सवाना', 'ब्राजील', 'ब्रुनेई', 'बुल्गारिया', 'बुर्किना', 'फ़ासो',
- 'बर्मा', 'बुरूंडी', 'डोमिनिकन रिपब्लिक', 'गिनिया', 'टीमोर', 'फ़िनलैंड', 'गेबोन', 'गाम्बिया', 'जर्मनी', 'जार्जिया ग्रेनेडा', 'घाना', 'यूनान', 'ग्रेट ब्रिटेन', 'हंगरी',
- 'भारत', 'इराक', 'आयरलैंड', 'इंडोनेशिया', 'इसराइल', 'आइलैंड', 'ईरान', 'इटली', 'जमैका', 'जॉर्डन', 'जापान', 'क़जाख़स्तान', 'केन्या', 'किरिबाती', 'दक्षिण कोरिया', 'लातविया',
- 'लाओस', 'उत्तर कोरिया', 'दक्षिण कोसोवो', 'कुवैत', 'लेबनान', 'लिचटीनस्टीन', 'लिथुआनिया', 'लक्समबर्ग', 'लीबिया', 'लाइबेरिया', 'लेसोथो',
- 'नेपाल', 'न्यूजीलैंड', 'निकारागुआ', 'नाइजर', 'नाउरू', 'लुसिया', 'रूस', 'रोमानिया', 'अरब', 'अमीरात', 'यूएई', 'युगांडा', 'यूक्रेन', 'उरूग्वे',
- 'उज़बेकिस्तान', 'यूनाइटेड किंगडम', 'वानुआतू', 'वेटिकन सिटी', 'वेनेजुएला', 'पश्चिमी सहारा', 'वियतनाम', 'यमन', 'ज़ायर', 'जाबम्बया', 'जिम्बाब्वे',
+ 'आर्मेनिया',
+ 'यू.के.',
+ 'फ्रांस',
+ 'अजेपटीना',
+ 'ब्राजील',
+ 'ईरान',
+ 'यूनान',
+ 'स्पेन',
+ 'हमारे',
+ 'जॉजिऩया',
+ 'लेबनान',
+ 'सायप्रस',
+ 'सीरिया',
+ 'कनाडा',
+ 'रूस',
+ 'संयुक्त राज्य अमरीका',
+ 'नेदर्लान्ड',
+ 'फ्रांस',
+ 'ऑस्ट्रेलिया',
+ 'एंटीगुआ',
+ 'बार्बुडा',
+ 'अर्जेंटीना',
+ 'आर्मेनिया',
+ 'ऑस्ट्रिया',
+ 'अज़रबाइजान',
+ 'बारबाडोस',
+ 'बेलारूस',
+ 'बेल्जियम',
+ 'बेलीज़',
+ 'बेनिन',
+ 'बहामास',
+ 'बहरीन',
+ 'बांग्लादेश',
+ 'भूटान',
+ 'बोलिविया',
+ 'बोस्निया',
+ 'हर्जेगोविना',
+ 'बोत्सवाना',
+ 'ब्राजील',
+ 'ब्रुनेई',
+ 'बुल्गारिया',
+ 'बुर्किना',
+ 'फ़ासो',
+ 'बर्मा',
+ 'बुरूंडी',
+ 'डोमिनिकन रिपब्लिक',
+ 'गिनिया',
+ 'टीमोर',
+ 'फ़िनलैंड',
+ 'गेबोन',
+ 'गाम्बिया',
+ 'जर्मनी',
+ 'जार्जिया ग्रेनेडा',
+ 'घाना',
+ 'यूनान',
+ 'ग्रेट ब्रिटेन',
+ 'हंगरी',
+ 'भारत',
+ 'इराक',
+ 'आयरलैंड',
+ 'इंडोनेशिया',
+ 'इसराइल',
+ 'आइलैंड',
+ 'ईरान',
+ 'इटली',
+ 'जमैका',
+ 'जॉर्डन',
+ 'जापान',
+ 'क़जाख़स्तान',
+ 'केन्या',
+ 'किरिबाती',
+ 'दक्षिण कोरिया',
+ 'लातविया',
+ 'लाओस',
+ 'उत्तर कोरिया',
+ 'दक्षिण कोसोवो',
+ 'कुवैत',
+ 'लेबनान',
+ 'लिचटीनस्टीन',
+ 'लिथुआनिया',
+ 'लक्समबर्ग',
+ 'लीबिया',
+ 'लाइबेरिया',
+ 'लेसोथो',
+ 'नेपाल',
+ 'न्यूजीलैंड',
+ 'निकारागुआ',
+ 'नाइजर',
+ 'नाउरू',
+ 'लुसिया',
+ 'रूस',
+ 'रोमानिया',
+ 'अरब',
+ 'अमीरात',
+ 'यूएई',
+ 'युगांडा',
+ 'यूक्रेन',
+ 'उरूग्वे',
+ 'उज़बेकिस्तान',
+ 'यूनाइटेड किंगडम',
+ 'वानुआतू',
+ 'वेटिकन सिटी',
+ 'वेनेजुएला',
+ 'पश्चिमी सहारा',
+ 'वियतनाम',
+ 'यमन',
+ 'ज़ायर',
+ 'जाबम्बया',
+ 'जिम्बाब्वे',
)
def city_name(self):
diff --git a/src/libs/faker/providers/address/hr_HR/__init__.py b/src/libs/faker/providers/address/hr_HR/__init__.py
index e8559e2..9f649ae 100644
--- a/src/libs/faker/providers/address/hr_HR/__init__.py
+++ b/src/libs/faker/providers/address/hr_HR/__init__.py
@@ -12,7 +12,7 @@ class Provider(AddressProvider):
address_formats = ('{{street_address}}\n{{postcode}} {{city}}', )
building_number_formats = ('###', '##', '#', '#a', '#b', '#c',
- '#a/#', '#b/#', '#c/#')
+ '#a/#', '#b/#', '#c/#')
postcode_formats = ('#####', )
diff --git a/src/libs/faker/providers/address/hu_HU/__init__.py b/src/libs/faker/providers/address/hu_HU/__init__.py
index 4e74b61..b358264 100644
--- a/src/libs/faker/providers/address/hu_HU/__init__.py
+++ b/src/libs/faker/providers/address/hu_HU/__init__.py
@@ -8,24 +8,33 @@
class Provider(AddressProvider):
street_suffixes = OrderedDict(
- (('utca', 0.75), ('út', 0.1), ('tér', 0.1), ('köz', 0.001), ('körút', 0.001), ('sétány', 0.001),))
+ (('utca', 0.75), ('út', 0.1), ('tér', 0.1), ('köz', 0.001), ('körút', 0.001), ('sétány', 0.001)))
- street_name_formats = ('{{frequent_street_name}} {{street_suffix}}', '{{real_city_name}}i {{street_suffix}}',
- '{{city_part}}{{city_suffix}}i {{street_suffix}}',
- '{{city_prefix}}{{city_part}}i {{street_suffix}}')
+ street_name_formats = (
+ '{{frequent_street_name}} {{street_suffix}}',
+ '{{real_city_name}}i {{street_suffix}}',
+ '{{city_part}}{{city_suffix}}i {{street_suffix}}',
+ '{{city_prefix}}{{city_part}}i {{street_suffix}}')
# Currently deprecated.
# secondary_address_formats = ("#.em #.", "##. em. #.")
-
- city_formats = ('{{city_prefix}}{{city_part}}{{city_suffix}}', '{{city_part}}{{city_suffix}}', '{{real_city_name}}')
+ city_formats = ('{{city_prefix}}{{city_part}}{{city_suffix}}',
+ '{{city_part}}{{city_suffix}}', '{{real_city_name}}')
street_address_formats = ('{{street_name}} {{building_number}}',)
address_formats = ("{{street_address}}\n{{postcode}} {{city}}",)
frequent_street_names = (
- 'Ady Endre', 'Dózsa György', 'Petőfi', 'Petőfi Sándor', 'Arany János', 'Béke', 'Szabadság', 'Kossuth',
+ 'Ady Endre',
+ 'Dózsa György',
+ 'Petőfi',
+ 'Petőfi Sándor',
+ 'Arany János',
+ 'Béke',
+ 'Szabadság',
+ 'Kossuth',
'József Attila')
# The 'real city name' generator includes a number of real cities of
@@ -41,28 +50,133 @@ class Provider(AddressProvider):
# of 01 January 2016 (http://www.ksh.hu/docs/hun/hnk/hnk_2016.pdf).
real_city_names = (
- 'Budapest', 'Debrecen', 'Szeged', 'Miskolc', 'Pécs', 'Győr', 'Nyíregyháza', 'Kecskemét', 'Székesfehérvár',
- 'Szombathely', 'Szolnok', 'Tatabánya', 'Érd', 'Kaposvár', 'Sopron', 'Veszprém', 'Békéscsaba', 'Zalaegerszeg',
- 'Eger', 'Nagykanizsa', 'Dunaújváros', 'Hódmezővásárhely', 'Dunakeszi', 'Szigetszentmiklós', 'Cegléd', 'Baja',
- 'Salgótarján', 'Ózd', 'Vác', 'Mosonmagyaróvár')
+ 'Budapest',
+ 'Debrecen',
+ 'Szeged',
+ 'Miskolc',
+ 'Pécs',
+ 'Győr',
+ 'Nyíregyháza',
+ 'Kecskemét',
+ 'Székesfehérvár',
+ 'Szombathely',
+ 'Szolnok',
+ 'Tatabánya',
+ 'Érd',
+ 'Kaposvár',
+ 'Sopron',
+ 'Veszprém',
+ 'Békéscsaba',
+ 'Zalaegerszeg',
+ 'Eger',
+ 'Nagykanizsa',
+ 'Dunaújváros',
+ 'Hódmezővásárhely',
+ 'Dunakeszi',
+ 'Szigetszentmiklós',
+ 'Cegléd',
+ 'Baja',
+ 'Salgótarján',
+ 'Ózd',
+ 'Vác',
+ 'Mosonmagyaróvár')
city_prefs = (
- 'kis', 'nagy', 'szent', 'duna', 'tisza', 'alsó', 'felső', 'belső', 'bakony', 'vác', 'mező', 'nyék', 'nyír',
- 'balaton', 'borsod', 'buda', 'hajdú', 'kun', 'moson', 'pilis', 'új', 'egyházas', 'dráva', 'magyar', 'mátra',
- 'somogy', 'lajos', 'bács', 'békés', 'puszta', 'orosz', 'rác', 'szerb', 'német', 'török')
+ 'kis',
+ 'nagy',
+ 'szent',
+ 'duna',
+ 'tisza',
+ 'alsó',
+ 'felső',
+ 'belső',
+ 'bakony',
+ 'vác',
+ 'mező',
+ 'nyék',
+ 'nyír',
+ 'balaton',
+ 'borsod',
+ 'buda',
+ 'hajdú',
+ 'kun',
+ 'moson',
+ 'pilis',
+ 'új',
+ 'egyházas',
+ 'dráva',
+ 'magyar',
+ 'mátra',
+ 'somogy',
+ 'lajos',
+ 'bács',
+ 'békés',
+ 'puszta',
+ 'orosz',
+ 'rác',
+ 'szerb',
+ 'német',
+ 'török')
city_parts = (
- 'híd', 'györgy', 'mindszent', 'kereszt', 'márton', 'hát', 'hetven', 'mellék', 'tamási', 'tapolca', 'fürdő',
- 'liget', 'szék', 'tót', '')
+ 'híd',
+ 'györgy',
+ 'mindszent',
+ 'kereszt',
+ 'márton',
+ 'hát',
+ 'hetven',
+ 'mellék',
+ 'tamási',
+ 'tapolca',
+ 'fürdő',
+ 'liget',
+ 'szék',
+ 'tót',
+ '')
city_suffixes = (
- 'háza', 'németi', 'devecser', 'fa', 'nádasd', 'apáti', 'falu', 'falva', 'vég', 'vár', 'vára', 'várad', 'hida',
- 'kövesd', 'bánya', 'halas', 'berény', 'kőrös', 'haraszti', 'város')
+ 'háza',
+ 'németi',
+ 'devecser',
+ 'fa',
+ 'nádasd',
+ 'apáti',
+ 'falu',
+ 'falva',
+ 'vég',
+ 'vár',
+ 'vára',
+ 'várad',
+ 'hida',
+ 'kövesd',
+ 'bánya',
+ 'halas',
+ 'berény',
+ 'kőrös',
+ 'haraszti',
+ 'város')
counties = (
- 'Bács-Kiskun', 'Baranya', 'Békés', 'Borsod-Abaúj-Zemplén', 'Csongrád', 'Fejér', 'Győr-Moson-Sopron', 'Hajdú-Bihar',
- 'Heves', 'Jász-Nagykun-Szolnok', 'Komárom-Esztergom', 'Nógrád', 'Pest', 'Somogy', 'Szabolcs-Szatmár-Bereg', 'Tolna',
- 'Vas', 'Veszprém', 'Zala')
+ 'Bács-Kiskun',
+ 'Baranya',
+ 'Békés',
+ 'Borsod-Abaúj-Zemplén',
+ 'Csongrád',
+ 'Fejér',
+ 'Győr-Moson-Sopron',
+ 'Hajdú-Bihar',
+ 'Heves',
+ 'Jász-Nagykun-Szolnok',
+ 'Komárom-Esztergom',
+ 'Nógrád',
+ 'Pest',
+ 'Somogy',
+ 'Szabolcs-Szatmár-Bereg',
+ 'Tolna',
+ 'Vas',
+ 'Veszprém',
+ 'Zala')
countries = (
"Afganisztán", "Aland-szigetek", "Albánia", "Algéria", "Amerikai Szamoa", "Amerikai Virgin-szigetek", "Andorra",
@@ -97,16 +211,17 @@ class Provider(AddressProvider):
"Thaiföld", "Togo", "Tokelau-szigetek", "Tonga", "Törökország", "Trinidad és Tobago", "Tunézia",
"Turks- és Caicos-szigetek", "Tuvalu", "Türkmenisztán", "Uganda", "Új-Kaledónia", "Új-Zéland", "Ukrajna",
"Uruguay", "Üzbegisztán", "Vanuatu", "Venezuela", "Vietnam", "Wallis és Futuna", "Zambia", "Zimbabwe",
- "Zöld-foki szigetek",)
+ "Zöld-foki szigetek")
def county(self):
return self.random_element(self.counties)
def street_address_with_county(self):
- return "{street_address}\n{county} megye\n{postcode} {city}".format(street_address=self.street_address(),
- county=self.county(),
- postcode=self.postcode(),
- city=self.city().capitalize())
+ return "{street_address}\n{county} megye\n{postcode} {city}".format(
+ street_address=self.street_address(),
+ county=self.county(),
+ postcode=self.postcode(),
+ city=self.city().capitalize())
def city_prefix(self):
return self.random_element(self.city_prefs)
@@ -121,9 +236,12 @@ def frequent_street_name(self):
return self.random_element(self.frequent_street_names)
def postcode(self):
- return "H-{}{}{}{}".format(super(Provider, self).random_digit_not_null(), super(Provider, self).random_digit(),
- super(Provider, self).random_digit(),
- super(Provider, self).random_digit())
+ return "H-{}{}{}{}".format(
+ super(
+ Provider, self).random_digit_not_null(), super(
+ Provider, self).random_digit(), super(
+ Provider, self).random_digit(), super(
+ Provider, self).random_digit())
def street_name(self):
return super(Provider, self).street_name().capitalize()
diff --git a/src/libs/faker/providers/address/id_ID/__init__.py b/src/libs/faker/providers/address/id_ID/__init__.py
index 33b6a54..56c785f 100644
--- a/src/libs/faker/providers/address/id_ID/__init__.py
+++ b/src/libs/faker/providers/address/id_ID/__init__.py
@@ -3,9 +3,10 @@
from __future__ import unicode_literals
from .. import Provider as AddressProvider
+
class Provider(AddressProvider):
- building_number_formats = ('###', '##', '#',)
+ building_number_formats = ('###', '##', '#')
city_formats = ('{{city_name}}',)
@@ -25,17 +26,18 @@ class Provider(AddressProvider):
'{{street_address}}\n{{city}}, {{state_abbr}} {{postcode}}',
)
- # From http://elibrary.dephub.go.id/elibrary/media/catalog/0010-021500000000135/swf/618/Lampiran%20E%20Data%20Bandung.pdf
+ # From
+ # http://elibrary.dephub.go.id/elibrary/media/catalog/0010-021500000000135/swf/618/Lampiran%20E%20Data%20Bandung.pdf
streets = (
- 'Abdul Muis ', 'Antapani Lama', 'Asia Afrika', 'Astana Anyar', 'BKR',
+ 'Abdul Muis', 'Antapani Lama', 'Asia Afrika', 'Astana Anyar', 'BKR',
'Cihampelas', 'Cikapayang', 'Cikutra Barat', 'Cikutra Timur',
'Ciumbuleuit', 'Ciwastra', 'Dipatiukur', 'Dipenogoro', 'Dr. Djunjunan',
'Gardujati', 'Gedebage Selatan', 'Gegerkalong Hilir',
- 'HOS. Cokroaminoto', 'Ir. H. Djuanda', 'Jakarta ', 'Jamika',
+ 'HOS. Cokroaminoto', 'Ir. H. Djuanda', 'Jakarta', 'Jamika',
'Jend. A. Yani', 'Jend. Sudirman', 'K.H. Wahid Hasyim', 'Kebonjati',
'Kiaracondong', 'Laswi', 'Lembong', 'Merdeka', 'Moch. Ramdan',
'Moch. Toha', 'Pacuan Kuda', 'Pasir Koja', 'Pasirkoja', 'Pasteur',
- 'Pelajar Pejuang', 'Peta', 'PHH. Mustofa ', 'Rajawali Barat',
+ 'Pelajar Pejuang', 'Peta', 'PHH. Mustofa', 'Rajawali Barat',
'Rajawali Timur', 'Raya Setiabudhi', 'Raya Ujungberung', 'Rumah Sakit',
'Sadang Serang', 'Sentot Alibasa', 'Setiabudhi', 'Siliwangi',
'Soekarno Hatta', 'Sukabumi', 'Sukajadi', 'Suniaraja', 'Surapati',
@@ -52,7 +54,8 @@ class Provider(AddressProvider):
'Jl.', 'Lr.', 'Gg.',
)
- # From https://id.wikipedia.org/wiki/Daftar_kabupaten_dan_kota_di_Indonesia#Daftar_kota
+ # From
+ # https://id.wikipedia.org/wiki/Daftar_kabupaten_dan_kota_di_Indonesia#Daftar_kota
cities = (
'Ambon', 'Balikpapan', 'Banda Aceh', 'Bandar Lampung', 'Bandung',
'Banjar', 'Banjarbaru', 'Banjarmasin', 'Batam', 'Batu', 'Bau-Bau',
@@ -89,13 +92,13 @@ class Provider(AddressProvider):
'Sumatera Selatan', 'Sumatera Utara',
)
- # Currently this is my own work
+ # https://id.wikipedia.org/wiki/Daftar_provinsi_di_Indonesia
states_abbr = (
- 'Aceh', 'Bali', 'Banten', 'Bengkulu', 'DIY', 'DKI', 'Gorontalo',
- 'Jambi', 'Jabar', 'Jateng', 'Jatim', 'Kalbar', 'Kalsel', 'Kalteng',
- 'Kaltim', 'Kalut', 'Babel', 'Kepri', 'Lampung', 'Maluku', 'Malut',
- 'NTB', 'NTT', 'Papua', 'Papbar', 'Riau', 'Sulbar', 'Sulsel', 'Sulteng',
- 'Sultra', 'Sulut', 'Sumbar', 'Sumsel', 'Sumut',
+ 'AC', 'BA', 'BT', 'BE', 'YO', 'JK', 'GO',
+ 'JA', 'JB', 'JT', 'JI', 'KB', 'KS', 'KT',
+ 'KI', 'KU', 'BB', 'KR', 'LA', 'MA', 'MU',
+ 'NB', 'NT', 'PA', 'PB', 'RI', 'SR', 'SN', 'ST',
+ 'SG', 'SU', 'SB', 'SS', 'SU',
)
# From https://id.wikipedia.org/wiki/Daftar_negara-negara_di_dunia
diff --git a/src/libs/faker/providers/address/it_IT/__init__.py b/src/libs/faker/providers/address/it_IT/__init__.py
index 4eef336..2705918 100644
--- a/src/libs/faker/providers/address/it_IT/__init__.py
+++ b/src/libs/faker/providers/address/it_IT/__init__.py
@@ -7,11 +7,11 @@ class Provider(AddressProvider):
city_prefixes = ('San', 'Borgo', 'Sesto', 'Quarto', 'Settimo')
city_suffixes = ('a mare', 'lido', 'ligure', 'del friuli', 'salentino',
'calabro', 'veneto', 'nell\'emilia', 'umbro', 'laziale',
- 'terme', 'sardo', )
+ 'terme', 'sardo')
building_number_formats = ('###', '##', '#')
street_suffixes = ('Piazza', 'Strada', 'Via', 'Borgo', 'Contrada',
'Rotonda', 'Incrocio', 'Viale', 'Stretto', 'Vicolo',
- 'Canale', )
+ 'Canale')
postcode_formats = ('#####', )
states = ('Agrigento', 'Alessandria', 'Ancona', 'Aosta', 'Arezzo',
'Ascoli Piceno', 'Asti', 'Avellino', 'Bari',
@@ -34,7 +34,7 @@ class Provider(AddressProvider):
'Sondrio', 'Taranto', 'Teramo', 'Terni', 'Torino', 'Ogliastra',
'Trapani', 'Trento', 'Treviso', 'Trieste', 'Udine', 'Varese',
'Venezia', 'Verbano-Cusio-Ossola', 'Vercelli', 'Verona',
- 'Vibo Valentia', 'Vicenza', 'Viterbo', )
+ 'Vibo Valentia', 'Vicenza', 'Viterbo')
states_abbr = ('AG', 'AL', 'AN', 'AO', 'AR', 'AP', 'AT', 'AV', 'BA', 'BT',
'BL', 'BN', 'BG', 'BI', 'BO', 'BZ', 'BS', 'BR', 'CA', 'CL',
'CB', 'CI', 'CE', 'CT', 'CZ', 'CH', 'CO', 'CS', 'CR', 'KR',
@@ -45,8 +45,7 @@ class Provider(AddressProvider):
'PE', 'PC', 'PI', 'PT', 'PN', 'PZ', 'PO', 'RG', 'RA', 'RC',
'RE', 'RI', 'RN', 'RM', 'RO', 'SA', 'VS', 'SS', 'SV', 'SI',
'SR', 'SO', 'TA', 'TE', 'TR', 'TO', 'OG', 'TP', 'TN', 'TV',
- 'TS', 'UD', 'VA', 'VE', 'VB', 'VC', 'VR', 'VV', 'VI',
- 'VT', )
+ 'TS', 'UD', 'VA', 'VE', 'VB', 'VC', 'VR', 'VV', 'VI', 'VT')
countries = (
'Afghanistan', 'Albania', 'Algeria', 'American Samoa', 'Andorra',
'Angola', 'Anguilla', 'Antartide (territori a sud del 60° parallelo)',
@@ -101,17 +100,17 @@ class Provider(AddressProvider):
'Emirati Arabi Uniti', 'Regno Unito', 'Stati Uniti d\'America',
'United States Minor Outlying Islands', 'Isole Vergini Statunitensi',
'Uruguay', 'Uzbekistan', 'Vanuatu', 'Venezuela', 'Vietnam',
- 'Wallis and Futuna', 'Western Sahara', 'Yemen', 'Zambia', 'Zimbabwe', )
+ 'Wallis and Futuna', 'Western Sahara', 'Yemen', 'Zambia', 'Zimbabwe')
city_formats = ('{{city_prefix}} {{first_name}} {{city_suffix}}',
'{{city_prefix}} {{first_name}}',
'{{first_name}} {{city_suffix}}',
- '{{last_name}} {{city_suffix}}', )
+ '{{last_name}} {{city_suffix}}')
street_name_formats = ('{{street_suffix}} {{first_name}}',
'{{street_suffix}} {{last_name}}')
street_address_formats = (
'{{street_name}} {{building_number}}',
- '{{street_name}} {{building_number}} {{secondary_address}}', )
+ '{{street_name}} {{building_number}} {{secondary_address}}')
address_formats = (
"{{street_address}}\n{{city}}, {{postcode}} {{state}} ({{state_abbr}})",
)
diff --git a/src/libs/faker/providers/address/ja_JP/__init__.py b/src/libs/faker/providers/address/ja_JP/__init__.py
index fb1c65d..70182fb 100644
--- a/src/libs/faker/providers/address/ja_JP/__init__.py
+++ b/src/libs/faker/providers/address/ja_JP/__init__.py
@@ -8,34 +8,255 @@ class Provider(AddressProvider):
address_formats = (
'{{prefecture}}{{city}}{{town}}{{chome}}{{ban}}{{gou}}',
'{{prefecture}}{{city}}{{town}}{{chome}}{{ban}}{{gou}} {{town}}{{building_name}}{{building_number}}',
- '{{prefecture}}{{city}}{{town}}{{chome}}{{ban}}{{gou}} {{building_name}}{{town}}{{building_number}}', )
+ '{{prefecture}}{{city}}{{town}}{{chome}}{{ban}}{{gou}} {{building_name}}{{town}}{{building_number}}')
building_number_formats = ('###', )
countries = (
- 'アフガニスタン', 'アルバニア', 'アルジェリア', 'アメリカ領サモア', 'アンドラ', 'アンゴラ', 'アンギラ', '南極大陸', 'アンティグアバーブーダ', 'アルゼンチン', 'アルメニア', 'アルバ', 'オーストラリア', 'オーストリア', 'アゼルバイジャン',
- 'バハマ', 'バーレーン', 'バングラデシュ', 'バルバドス', 'ベラルーシ', 'ベルギー', 'ベリーズ', 'ベナン', 'バミューダ島', 'ブータン', 'ボリビア', 'ボスニア・ヘルツェゴビナ', 'ボツワナ', 'ブーベ島', 'ブラジル', 'イギリス領インド洋地域', 'イギリス領ヴァージン諸島', 'ブルネイ', 'ブルガリア', 'ブルキナファソ', 'ブルンジ',
- 'カンボジア', 'カメルーン', 'カナダ', 'カーボベルデ', 'ケイマン諸島', '中央アフリカ共和国', 'チャド', 'チリ', '中国', 'クリスマス島', 'ココス諸島', 'コロンビア', 'コモロ', 'コンゴ共和国', 'クック諸島', 'コスタリカ', 'コートジボワール', 'クロアチア', 'キューバ', 'キプロス共和国', 'チェコ共和国',
- 'デンマーク', 'ジブチ共和国', 'ドミニカ国', 'ドミニカ共和国',
- 'エクアドル', 'エジプト', 'エルサルバドル', '赤道ギニア共和国', 'エリトリア', 'エストニア', 'エチオピア',
- 'フェロー諸島', 'フォークランド諸島', 'フィジー共和国', 'フィンランド', 'フランス', 'フランス領ギアナ', 'フランス領ポリネシア', 'フランス領極南諸島',
- 'ガボン', 'ガンビア', 'グルジア', 'ドイツ', 'ガーナ', 'ジブラルタル', 'ギリシャ', 'グリーンランド', 'グレナダ', 'グアドループ', 'グアム', 'グアテマラ', 'ガーンジー', 'ギニア', 'ギニアビサウ', 'ガイアナ',
- 'ハイチ', 'ハード島とマクドナルド諸島', 'バチカン市国', 'ホンジュラス', '香港', 'ハンガリー',
- 'アイスランド', 'インド', 'インドネシア', 'イラン', 'イラク', 'アイルランド共和国', 'マン島', 'イスラエル', 'イタリア',
- 'ジャマイカ', '日本', 'ジャージー島', 'ヨルダン',
- 'カザフスタン', 'ケニア', 'キリバス', '朝鮮', '韓国', 'クウェート', 'キルギス共和国',
- 'ラオス人民民主共和国', 'ラトビア', 'レバノン', 'レソト', 'リベリア', 'リビア国', 'リヒテンシュタイン', 'リトアニア', 'ルクセンブルク',
- 'マカオ', 'マケドニア共和国', 'マダガスカル', 'マラウィ', 'マレーシア', 'モルディブ', 'マリ', 'マルタ共和国', 'マーシャル諸島', 'マルティニーク', 'モーリタニア・イスラム共和国', 'モーリシャス', 'マヨット', 'メキシコ', 'ミクロネシア連邦', 'モルドバ共和国', 'モナコ公国', 'モンゴル', 'モンテネグロ共和国', 'モントセラト', 'モロッコ', 'モザンビーク', 'ミャンマー',
- 'ナミビア', 'ナウル', 'ネパール', 'オランダ領アンティル', 'オランダ', 'ニューカレドニア', 'ニュージーランド', 'ニカラグア', 'ニジェール', 'ナイジェリア', 'ニース', 'ノーフォーク島', '北マリアナ諸島', 'ノルウェー',
+ 'アフガニスタン',
+ 'アルバニア',
+ 'アルジェリア',
+ 'アメリカ領サモア',
+ 'アンドラ',
+ 'アンゴラ',
+ 'アンギラ',
+ '南極大陸',
+ 'アンティグアバーブーダ',
+ 'アルゼンチン',
+ 'アルメニア',
+ 'アルバ',
+ 'オーストラリア',
+ 'オーストリア',
+ 'アゼルバイジャン',
+ 'バハマ',
+ 'バーレーン',
+ 'バングラデシュ',
+ 'バルバドス',
+ 'ベラルーシ',
+ 'ベルギー',
+ 'ベリーズ',
+ 'ベナン',
+ 'バミューダ島',
+ 'ブータン',
+ 'ボリビア',
+ 'ボスニア・ヘルツェゴビナ',
+ 'ボツワナ',
+ 'ブーベ島',
+ 'ブラジル',
+ 'イギリス領インド洋地域',
+ 'イギリス領ヴァージン諸島',
+ 'ブルネイ',
+ 'ブルガリア',
+ 'ブルキナファソ',
+ 'ブルンジ',
+ 'カンボジア',
+ 'カメルーン',
+ 'カナダ',
+ 'カーボベルデ',
+ 'ケイマン諸島',
+ '中央アフリカ共和国',
+ 'チャド',
+ 'チリ',
+ '中国',
+ 'クリスマス島',
+ 'ココス諸島',
+ 'コロンビア',
+ 'コモロ',
+ 'コンゴ共和国',
+ 'クック諸島',
+ 'コスタリカ',
+ 'コートジボワール',
+ 'クロアチア',
+ 'キューバ',
+ 'キプロス共和国',
+ 'チェコ共和国',
+ 'デンマーク',
+ 'ジブチ共和国',
+ 'ドミニカ国',
+ 'ドミニカ共和国',
+ 'エクアドル',
+ 'エジプト',
+ 'エルサルバドル',
+ '赤道ギニア共和国',
+ 'エリトリア',
+ 'エストニア',
+ 'エチオピア',
+ 'フェロー諸島',
+ 'フォークランド諸島',
+ 'フィジー共和国',
+ 'フィンランド',
+ 'フランス',
+ 'フランス領ギアナ',
+ 'フランス領ポリネシア',
+ 'フランス領極南諸島',
+ 'ガボン',
+ 'ガンビア',
+ 'グルジア',
+ 'ドイツ',
+ 'ガーナ',
+ 'ジブラルタル',
+ 'ギリシャ',
+ 'グリーンランド',
+ 'グレナダ',
+ 'グアドループ',
+ 'グアム',
+ 'グアテマラ',
+ 'ガーンジー',
+ 'ギニア',
+ 'ギニアビサウ',
+ 'ガイアナ',
+ 'ハイチ',
+ 'ハード島とマクドナルド諸島',
+ 'バチカン市国',
+ 'ホンジュラス',
+ '香港',
+ 'ハンガリー',
+ 'アイスランド',
+ 'インド',
+ 'インドネシア',
+ 'イラン',
+ 'イラク',
+ 'アイルランド共和国',
+ 'マン島',
+ 'イスラエル',
+ 'イタリア',
+ 'ジャマイカ',
+ '日本',
+ 'ジャージー島',
+ 'ヨルダン',
+ 'カザフスタン',
+ 'ケニア',
+ 'キリバス',
+ '朝鮮',
+ '韓国',
+ 'クウェート',
+ 'キルギス共和国',
+ 'ラオス人民民主共和国',
+ 'ラトビア',
+ 'レバノン',
+ 'レソト',
+ 'リベリア',
+ 'リビア国',
+ 'リヒテンシュタイン',
+ 'リトアニア',
+ 'ルクセンブルク',
+ 'マカオ',
+ 'マケドニア共和国',
+ 'マダガスカル',
+ 'マラウィ',
+ 'マレーシア',
+ 'モルディブ',
+ 'マリ',
+ 'マルタ共和国',
+ 'マーシャル諸島',
+ 'マルティニーク',
+ 'モーリタニア・イスラム共和国',
+ 'モーリシャス',
+ 'マヨット',
+ 'メキシコ',
+ 'ミクロネシア連邦',
+ 'モルドバ共和国',
+ 'モナコ公国',
+ 'モンゴル',
+ 'モンテネグロ共和国',
+ 'モントセラト',
+ 'モロッコ',
+ 'モザンビーク',
+ 'ミャンマー',
+ 'ナミビア',
+ 'ナウル',
+ 'ネパール',
+ 'オランダ領アンティル',
+ 'オランダ',
+ 'ニューカレドニア',
+ 'ニュージーランド',
+ 'ニカラグア',
+ 'ニジェール',
+ 'ナイジェリア',
+ 'ニース',
+ 'ノーフォーク島',
+ '北マリアナ諸島',
+ 'ノルウェー',
'オマーン',
- 'パキスタン', 'パラオ', 'パレスチナ自治区', 'パナマ', 'パプアニューギニア', 'パラグアイ', 'ペルー', 'フィリピン', 'ピトケアン諸島', 'ポーランド', 'ポルトガル', 'プエルトリコ',
+ 'パキスタン',
+ 'パラオ',
+ 'パレスチナ自治区',
+ 'パナマ',
+ 'パプアニューギニア',
+ 'パラグアイ',
+ 'ペルー',
+ 'フィリピン',
+ 'ピトケアン諸島',
+ 'ポーランド',
+ 'ポルトガル',
+ 'プエルトリコ',
'カタール',
- 'レユニオン', 'ルーマニア', 'ロシア', 'ルワンダ',
- 'サン・バルテルミー島', 'セントヘレナ', 'セントクリストファー・ネイビス連邦', 'セントルシア', 'セント・マーチン島', 'サンピエール島・ミクロン島', 'セントビンセント・グレナディーン', 'サモア', 'サンマリノ', 'サントメプリンシペ', 'サウジアラビア', 'セネガル', 'セルビア', 'セイシェル', 'シエラレオネ', 'シンガポール', 'スロバキア', 'スロベニア', 'ソロモン諸島', 'ソマリア', '南アフリカ共和国', 'サウスジョージア・サウスサンドウィッチ諸島', 'スペイン', 'スリランカ', 'スーダン', 'スリナム', 'スヴァールバル諸島およびヤンマイエン島', 'スワジランド王国', 'スウェーデン', 'スイス', 'シリア',
- '台湾', 'タジキスタン共和国', 'タンザニア', 'タイ', '東ティモール', 'トーゴ', 'トケラウ', 'トンガ', 'トリニダード・トバゴ', 'チュニジア', 'トルコ', 'トルクメニスタン', 'タークス・カイコス諸島', 'ツバル',
- 'ウガンダ', 'ウクライナ', 'アラブ首長国連邦', 'イギリス', 'アメリカ合衆国', '合衆国領有小離島', 'アメリカ領ヴァージン諸島', 'ウルグアイ', 'ウズベキスタン',
- 'バヌアツ', 'ベネズエラ', 'ベトナム',
- 'ウォリス・フツナ', '西サハラ', 'イエメン', 'ザンビア', 'ジンバブエ',
+ 'レユニオン',
+ 'ルーマニア',
+ 'ロシア',
+ 'ルワンダ',
+ 'サン・バルテルミー島',
+ 'セントヘレナ',
+ 'セントクリストファー・ネイビス連邦',
+ 'セントルシア',
+ 'セント・マーチン島',
+ 'サンピエール島・ミクロン島',
+ 'セントビンセント・グレナディーン',
+ 'サモア',
+ 'サンマリノ',
+ 'サントメプリンシペ',
+ 'サウジアラビア',
+ 'セネガル',
+ 'セルビア',
+ 'セイシェル',
+ 'シエラレオネ',
+ 'シンガポール',
+ 'スロバキア',
+ 'スロベニア',
+ 'ソロモン諸島',
+ 'ソマリア',
+ '南アフリカ共和国',
+ 'サウスジョージア・サウスサンドウィッチ諸島',
+ 'スペイン',
+ 'スリランカ',
+ 'スーダン',
+ 'スリナム',
+ 'スヴァールバル諸島およびヤンマイエン島',
+ 'スワジランド王国',
+ 'スウェーデン',
+ 'スイス',
+ 'シリア',
+ '台湾',
+ 'タジキスタン共和国',
+ 'タンザニア',
+ 'タイ',
+ '東ティモール',
+ 'トーゴ',
+ 'トケラウ',
+ 'トンガ',
+ 'トリニダード・トバゴ',
+ 'チュニジア',
+ 'トルコ',
+ 'トルクメニスタン',
+ 'タークス・カイコス諸島',
+ 'ツバル',
+ 'ウガンダ',
+ 'ウクライナ',
+ 'アラブ首長国連邦',
+ 'イギリス',
+ 'アメリカ合衆国',
+ '合衆国領有小離島',
+ 'アメリカ領ヴァージン諸島',
+ 'ウルグアイ',
+ 'ウズベキスタン',
+ 'バヌアツ',
+ 'ベネズエラ',
+ 'ベトナム',
+ 'ウォリス・フツナ',
+ '西サハラ',
+ 'イエメン',
+ 'ザンビア',
+ 'ジンバブエ',
)
prefectures = (
@@ -43,7 +264,7 @@ class Provider(AddressProvider):
'埼玉県', '千葉県', '東京都', '神奈川県', '新潟県', '富山県', '石川県', '福井県', '山梨県', '長野県',
'岐阜県', '静岡県', '愛知県', '三重県', '滋賀県', '京都府', '大阪府', '兵庫県', '奈良県', '和歌山県',
'鳥取県', '島根県', '岡山県', '広島県', '山口県', '徳島県', '香川県', '愛媛県', '高知県', '福岡県',
- '佐賀県', '長崎県', '熊本県', '大分県', '宮崎県', '鹿児島県', '沖縄県'
+ '佐賀県', '長崎県', '熊本県', '大分県', '宮崎県', '鹿児島県', '沖縄県',
)
cities = (
@@ -61,7 +282,7 @@ class Provider(AddressProvider):
'御蔵島村', '八丈島八丈町', '青ヶ島村', '小笠原村', '横浜市鶴見区', '横浜市神奈川区', '横浜市西区', '横浜市中区',
'横浜市南区', '横浜市保土ケ谷区', '横浜市磯子区', '横浜市金沢区', '横浜市港北区', '横浜市戸塚区', '横浜市港南区',
'横浜市旭区', '横浜市緑区', '横浜市瀬谷区', '横浜市栄区', '横浜市泉区', '横浜市青葉区', '横浜市都筑区',
- '川崎市川崎区', '川崎市幸区', '川崎市中原区', '川崎市高津区', '川崎市多摩区', '川崎市宮前区'
+ '川崎市川崎区', '川崎市幸区', '川崎市中原区', '川崎市高津区', '川崎市多摩区', '川崎市宮前区',
)
towns = (
@@ -77,7 +298,7 @@ class Provider(AddressProvider):
'台場', '高輪', '虎ノ門', '虎ノ門虎ノ門ヒルズ森タワー', '大京町', '高田馬場', '箪笥町', '津久戸町', '筑土八幡町',
'戸塚町', '富久町', '戸山', '秋葉原', '浅草', '浅草橋', '池之端', '今戸', '入谷', '上野公園', '上野桜木',
'雷門', '北上野', '蔵前', '千束', '台東', '鳥越', '西浅草', '日本堤', '橋場', '花川戸', '東浅草', '東上野',
- '松が谷', '三筋', '三ノ輪', '元浅草', '竜泉', '吾妻橋'
+ '松が谷', '三筋', '三ノ輪', '元浅草', '竜泉', '吾妻橋',
)
building_names = (
@@ -126,8 +347,12 @@ def building_name(self):
"""
return self.random_element(self.building_names)
- def zipcode(self):
+ def postcode(self):
"""
:example '101-1212'
"""
- return "%03d-%04d" % (self.generator.random.randint(0, 999), self.generator.random.randint(0, 9999))
+ return "%03d-%04d" % (self.generator.random.randint(0, 999),
+ self.generator.random.randint(0, 9999))
+
+ def zipcode(self):
+ return self.postcode()
diff --git a/src/libs/faker/providers/address/ko_KR/__init__.py b/src/libs/faker/providers/address/ko_KR/__init__.py
index 952572e..18d8e81 100644
--- a/src/libs/faker/providers/address/ko_KR/__init__.py
+++ b/src/libs/faker/providers/address/ko_KR/__init__.py
@@ -207,8 +207,8 @@ class Provider(AddressProvider):
'키르기스스탄', '키리바시', '키프로스', '타이', '타지키스탄', '탄자니아', '터키',
'토고', '통가', '투르크메니스탄', '투발루', '튀니지', '트리니다드 토바고', '파나마',
'파라과이', '파키스탄', '파푸아 뉴기니', '팔라우', '페루', '포르투갈', '폴란드', '프랑스',
- '피지', '핀란드', '필리핀', '헝가리'
- )
+ '피지', '핀란드', '필리핀', '헝가리',
+ )
building_dongs = (
'가',
'나',
@@ -381,8 +381,14 @@ def old_postal_code(self):
"""
return self.bothify(self.random_element(self.postcode_formats))
- def postal_code(self):
+ def postcode(self):
"""
:example 12345
"""
return self.bothify(self.random_element(self.new_postal_code_formats))
+
+ def postal_code(self):
+ """
+ :example 12345
+ """
+ return self.postcode()
diff --git a/src/libs/faker/providers/address/ne_NP/__init__.py b/src/libs/faker/providers/address/ne_NP/__init__.py
index 38d1a7b..0359631 100644
--- a/src/libs/faker/providers/address/ne_NP/__init__.py
+++ b/src/libs/faker/providers/address/ne_NP/__init__.py
@@ -17,67 +17,570 @@ class Provider(AddressProvider):
)
street_suffixes = (
- 'मार्ग', 'आश्रम', 'बाटो', 'पथ', 'गल्ली', 'गेट', 'हाईट', 'टार', 'रोड', 'कुना', 'चौर', 'निवास',
+ 'मार्ग',
+ 'आश्रम',
+ 'बाटो',
+ 'पथ',
+ 'गल्ली',
+ 'गेट',
+ 'हाईट',
+ 'टार',
+ 'रोड',
+ 'कुना',
+ 'चौर',
+ 'निवास',
)
building_prefixes = ('वडा', 'घर')
# https://en.wikipedia.org/wiki/List_of_sovereign_states
countries = (
- 'अंगोला', 'अक्रोटिरी र धेकेलिया', 'अजरबैजान', 'अफगानिस्तान', 'अमेरिकी सामोआ', 'अरुबा', 'अर्जेन्टिना', 'अर्मेनिया', 'अलडेर्नी', 'अल्जेरिया', 'अल्बानिया', 'अस्ट्रिया',
- 'अस्ट्रेलिया', 'आइजल अफ म्यान', 'आइभोरी कोस्ट', 'आइसल्याण्ड', 'आजाद कश्मीर', 'आयरल्याण्ड', 'इक्वेटोरियल गिनी', 'इक्वेडर', 'इजरायल', 'इटाली', 'इण्डोनेशिया',
- 'इथियोपिया', 'इराक', 'इरान', 'इस्टोनिया', 'उज्बेकिस्तान', 'उत्तर कोरिया', 'उत्तरी मारिआना टापु', 'उत्तरी साइप्रस', 'उरुग्वे', 'एङगुइला', 'एण्डोरा', 'एन्टिगुआ र बर्बुडा',
- 'एरिट्रिया', 'एल साल्भादोर', 'एशमोर र कर्टियर टापु', 'ओमान', 'कजाख्स्तान', 'कतार', 'कम्बोडिया', 'किरिबाटी', 'किर्गिजस्तान', 'कुक द्वीप', 'कुराकाओ', 'कुवैत', 'केन्या',
- 'केप भर्ड', 'केम्यान टापु', 'कोकोस टापु', 'कोटे डी आइभोरी', 'कोमोरोस', 'कोरल सी टापु क्षेत्र', 'कोलम्बिया', 'कोसोभो', 'कोस्टारिका', 'क्यानडा', 'क्यामेरून', 'क्युबा',
- 'क्रिसमस टापु', 'क्रोएसिया', 'क्लिप्परटन द्वीप', 'क्वीन माउड ल्याण्ड', 'गणतन्त्र कङ्गो', 'गणतन्त्र कोरिया', 'गणतन्त्र स्पर्स्का', 'गाबोन', 'गिनी', 'गिब्राल्टार', 'गिलगीत',
- 'गुयना', 'गुर्न्जी', 'ग्रिनाडा', 'ग्रीनल्याण्ड', 'ग्रीस', 'ग्वाटेमाला', 'ग्वाम', 'घाना', 'चाड', 'चिली', 'चीन', 'चेक गणतन्त्र', 'जमैका', 'जर्मनी', 'जर्सी', 'जापान', 'जाम्बिया',
- 'जिबुटी', 'जोर्डन', 'टर्की', 'टिमोर', 'टुभालु', 'टुर्क्स तथा काइकोस टापु', 'टोंगा', 'टोकेलाउ', 'टोगो', 'ट्युनिसिया', 'ट्रान्सनिसट्रिया', 'ट्रिनिडाड र टोबागो', 'डेनमार्क',
- 'डोमिनिकन गणतन्त्र', 'डोमिनिका', 'तन्जानिया', 'ताइवान', 'ताजिकिस्तान', 'तुर्कमेनिस्तान', 'थाइल्याण्ड', 'दक्षिण अफ्रिका', 'दक्षिण ओसेटिया', 'दक्षिण कोरिया',
- 'दक्षिण जर्जिया तथा दक्षिण स्याण्डवीच टापु', 'दक्षिणी सुडान', 'नर्वे', 'नर्वेको', 'नाइजर', 'नाइजेरिया', 'नाउरु', 'नागोर्नो', 'नामिबिया', 'निकाराग्वा', 'नियु',
- 'नेदरल्याण्ड', 'नेपाल', 'नोर्फोक टापु', 'न्यु क्यालोडेनिया', 'न्युजिल्यान्ड', 'पपुवा न्युगिनी', 'पलाउ', 'पाकिस्तान', 'पानामा', 'पाराग्वे', 'पिटकेर्न टापु', 'पिटर द्वीप',
- 'पूर्वी टिमोर', 'पेरु', 'पोर्चुगल', 'पोल्याण्ड', 'प्यालेस्टाइन', 'प्युर्तो रिको', 'प्रजातान्त्रिक गणतन्त्र कंगो', 'प्रजातान्त्रिक गणतन्त्र कोरिया', 'प्रिडेनेस्ट्रोभी',
- 'फकल्याण्ड टापु', 'फरोइ टापु', 'फिजी', 'फिनल्याण्ड', 'फिलिपिन्स', 'फ्रान्स', 'फ्रेन्च दक्षिणी र अन्टार्कटिक द्वीप', 'फ्रेन्च पोलिनेसिया', 'बंगलादेश', 'बर्मा',
- 'बर्मुडा', 'बहराइन', 'बहामस', 'बार्बाडोस', 'बुरुन्डी', 'बुर्किना फासो', 'बुल्गेरिया', 'बेनिन', 'बेलारूस', 'बेलिज', 'बेल्जियम', 'बोत्स्वाना', 'बोलिभिया',
- 'बोस्निया र हर्जगोभिना', 'बोस्निया र हर्जगोभिना संघ', 'बौभेट द्वीप', 'ब्राजिल', 'ब्रिटिस भर्जिन टापु', 'ब्रुनेई', 'भानुअटु', 'भारत', 'भियतनाम', 'भुटान',
- 'भेनेजुएला', 'भ्याटिकन', 'भ्याटिकन सिटी', 'मकाउ', 'मङ्गोलिया', 'मध्य अफ्रिकी गणतन्त्र', 'मलावी', 'मलेशिया', 'माइक्रोनेसियाको संघीय राज्य', 'माडागास्कर',
- 'मार्शल द्वीप', 'माली', 'माल्टा', 'माल्दिभ्स', 'मिश्र', 'मेक्सिको', 'मोजाम्बिक', 'मोनाको', 'मोन्टसेराट', 'मोन्टेनेग्रो', 'मोरक्को', 'मोल्डोभा', 'मौरिसनिया', 'मौरिसस',
- 'म्यानमार', 'म्यासेडोनिया', 'यमन', 'युक्रेन', 'युगान्डा', 'रसिया', 'रुवाण्डा', 'रोमानिया', 'रोस डिपेन्डेन्सी', 'लक्जेम्बर्ग', 'लाईबेरिया', 'लाओस', 'लात्भिया', 'लिचटेन्स्टाइन',
- 'लिथुआनिया', 'लिबिया', 'लेबनान', 'लेसोथो', 'वाल्लिस र फुटुना', 'श्रीलंका', 'संघीय राज्य माइक्रोनेसिया', 'संयुक्त अधिराज्य', 'संयुक्त अरब इमिरेट्स', 'संयुक्त राज्य अमेरिका',
- 'संयुक्त राज्य भर्जिन टापु', 'सर्बिया', 'साइप्रस', 'साउदी अरब', 'साओ टोमे र प्रिन्सिपे', 'सान मारिनो', 'साबा', 'सामोआ', 'साहरवी अरब लोकतान्त्रिक गणतन्त्र', 'सिंगापुर',
- 'सिन्ट मार्टिन', 'सीरियन कुर्दिस्तान', 'सीरिया', 'सुडान', 'सुरिनेम', 'सेनेगल', 'सेन्ट किट्स र नेभिस', 'सेन्ट पियेर्रे र मिकुएलन', 'सेन्ट बार्थेलेमी', 'सेन्ट भिन्सेन्ट र ग्रेनाडाइन्स',
- 'सेन्ट मार्टिन', 'सेन्ट लुसिया', 'सेन्ट हेलेना', 'सेरा लियोन', 'सेसेल्स', 'सोमालिया', 'सोमालील्याण्ड', 'सोलोमन द्वीप', 'स्पेन', 'स्लोभाकिया', 'स्लोभेनिया', 'स्वाजिल्याण्ड',
- 'स्विजरल्याण्ड', 'स्वीडेन', 'हंगेरी', 'हङकङ', 'हर्म', 'हाइटी', 'हेयर्ड द्वीप र म्याकडोनाल्ड टापु', 'होन्डुरस',
- 'अबखाजिया', 'जर्जिया',
+ 'अंगोला',
+ 'अक्रोटिरी र धेकेलिया',
+ 'अजरबैजान',
+ 'अफगानिस्तान',
+ 'अमेरिकी सामोआ',
+ 'अरुबा',
+ 'अर्जेन्टिना',
+ 'अर्मेनिया',
+ 'अलडेर्नी',
+ 'अल्जेरिया',
+ 'अल्बानिया',
+ 'अस्ट्रिया',
+ 'अस्ट्रेलिया',
+ 'आइजल अफ म्यान',
+ 'आइभोरी कोस्ट',
+ 'आइसल्याण्ड',
+ 'आजाद कश्मीर',
+ 'आयरल्याण्ड',
+ 'इक्वेटोरियल गिनी',
+ 'इक्वेडर',
+ 'इजरायल',
+ 'इटाली',
+ 'इण्डोनेशिया',
+ 'इथियोपिया',
+ 'इराक',
+ 'इरान',
+ 'इस्टोनिया',
+ 'उज्बेकिस्तान',
+ 'उत्तर कोरिया',
+ 'उत्तरी मारिआना टापु',
+ 'उत्तरी साइप्रस',
+ 'उरुग्वे',
+ 'एङगुइला',
+ 'एण्डोरा',
+ 'एन्टिगुआ र बर्बुडा',
+ 'एरिट्रिया',
+ 'एल साल्भादोर',
+ 'एशमोर र कर्टियर टापु',
+ 'ओमान',
+ 'कजाख्स्तान',
+ 'कतार',
+ 'कम्बोडिया',
+ 'किरिबाटी',
+ 'किर्गिजस्तान',
+ 'कुक द्वीप',
+ 'कुराकाओ',
+ 'कुवैत',
+ 'केन्या',
+ 'केप भर्ड',
+ 'केम्यान टापु',
+ 'कोकोस टापु',
+ 'कोटे डी आइभोरी',
+ 'कोमोरोस',
+ 'कोरल सी टापु क्षेत्र',
+ 'कोलम्बिया',
+ 'कोसोभो',
+ 'कोस्टारिका',
+ 'क्यानडा',
+ 'क्यामेरून',
+ 'क्युबा',
+ 'क्रिसमस टापु',
+ 'क्रोएसिया',
+ 'क्लिप्परटन द्वीप',
+ 'क्वीन माउड ल्याण्ड',
+ 'गणतन्त्र कङ्गो',
+ 'गणतन्त्र कोरिया',
+ 'गणतन्त्र स्पर्स्का',
+ 'गाबोन',
+ 'गिनी',
+ 'गिब्राल्टार',
+ 'गिलगीत',
+ 'गुयना',
+ 'गुर्न्जी',
+ 'ग्रिनाडा',
+ 'ग्रीनल्याण्ड',
+ 'ग्रीस',
+ 'ग्वाटेमाला',
+ 'ग्वाम',
+ 'घाना',
+ 'चाड',
+ 'चिली',
+ 'चीन',
+ 'चेक गणतन्त्र',
+ 'जमैका',
+ 'जर्मनी',
+ 'जर्सी',
+ 'जापान',
+ 'जाम्बिया',
+ 'जिबुटी',
+ 'जोर्डन',
+ 'टर्की',
+ 'टिमोर',
+ 'टुभालु',
+ 'टुर्क्स तथा काइकोस टापु',
+ 'टोंगा',
+ 'टोकेलाउ',
+ 'टोगो',
+ 'ट्युनिसिया',
+ 'ट्रान्सनिसट्रिया',
+ 'ट्रिनिडाड र टोबागो',
+ 'डेनमार्क',
+ 'डोमिनिकन गणतन्त्र',
+ 'डोमिनिका',
+ 'तन्जानिया',
+ 'ताइवान',
+ 'ताजिकिस्तान',
+ 'तुर्कमेनिस्तान',
+ 'थाइल्याण्ड',
+ 'दक्षिण अफ्रिका',
+ 'दक्षिण ओसेटिया',
+ 'दक्षिण कोरिया',
+ 'दक्षिण जर्जिया तथा दक्षिण स्याण्डवीच टापु',
+ 'दक्षिणी सुडान',
+ 'नर्वे',
+ 'नर्वेको',
+ 'नाइजर',
+ 'नाइजेरिया',
+ 'नाउरु',
+ 'नागोर्नो',
+ 'नामिबिया',
+ 'निकाराग्वा',
+ 'नियु',
+ 'नेदरल्याण्ड',
+ 'नेपाल',
+ 'नोर्फोक टापु',
+ 'न्यु क्यालोडेनिया',
+ 'न्युजिल्यान्ड',
+ 'पपुवा न्युगिनी',
+ 'पलाउ',
+ 'पाकिस्तान',
+ 'पानामा',
+ 'पाराग्वे',
+ 'पिटकेर्न टापु',
+ 'पिटर द्वीप',
+ 'पूर्वी टिमोर',
+ 'पेरु',
+ 'पोर्चुगल',
+ 'पोल्याण्ड',
+ 'प्यालेस्टाइन',
+ 'प्युर्तो रिको',
+ 'प्रजातान्त्रिक गणतन्त्र कंगो',
+ 'प्रजातान्त्रिक गणतन्त्र कोरिया',
+ 'प्रिडेनेस्ट्रोभी',
+ 'फकल्याण्ड टापु',
+ 'फरोइ टापु',
+ 'फिजी',
+ 'फिनल्याण्ड',
+ 'फिलिपिन्स',
+ 'फ्रान्स',
+ 'फ्रेन्च दक्षिणी र अन्टार्कटिक द्वीप',
+ 'फ्रेन्च पोलिनेसिया',
+ 'बंगलादेश',
+ 'बर्मा',
+ 'बर्मुडा',
+ 'बहराइन',
+ 'बहामस',
+ 'बार्बाडोस',
+ 'बुरुन्डी',
+ 'बुर्किना फासो',
+ 'बुल्गेरिया',
+ 'बेनिन',
+ 'बेलारूस',
+ 'बेलिज',
+ 'बेल्जियम',
+ 'बोत्स्वाना',
+ 'बोलिभिया',
+ 'बोस्निया र हर्जगोभिना',
+ 'बोस्निया र हर्जगोभिना संघ',
+ 'बौभेट द्वीप',
+ 'ब्राजिल',
+ 'ब्रिटिस भर्जिन टापु',
+ 'ब्रुनेई',
+ 'भानुअटु',
+ 'भारत',
+ 'भियतनाम',
+ 'भुटान',
+ 'भेनेजुएला',
+ 'भ्याटिकन',
+ 'भ्याटिकन सिटी',
+ 'मकाउ',
+ 'मङ्गोलिया',
+ 'मध्य अफ्रिकी गणतन्त्र',
+ 'मलावी',
+ 'मलेशिया',
+ 'माइक्रोनेसियाको संघीय राज्य',
+ 'माडागास्कर',
+ 'मार्शल द्वीप',
+ 'माली',
+ 'माल्टा',
+ 'माल्दिभ्स',
+ 'मिश्र',
+ 'मेक्सिको',
+ 'मोजाम्बिक',
+ 'मोनाको',
+ 'मोन्टसेराट',
+ 'मोन्टेनेग्रो',
+ 'मोरक्को',
+ 'मोल्डोभा',
+ 'मौरिसनिया',
+ 'मौरिसस',
+ 'म्यानमार',
+ 'म्यासेडोनिया',
+ 'यमन',
+ 'युक्रेन',
+ 'युगान्डा',
+ 'रसिया',
+ 'रुवाण्डा',
+ 'रोमानिया',
+ 'रोस डिपेन्डेन्सी',
+ 'लक्जेम्बर्ग',
+ 'लाईबेरिया',
+ 'लाओस',
+ 'लात्भिया',
+ 'लिचटेन्स्टाइन',
+ 'लिथुआनिया',
+ 'लिबिया',
+ 'लेबनान',
+ 'लेसोथो',
+ 'वाल्लिस र फुटुना',
+ 'श्रीलंका',
+ 'संघीय राज्य माइक्रोनेसिया',
+ 'संयुक्त अधिराज्य',
+ 'संयुक्त अरब इमिरेट्स',
+ 'संयुक्त राज्य अमेरिका',
+ 'संयुक्त राज्य भर्जिन टापु',
+ 'सर्बिया',
+ 'साइप्रस',
+ 'साउदी अरब',
+ 'साओ टोमे र प्रिन्सिपे',
+ 'सान मारिनो',
+ 'साबा',
+ 'सामोआ',
+ 'साहरवी अरब लोकतान्त्रिक गणतन्त्र',
+ 'सिंगापुर',
+ 'सिन्ट मार्टिन',
+ 'सीरियन कुर्दिस्तान',
+ 'सीरिया',
+ 'सुडान',
+ 'सुरिनेम',
+ 'सेनेगल',
+ 'सेन्ट किट्स र नेभिस',
+ 'सेन्ट पियेर्रे र मिकुएलन',
+ 'सेन्ट बार्थेलेमी',
+ 'सेन्ट भिन्सेन्ट र ग्रेनाडाइन्स',
+ 'सेन्ट मार्टिन',
+ 'सेन्ट लुसिया',
+ 'सेन्ट हेलेना',
+ 'सेरा लियोन',
+ 'सेसेल्स',
+ 'सोमालिया',
+ 'सोमालील्याण्ड',
+ 'सोलोमन द्वीप',
+ 'स्पेन',
+ 'स्लोभाकिया',
+ 'स्लोभेनिया',
+ 'स्वाजिल्याण्ड',
+ 'स्विजरल्याण्ड',
+ 'स्वीडेन',
+ 'हंगेरी',
+ 'हङकङ',
+ 'हर्म',
+ 'हाइटी',
+ 'हेयर्ड द्वीप र म्याकडोनाल्ड टापु',
+ 'होन्डुरस',
+ 'अबखाजिया',
+ 'जर्जिया',
)
- # cities are taken from https://en.wikipedia.org/wiki/List_of_cities_in_Nepal
+ # cities are taken from
+ # https://en.wikipedia.org/wiki/List_of_cities_in_Nepal
cities = (
- 'मिर्चैया', 'प्युठान', 'कञ्चनपुर', 'लुम्बिनी सांस्कृतिक', 'बागलुङ', 'इलाम', 'भक्तपुर', 'भद्रपुर', 'घोराही', 'स्याङ्जा',
- 'खैरहानी नगरपालिका', 'म्याग्दी', 'रंगेली', 'काठमाडौं', 'शनि-अर्जुन', 'पर्वत', 'सप्तरी', 'पनौती', 'जयपृथ्वी', 'लहान', 'वालिङ',
- 'बर्दघाट', 'डोटी', 'धरान', 'पथरी शनिश्चरे', 'चन्दननाथ', 'नवलपरासी', 'किर्तिपुर', 'दैलेख', 'सुनसरी', 'बेलौरी', 'कुस्मा', 'मकवानपुर', 'कञ्चनरूप',
- 'गुलरिया', 'टीकापुर', 'राजापुर', 'फिदिम', 'खोटाङ', 'धनुषाधाम', 'झापा', 'पुनर्वास', 'भक्तपुर', 'बर्दिया', 'बागलुङ', 'दमक', 'तेह्रथुम', 'नारायण',
- 'ताप्लेजुङ', 'तानसेन', 'पाँचखाल', 'बनेपा', 'म्याङ्लुङ', 'ललितपुर', 'दिपायल', 'अपी', 'दाङ', 'सन्धिखर्क', 'धनकुटा', 'बिरेन्द्रनगर', 'गौर', 'मोरङ',
- 'सङ्खुवासभा', 'लम्की-चुहा', 'बारा', 'हरिवन नगरपालिका', 'मलङ्वा', 'सिराहा', 'जनकपुर', 'सल्यान', 'सिन्धुपाल्चोक', 'दुल्लु', 'ओखलढुङ्गा', 'पाल्पा',
- 'इटहरी', 'रेसुङगा', 'कृष्णनगर', 'शुक्लगण्डकी',
- 'नुवाकोट', 'साँफेबगर', 'राजविराज', 'नेपालगंज', 'भिमेश्वर', 'ताप्लेजुङ', 'धुलिखेल', 'व्यास', 'भोजपुर', 'धादिङ', 'बेनी', 'अर्घाखाँची', 'भीमदत्त', 'रौतहट',
- 'जलेश्वर', 'देवदह', 'बेलवारी', 'बुटवल', 'सुर्खेत', 'मङ्गलसेन', 'कैलाली', 'धनकुटा', 'रुपन्देही', 'सल्यान', 'रामपुर', 'बिराटनगर', 'चौतारा',
- 'देवचुली', 'कपिलवस्तु', 'सुनवल', 'शिवराज', 'चम्पापुर (चापागाउँ)', 'भरतपुर', 'गढिमाई', 'उर्लावारी', 'लेखनाथ', 'सिद्धिचरण', 'मेचीनगर',
- 'चित्रवन', 'कास्की', 'गौशाला', 'पुतलीबजार', 'बिदुर', 'शम्भुनाथ', 'पर्सा', 'प्युठान', 'निजगढ', 'डडेलधुरा', 'कन्काई', 'गैंडाकोट', 'पाल्पा', 'कार्यविनायक*',
- 'तिलोत्तमा', 'तुलसीपुर', 'वीरगञ्ज', 'शंखरपुर*', 'अत्तरिया', 'बझाङ', 'मन्थली*', 'कपिलवस्तु', 'कटारी',
- 'हेटौडा', 'कलैया', 'सुन्दर दुलारी', 'सिन्धुली', 'थाहा', 'बाँके', 'ललितपुर', 'दार्चुला', 'पोखरा', 'बन्दीपुर', 'सर्लाही',
- 'कोहलपुर', 'सैनामैना', 'अमरागढी', 'उदयपुर', 'काठमाडौं', 'सुर्योदय', 'सिराहा',
- 'महोत्तरी', 'धनगढी', 'शारदा', 'काभ्रेपलाञ्चोक', 'त्रियुगा', 'रामेछाप', 'पाँचथर', 'इलाम', 'भोजपुर',
- 'मध्यपुर ठिमी', 'दुहवी-भलुवा', 'दशरथचन्द', 'बैतडी', 'कोशी हरैंचा', 'चापाकोट', 'दिक्तेल',
- 'चन्द्रपुर', 'लालबन्दी', 'चितवन', 'रत्ननगर', 'पृथ्वीनारायण', 'धनुषा', 'गुल्मी', 'बेंसीशहर', 'लमजुङ', 'अछाम',
- 'तनहुँ', 'खाँदबारी', 'बिर्तामोड', 'कमलामाई', 'छिरेश्वरनाथ', 'सिद्धार्थनगर', 'निलकण्ठ', 'गोर्खा', 'दोलखा', 'रामग्राम',
- 'इनरूवा', 'कावासोती', 'बेल्टार बसाहा', 'जुम्ला', 'ईश्वरपुर',
+ 'मिर्चैया',
+ 'प्युठान',
+ 'कञ्चनपुर',
+ 'लुम्बिनी सांस्कृतिक',
+ 'बागलुङ',
+ 'इलाम',
+ 'भक्तपुर',
+ 'भद्रपुर',
+ 'घोराही',
+ 'स्याङ्जा',
+ 'खैरहानी नगरपालिका',
+ 'म्याग्दी',
+ 'रंगेली',
+ 'काठमाडौं',
+ 'शनि-अर्जुन',
+ 'पर्वत',
+ 'सप्तरी',
+ 'पनौती',
+ 'जयपृथ्वी',
+ 'लहान',
+ 'वालिङ',
+ 'बर्दघाट',
+ 'डोटी',
+ 'धरान',
+ 'पथरी शनिश्चरे',
+ 'चन्दननाथ',
+ 'नवलपरासी',
+ 'किर्तिपुर',
+ 'दैलेख',
+ 'सुनसरी',
+ 'बेलौरी',
+ 'कुस्मा',
+ 'मकवानपुर',
+ 'कञ्चनरूप',
+ 'गुलरिया',
+ 'टीकापुर',
+ 'राजापुर',
+ 'फिदिम',
+ 'खोटाङ',
+ 'धनुषाधाम',
+ 'झापा',
+ 'पुनर्वास',
+ 'भक्तपुर',
+ 'बर्दिया',
+ 'बागलुङ',
+ 'दमक',
+ 'तेह्रथुम',
+ 'नारायण',
+ 'ताप्लेजुङ',
+ 'तानसेन',
+ 'पाँचखाल',
+ 'बनेपा',
+ 'म्याङ्लुङ',
+ 'ललितपुर',
+ 'दिपायल',
+ 'अपी',
+ 'दाङ',
+ 'सन्धिखर्क',
+ 'धनकुटा',
+ 'बिरेन्द्रनगर',
+ 'गौर',
+ 'मोरङ',
+ 'सङ्खुवासभा',
+ 'लम्की-चुहा',
+ 'बारा',
+ 'हरिवन नगरपालिका',
+ 'मलङ्वा',
+ 'सिराहा',
+ 'जनकपुर',
+ 'सल्यान',
+ 'सिन्धुपाल्चोक',
+ 'दुल्लु',
+ 'ओखलढुङ्गा',
+ 'पाल्पा',
+ 'इटहरी',
+ 'रेसुङगा',
+ 'कृष्णनगर',
+ 'शुक्लगण्डकी',
+ 'नुवाकोट',
+ 'साँफेबगर',
+ 'राजविराज',
+ 'नेपालगंज',
+ 'भिमेश्वर',
+ 'ताप्लेजुङ',
+ 'धुलिखेल',
+ 'व्यास',
+ 'भोजपुर',
+ 'धादिङ',
+ 'बेनी',
+ 'अर्घाखाँची',
+ 'भीमदत्त',
+ 'रौतहट',
+ 'जलेश्वर',
+ 'देवदह',
+ 'बेलवारी',
+ 'बुटवल',
+ 'सुर्खेत',
+ 'मङ्गलसेन',
+ 'कैलाली',
+ 'धनकुटा',
+ 'रुपन्देही',
+ 'सल्यान',
+ 'रामपुर',
+ 'बिराटनगर',
+ 'चौतारा',
+ 'देवचुली',
+ 'कपिलवस्तु',
+ 'सुनवल',
+ 'शिवराज',
+ 'चम्पापुर (चापागाउँ)',
+ 'भरतपुर',
+ 'गढिमाई',
+ 'उर्लावारी',
+ 'लेखनाथ',
+ 'सिद्धिचरण',
+ 'मेचीनगर',
+ 'चित्रवन',
+ 'कास्की',
+ 'गौशाला',
+ 'पुतलीबजार',
+ 'बिदुर',
+ 'शम्भुनाथ',
+ 'पर्सा',
+ 'प्युठान',
+ 'निजगढ',
+ 'डडेलधुरा',
+ 'कन्काई',
+ 'गैंडाकोट',
+ 'पाल्पा',
+ 'कार्यविनायक*',
+ 'तिलोत्तमा',
+ 'तुलसीपुर',
+ 'वीरगञ्ज',
+ 'शंखरपुर*',
+ 'अत्तरिया',
+ 'बझाङ',
+ 'मन्थली*',
+ 'कपिलवस्तु',
+ 'कटारी',
+ 'हेटौडा',
+ 'कलैया',
+ 'सुन्दर दुलारी',
+ 'सिन्धुली',
+ 'थाहा',
+ 'बाँके',
+ 'ललितपुर',
+ 'दार्चुला',
+ 'पोखरा',
+ 'बन्दीपुर',
+ 'सर्लाही',
+ 'कोहलपुर',
+ 'सैनामैना',
+ 'अमरागढी',
+ 'उदयपुर',
+ 'काठमाडौं',
+ 'सुर्योदय',
+ 'सिराहा',
+ 'महोत्तरी',
+ 'धनगढी',
+ 'शारदा',
+ 'काभ्रेपलाञ्चोक',
+ 'त्रियुगा',
+ 'रामेछाप',
+ 'पाँचथर',
+ 'इलाम',
+ 'भोजपुर',
+ 'मध्यपुर ठिमी',
+ 'दुहवी-भलुवा',
+ 'दशरथचन्द',
+ 'बैतडी',
+ 'कोशी हरैंचा',
+ 'चापाकोट',
+ 'दिक्तेल',
+ 'चन्द्रपुर',
+ 'लालबन्दी',
+ 'चितवन',
+ 'रत्ननगर',
+ 'पृथ्वीनारायण',
+ 'धनुषा',
+ 'गुल्मी',
+ 'बेंसीशहर',
+ 'लमजुङ',
+ 'अछाम',
+ 'तनहुँ',
+ 'खाँदबारी',
+ 'बिर्तामोड',
+ 'कमलामाई',
+ 'छिरेश्वरनाथ',
+ 'सिद्धार्थनगर',
+ 'निलकण्ठ',
+ 'गोर्खा',
+ 'दोलखा',
+ 'रामग्राम',
+ 'इनरूवा',
+ 'कावासोती',
+ 'बेल्टार बसाहा',
+ 'जुम्ला',
+ 'ईश्वरपुर',
)
districts = (
- 'अछाम', 'अर्घाखाँची', 'इलाम', 'उदयपुर', 'ओखलढुङ्गा', 'कञ्चनपुर', 'कपिलवस्तु', 'काठमाडौं', 'काभ्रेपलाञ्चोक', 'कालीकोट', 'कास्की', 'कैलाली', 'खोटाङ', 'गुल्मी',
- 'गोर्खा', 'चितवन', 'जाजरकोट', 'जुम्ला', 'झापा', 'डडेल्धुरा', 'डोटी', 'डोल्पा', 'तनहुँ', 'ताप्लेजुङ', 'तेह्रथुम', 'दाङ', 'दार्चुला', 'दैलेख', 'दोलखा', 'धनकुटा', 'धनुषा', 'धादिङ', 'नवलपरासी',
- 'नुवाकोट', 'पर्वत', 'पर्सा', 'पाँचथर', 'पाल्पा', 'प्युठान', 'बझाङ', 'बर्दिया', 'बाँके', 'बाग्लुङ', 'बाजुरा', 'बारा', 'भक्तपुर', 'भोजपुर', 'मकवानपुर', 'मनाङ', 'महोत्तरी', 'मुगु', 'मुस्ताङ',
- 'मोरङ', 'म्याग्दी', 'रसुवा', 'रामेछाप', 'रुकुम', 'रूपन्देही', 'रोल्पा', 'रौतहट', 'लमजुङ्', 'ललितपुर', 'वैतडी', 'संखुवासभा', 'सप्तरी', 'सर्लाही', 'सल्यान', 'सिन्धुपलाञ्चोक', 'सिन्धुली',
- 'सिराहा', 'सुनसरी', 'सुर्खेत', 'सोलुखुम्बु', 'स्याङ्जा', 'हुम्ला',
+ 'अछाम',
+ 'अर्घाखाँची',
+ 'इलाम',
+ 'उदयपुर',
+ 'ओखलढुङ्गा',
+ 'कञ्चनपुर',
+ 'कपिलवस्तु',
+ 'काठमाडौं',
+ 'काभ्रेपलाञ्चोक',
+ 'कालीकोट',
+ 'कास्की',
+ 'कैलाली',
+ 'खोटाङ',
+ 'गुल्मी',
+ 'गोर्खा',
+ 'चितवन',
+ 'जाजरकोट',
+ 'जुम्ला',
+ 'झापा',
+ 'डडेल्धुरा',
+ 'डोटी',
+ 'डोल्पा',
+ 'तनहुँ',
+ 'ताप्लेजुङ',
+ 'तेह्रथुम',
+ 'दाङ',
+ 'दार्चुला',
+ 'दैलेख',
+ 'दोलखा',
+ 'धनकुटा',
+ 'धनुषा',
+ 'धादिङ',
+ 'नवलपरासी',
+ 'नुवाकोट',
+ 'पर्वत',
+ 'पर्सा',
+ 'पाँचथर',
+ 'पाल्पा',
+ 'प्युठान',
+ 'बझाङ',
+ 'बर्दिया',
+ 'बाँके',
+ 'बाग्लुङ',
+ 'बाजुरा',
+ 'बारा',
+ 'भक्तपुर',
+ 'भोजपुर',
+ 'मकवानपुर',
+ 'मनाङ',
+ 'महोत्तरी',
+ 'मुगु',
+ 'मुस्ताङ',
+ 'मोरङ',
+ 'म्याग्दी',
+ 'रसुवा',
+ 'रामेछाप',
+ 'रुकुम',
+ 'रूपन्देही',
+ 'रोल्पा',
+ 'रौतहट',
+ 'लमजुङ्',
+ 'ललितपुर',
+ 'वैतडी',
+ 'संखुवासभा',
+ 'सप्तरी',
+ 'सर्लाही',
+ 'सल्यान',
+ 'सिन्धुपलाञ्चोक',
+ 'सिन्धुली',
+ 'सिराहा',
+ 'सुनसरी',
+ 'सुर्खेत',
+ 'सोलुखुम्बु',
+ 'स्याङ्जा',
+ 'हुम्ला',
)
def district(self):
diff --git a/src/libs/faker/providers/address/nl_BE/__init__.py b/src/libs/faker/providers/address/nl_BE/__init__.py
index 21b79ac..22529f7 100644
--- a/src/libs/faker/providers/address/nl_BE/__init__.py
+++ b/src/libs/faker/providers/address/nl_BE/__init__.py
@@ -3,8 +3,9 @@
from __future__ import unicode_literals
from .. import Provider as AddressProvider
+
class Provider(AddressProvider):
- building_number_formats = ('#', '##', '###', '#', '##', '###',)
+ building_number_formats = ('#', '##', '###', '#', '##', '###')
street_suffixes = (
'baan', 'boulevard', 'dreef', 'hof', 'laan', 'lei', 'pad',
@@ -80,704 +81,483 @@ class Provider(AddressProvider):
# cities as listed on "postcodezoeker"
# http://www.postcodes-maps.be/postcodelijst.php
cities = (
- "'s Herenelderen","'s-Gravenvoeren","'s-Gravenwezel","Aaigem",
- "Aalbeke","Aalst","Aalter","Aarschot",
- "Aarsele","Aartrijke","Aartselaar","Abolens",
- "Abée","Achel","Achet","Achêne",
- "Acosse","Acoz","Adegem","Adinkerke",
- "Affligem","Afsnee","Agimont","Aineffe",
- "Aische-en-Refail","Aiseau","Aiseau-Presles","Aisemont",
- "Alken","Alle","Alleur","Alsemberg",
- "Alveringem","Amay","Amberloup","Ambly",
- "Ambresin","Amel","Amonines","Amougies",
- "Ampsin","Andenne","Anderlecht","Anderlues",
- "Andrimont","Angleur","Angre","Angreau",
- "Anhée","Anlier","Anloy","Annevoie-Rouillon",
- "Ans","Anseremme","Anseroeul","Antheit",
- "Anthisnes","Anthée","Antoing","Antwerpen",
- "Anvaing","Anzegem","Appels","Appelterre-Eichem",
- "Arbre","Arbrefontaine","Arc-Ainières","Arc-Wattripont",
- "Archennes","Ardooie","Arendonk","Argenteau",
- "Arlon","Arquennes","Arsimont","Arville",
- "As","Aspelare","Asper","Asquillies",
- "Asse","Assebroek","Assenede","Assenois",
- "Assent","Assesse","Astene","Ath",
- "Athis","Athus","Attenhoven","Attenrode",
- "Attert","Attre","Aubange","Aubechies",
- "Aubel","Aublain","Auby-sur-Semois","Audregnies",
- "Aulnois","Autelbas","Autre-Eglise","Autreppe",
- "Auvelais","Ave-et-Auffe","Avekapelle","Avelgem",
- "Avennes","Averbode","Avernas-le-Bauduin","Avin",
- "Awans","Awenne","Awirs","Aye",
- "Ayeneux","Aywaille","Baaigem","Baal",
- "Baardegem","Baarle-Hertog","Baasrode","Bachte-Maria-Leerne",
- "Baelen","Bagimont","Baileux","Bailièvre",
- "Baillamont","Bailleul","Baillonville","Baisieux",
- "Baisy-Thy","Balegem","Balen","Balâtre",
- "Bambrugge","Bande","Barbençon","Barchon",
- "Baronville","Barry","Barvaux-Condroz","Barvaux-sur-Ourthe",
- "Bas-Oha","Basse-Bodeux","Bassenge","Bassevelde",
- "Bassilly","Bastogne","Basècles","Batsheers",
- "Battice","Battignies","Baudour","Bauffe",
- "Baugnies","Baulers","Bavegem","Bavikhove",
- "Bazel","Beaufays","Beaumont","Beauraing",
- "Beausaint","Beauvoorde","Beauwelz","Beclers",
- "Beek","Beerlegem","Beernem","Beerse",
- "Beersel","Beerst","Beert","Beervelde",
- "Beerzel","Beez","Beffe","Begijnendijk",
- "Beho","Beigem","Bekegem","Bekkerzeel",
- "Bekkevoort","Belgrade","Bellaire","Bellecourt",
- "Bellefontaine","Bellegem","Bellem","Bellevaux",
- "Bellevaux-Ligneuville","Bellingen","Beloeil","Belsele",
- "Ben-Ahin","Bende","Berbroek","Berchem",
- "Berendrecht","Berg","Bergilers","Beringen",
- "Berlaar","Berlare","Berlingen","Berloz",
- "Berneau","Bernissart","Bersillies-l'Abbaye","Bertem",
- "Bertogne","Bertrix","Bertrée","Berzée",
- "Beselare","Betekom","Bettincourt","Beuzet",
- "Bevekom","Bevel","Bever","Bevercé",
- "Bevere","Beveren-Leie","Beveren-Roeselare","Beveren-Waas",
- "Beveren-aan-den-Ijzer","Beverlo","Beverst","Beyne-Heusay",
- "Bienne-lez-Happart","Bierbeek","Biercée","Bierges",
- "Bierghes","Bierset","Bierwart","Biesme",
- "Biesme-sous-Thuin","Biesmerée","Biez","Bihain",
- "Bikschote","Bilstain","Bilzen","Binche",
- "Binderveld","Binkom","Bioul","Bissegem",
- "Bizet","Bièvre","Blaasveld","Blaimont",
- "Blandain","Blanden","Blankenberge","Blaregnies",
- "Blaton","Blaugies","Blehen","Bleid",
- "Bleret","Blicquy","Blégny","Bléharies",
- "Bocholt","Boechout","Boekhout","Boekhoute",
- "Boezinge","Bogaarden","Bohan","Boignée",
- "Boirs","Bois-d'Haine","Bois-de-Lessines","Bois-de-Villers",
- "Bois-et-Borsu","Bolinne","Bolland","Bomal",
- "Bomal-sur-Ourthe","Bombaye","Bommershoven","Bon-Secours",
- "Boncelles","Boneffe","Bonheiden","Boninne",
- "Bonlez","Bonnert","Bonneville","Bonsin",
- "Booischot","Booitshoeke","Boom","Boorsem",
- "Boortmeerbeek","Borchtlombeek","Borgerhout","Borgloon",
- "Borlez","Borlo","Borlon","Bornem",
- "Bornival","Borsbeek","Borsbeke","Bossière",
- "Bossuit","Bossut-Gottechain","Bost","Bothey",
- "Bottelare","Bouffioulx","Bouge","Bougnies",
- "Bouillon","Bourlers","Bourseigne-Neuve","Bourseigne-Vieille",
- "Boussoit","Boussu","Boussu-en-Fagne","Boussu-lez-Walcourt",
- "Bousval","Boutersem","Bouvignes-sur-Meuse","Bouvignies",
- "Bouwel","Bovekerke","Bovelingen","Bovenistier",
- "Bovesse","Bovigny","Boëlhe","Bra",
- "Braffe","Braibant","Braine-l'Alleud","Braine-le-Château",
- "Braine-le-Comte","Braives","Brakel","Branchon",
- "Bras","Brasmenil","Brasschaat","Bray",
- "Brecht","Bredene","Bree","Breendonk",
- "Bressoux","Briegden","Brielen","Broechem",
- "Broekom","Brugelette","Brugge","Brunehaut",
- "Brussegem","Brussel","Brustem","Bruyelle",
- "Brye","Brûly","Brûly-de-Pesche","Budingen",
- "Buggenhout","Buissenal","Buissonville","Buizingen",
- "Buken","Bulskamp","Bunsbeek","Burcht",
- "Burdinne","Bure","Burg-Reuland","Burst",
- "Bury","Buvingen","Buvrinnes","Buzenol",
- "Buzet","Büllingen","Bütgenbach","Callenelle",
- "Calonne","Cambron-Casteau","Cambron-Saint-Vincent","Carlsbourg",
- "Carnières","Casteau","Castillon","Celles",
- "Cerfontaine","Chaineux","Chairière","Champion",
- "Champlon","Chanly","Chantemelle","Chapelle-lez-Herlaimont",
- "Chapelle-à-Oie","Chapelle-à-Wattines","Chapon-Seraing","Charleroi",
- "Charneux","Chassepierre","Chastre","Chastre-Villeroux-Blanmont",
- "Chastrès","Chaudfontaine","Chaumont-Gistoux",
- "Chaussée-Notre-Dame-Louvignies","Cherain","Cheratte","Chercq",
- "Chevetogne","Chevron","Chimay","Chiny","Chièvres",
- "Chokier","Châtelet","Châtelineau","Châtillon",
- "Chênée","Ciergnon","Ciney","Ciplet",
- "Ciply","Clabecq","Clavier","Clermont",
- "Clermont-sous-Huy","Cognelée","Colfontaine","Comblain-Fairon",
- "Comblain-au-Pont","Comblain-la-Tour","Conneux","Corbais",
- "Corbion","Cordes","Corenne","Cornesse",
- "Cornimont","Corroy-le-Château","Corroy-le-Grand","Corswarem",
- "Cortil-Noirmont","Cortil-Wodon","Couillet","Cour-sur-Heure",
- "Courcelles","Courrière","Court-Saint-Etienne","Couthuin",
- "Coutisse","Couture-Saint-Germain","Couvin","Cras-Avernas",
- "Crehen","Crisnée","Croix-lez-Rouveroy","Crombach",
- "Crupet","Cuesmes","Cugnon","Cul-des-Sarts",
- "Custinne","Cérexhe-Heuseux","Céroux-Mousty","Dadizele",
- "Dailly","Daknam","Dalhem","Damme",
- "Dampicourt","Dampremy","Darion","Daussois",
- "Daussoulx","Dave","Daverdisse","De Haan",
- "De Klinge","De Moeren","De Panne","De Pinte",
- "Deerlijk","Deftinge","Deinze","Denderbelle",
- "Denderhoutem","Denderleeuw","Dendermonde","Denderwindeke",
- "Dentergem","Denée","Dergneau","Dessel",
- "Desselgem","Destelbergen","Desteldonk","Deurle",
- "Deurne","Deux-Acren","Dhuy","Diepenbeek",
- "Diest","Diets-Heur","Dikkebus","Dikkele",
- "Dikkelvenne","Diksmuide","Dilbeek","Dilsen-Stokkem",
- "Dinant","Dion","Dion-Valmont","Dison",
- "Dochamps","Doel","Dohan","Doische",
- "Dolembreux","Donceel","Dongelberg","Donk",
- "Donstiennes","Dorinne","Dormaal","Dottenijs",
- "Dour","Dourbes","Dranouter","Driekapellen",
- "Drieslinter","Drogenbos","Drongen","Dréhance",
- "Dudzele","Duffel","Duisburg","Duras",
- "Durbuy","Durnal","Dworp","Eben-Emael",
- "Ebly","Ecaussinnes","Ecaussinnes-Lalaing","Ecaussinnes-d'Enghien",
- "Edegem","Edelare","Edingen","Eeklo",
- "Eernegem","Egem","Eggewaartskapelle","Eghezée",
- "Ehein","Eigenbilzen","Eindhout","Eine",
- "Eisden","Eke","Ekeren","Eksaarde",
- "Eksel","Elen","Elene","Elewijt",
- "Eliksem","Elingen","Ellemelle","Ellezelles",
- "Ellignies-Sainte-Anne","Ellignies-lez-Frasnes","Ellikom","Elouges",
- "Elsegem","Elsenborn","Elsene","Elst",
- "Elverdinge","Elversele","Emblem","Embourg",
- "Emelgem","Emines","Emptinne","Ename",
- "Engelmanshoven","Engis","Enines","Ensival",
- "Epinois","Eppegem","Eprave","Erbaut",
- "Erbisoeul","Ere","Erembodegem","Erezée",
- "Ermeton-sur-Biert","Ernage","Erneuville","Ernonheid",
- "Erondegem","Erpe","Erpe-Mere","Erpent",
- "Erpion","Erps-Kwerps","Erquelinnes","Erquennes",
- "Ertvelde","Erwetegem","Escanaffles","Esen",
- "Esneux","Esplechin","Esquelmes","Essen",
- "Essene","Estaimbourg","Estaimpuis","Estinnes",
- "Estinnes-au-Mont","Estinnes-au-Val","Etalle","Ethe",
- "Etikhove","Ettelgem","Etterbeek","Eugies",
- "Eupen","Evegnée","Evelette","Everbeek",
- "Everberg","Evere","Evergem","Evregnies",
- "Evrehailles","Eynatten","Ezemaal","Fagnolle",
- "Faimes","Falaën","Falisolle","Fallais",
- "Falmagne","Falmignoul","Familleureux","Farciennes",
- "Faulx-les-Tombes","Fauroeulx","Fauvillers","Faymonville",
- "Fays-les-Veneurs","Fayt-le-Franc","Fayt-lez-Manage","Felenne",
- "Feluy","Feneur","Fernelmont","Ferrières",
- "Feschaux","Fexhe-Slins","Fexhe-le-Haut-Clocher","Filot",
- "Finnevaux","Fize-Fontaine","Fize-le-Marsal","Flamierge",
- "Flavion","Flawinne","Fleurus","Floreffe",
- "Florennes","Florenville","Floriffoux","Florée",
- "Flostoy","Flémalle","Flémalle-Grande","Flémalle-Haute",
- "Flénu","Fléron","Flône","Focant",
- "Folx-les-Caves","Fontaine-Valmont","Fontaine-l'Evêque","Fontenelle",
- "Fontenoille","Fontenoy","Fooz","Forchies-la-Marche",
- "Forest","Forges","Forges-Philippe","Forrières",
- "Forville","Forêt","Fosse","Fosses-la-Ville",
- "Fouleng","Fourbechies","Foy-Notre-Dame","Fraipont",
- "Fraire","Fraiture","Frameries","Framont",
- "Franc-Waret","Franchimont","Francorchamps","Franière",
- "Frasnes","Frasnes-lez-Anvaing","Frasnes-lez-Buissenal",
- "Frasnes-lez-Gosselies","Freloux","Freux","Froidchapelle",
- "Froidfontaine","Froidmont","Fronville","Froyennes","Fumal",
- "Furfooz","Furnaux","Gaasbeek","Gages",
- "Gallaix","Galmaarden","Ganshoren","Gaurain-Ramecroix",
- "Gavere","Gedinne","Geel","Geer",
- "Geest-Gérompont-Petit-Rosière","Geetbets","Gelbressée","Gelinden",
- "Gellik","Gelrode","Geluveld","Geluwe",
- "Gembes","Gembloux","Gemmenich","Genappe",
- "Genk","Genly","Genoelselderen","Gent",
- "Gentbrugge","Gentinnes","Genval","Geraardsbergen",
- "Gerdingen","Gerin","Gerpinnes","Gestel",
- "Gesves","Ghislenghien","Ghlin","Ghoy",
- "Gibecq","Gierle","Gijverinkhove","Gijzegem",
- "Gijzelbrechtegem","Gijzenzele","Gilly","Gimnée",
- "Gingelom","Gistel","Gits","Givry",
- "Glabais","Glabbeek-Zuurbemde","Glain","Gleixhe",
- "Glimes","Glons","Gochenée","Godarville",
- "Godinne","Godveerdegem","Goeferdinge","Goegnies-Chaussée",
- "Goesnes","Goetsenhoven","Gomzé-Andoumont","Gondregnies",
- "Gonrieux","Gontrode","Gooik","Gors-Opleeuw",
- "Gorsem","Gosselies","Gotem","Gottem",
- "Gottignies","Gougnies","Gourdinne","Goutroux",
- "Gouvy","Gouy-lez-Piéton","Gozée","Goé",
- "Graide","Grammene","Grand-Axhe","Grand-Hallet",
- "Grand-Halleux","Grand-Leez","Grand-Manil","Grand-Rechain",
- "Grand-Reng","Grand-Rosière-Hottomont","Grandglise","Grandhan",
- "Grandmenil","Grandmetz","Grandrieu","Grandville",
- "Grandvoir","Grapfontaine","Graty","Graux",
- "Grazen","Grembergen","Grez-Doiceau","Grimbergen",
- "Grimminge","Grivegnée","Grobbendonk","Groot-Bijgaarden",
- "Groot-Gelmen","Groot-Loon","Gros-Fays","Grosage",
- "Grote-Brogel","Grote-Spouwen","Grotenberge","Gruitrode",
- "Grune","Grupont","Grâce-Berleur","Grâce-Hollogne",
- "Guignies","Guigoven","Guirsch","Gullegem",
- "Gutschoven","Gérompont","Gérouville","Haacht",
- "Haaltert","Haasdonk","Haasrode","Habay",
- "Habay-la-Neuve","Habay-la-Vieille","Habergy","Haccourt",
- "Hachy","Hacquegnies","Haillot","Haine-Saint-Paul",
- "Haine-Saint-Pierre","Hainin","Hakendover","Halanzy",
- "Halen","Hallaar","Halle","Halle-Booienhoven",
- "Halleux","Halma","Halmaal","Haltinne",
- "Ham","Ham-sur-Heure","Ham-sur-Heure-Nalinnes","Ham-sur-Sambre",
- "Hamipré","Hamme","Hamme-Mille","Hamoir",
- "Hamois","Hamont","Hamont-Achel","Hampteau",
- "Han-sur-Lesse","Handzame","Haneffe","Hannut",
- "Hannêche","Hanret","Hansbeke","Hantes-Wihéries",
- "Hanzinelle","Hanzinne","Harchies","Harelbeke",
- "Haren","Haren-Borgloon","Haren-Tongeren","Hargimont",
- "Harmignies","Harnoncourt","Harre","Harsin",
- "Harveng","Harzé","Hasselt","Hastière",
- "Hastière-Lavaux","Hastière-par-Delà","Hatrival","Haulchin",
- "Hauset","Haut-Fays","Haut-Ittre","Haut-le-Wastia",
- "Hautrage","Havay","Havelange","Haversin",
- "Havinnes","Havré","Hechtel","Hechtel-Eksel",
- "Heer","Heers","Hees","Heestert",
- "Heffen","Heikruis","Heindonk","Heinsch",
- "Heist-aan-Zee","Heist-op-den-Berg","Hekelgem","Heks",
- "Helchteren","Heldergem","Helen-Bos","Helkijn",
- "Hellebecq","Hemelveerdegem","Hemiksem","Hemptinne",
- "Hemptinne-lez-Florennes","Hendrieken","Henis","Hennuyères",
- "Henri-Chapelle","Henripont","Hensies","Heppen",
- "Heppenbach","Heppignies","Herbeumont","Herchies",
- "Herderen","Herdersem","Herent","Herentals",
- "Herenthout","Herfelingen","Hergenrath","Herk-de-Stad",
- "Hermalle-sous-Argenteau","Hermalle-sous-Huy","Hermeton-sur-Meuse",
- "Hermée","Herne","Herquegies","Herseaux","Herselt",
- "Herstal","Herstappe","Hertain","Herten",
- "Hertsberge","Herve","Herzele","Heule",
- "Heure","Heure-le-Romain","Heurne","Heusden",
- "Heusden-Zolder","Heusy","Heuvelland","Hever",
- "Heverlee","Heyd","Hillegem","Hingene",
- "Hingeon","Hives","Hoboken","Hodeige",
- "Hodister","Hody","Hoegaarden","Hoeilaart",
- "Hoeke","Hoelbeek","Hoeleden","Hoepertingen",
- "Hoeselt","Hoevenen","Hofstade","Hogne",
- "Hognoul","Hollain","Hollange","Hollebeke",
- "Hollogne-aux-Pierres","Hollogne-sur-Geer","Holsbeek","Hombeek",
- "Hombourg","Hompré","Hondelange","Honnay",
- "Honnelles","Hooglede","Hoogstade","Hoogstraten",
- "Horebeke","Horion-Hozémont","Hornu","Horpmaal",
- "Horrues","Hotton","Houdemont","Houdeng-Aimeries",
- "Houdeng-Goegnies","Houdremont","Houffalize","Hour",
- "Housse","Houtain-Saint-Siméon","Houtain-le-Val","Houtaing",
- "Houtave","Houtem","Houthalen","Houthalen-Helchteren",
- "Houthem","Houthulst","Houtvenne","Houwaart",
- "Houx","Houyet","Hove","Hoves",
- "Howardries","Huccorgne","Huise","Huissignies",
- "Huizingen","Huldenberg","Hulshout","Hulsonniaux",
- "Hulste","Humain","Humbeek","Hundelgem",
- "Huppaye","Huy","Hyon","Hélécine",
- "Hérinnes-lez-Pecq","Héron","Hévillers","Ichtegem",
- "Iddergem","Idegem","Ieper","Impe",
- "Incourt","Ingelmunster","Ingooigem","Irchonwelz",
- "Isières","Isnes","Itegem","Itterbeek",
- "Ittre","Ivoz-Ramet","Izegem","Izel",
- "Izenberge","Izier","Jabbeke","Jalhay",
- "Jallet","Jamagne","Jambes","Jamiolle",
- "Jamioulx","Jamoigne","Jandrain-Jandrenouille","Jauche",
- "Jauchelette","Javingue","Jehay","Jehonville",
- "Jemappes","Jemelle","Jemeppe-sur-Meuse","Jemeppe-sur-Sambre",
- "Jeneffe","Jesseren","Jette","Jeuk",
- "Jodoigne","Jodoigne-Souveraine","Jollain-Merlin","Joncret",
- "Julémont","Jumet","Jupille-sur-Meuse","Juprelle",
- "Jurbise","Juseret","Kaaskerke","Kachtem",
- "Kaggevinne","Kain","Kalken","Kallo",
- "Kallo-Kieldrecht","Kalmthout","Kampenhout","Kanegem",
- "Kanne","Kapelle-op-den-Bos","Kapellen","Kaprijke",
- "Kaster","Kasterlee","Kaulille","Keerbergen",
- "Keiem","Kelmis","Kemexhe","Kemmel",
- "Kemzeke","Kerkhove","Kerkom","Kerkom-bij-Sint-Truiden",
- "Kerksken","Kermt","Kerniel","Kersbeek-Miskom",
- "Kessel","Kessel-Lo","Kessenich","Kester",
- "Kettenis","Keumiée","Kieldrecht","Kinrooi",
- "Klein-Gelmen","Kleine-Brogel","Kleine-Spouwen","Klemskerke",
- "Klerken","Kluisbergen","Kluizen","Knesselare",
- "Knokke","Knokke-Heist","Kobbegem","Koekelare",
- "Koekelberg","Koersel","Koksijde","Kolmont-Borgloon",
- "Kolmont-Tongeren","Komen","Komen-Waasten","Koningshooikt",
- "Koninksem","Kontich","Kooigem","Koolkerke",
- "Koolskamp","Korbeek-Dijle","Korbeek-Lo","Kortemark",
- "Kortenaken","Kortenberg","Kortessem","Kortijs",
- "Kortrijk","Kortrijk-Dutsel","Kozen","Kraainem",
- "Krombeke","Kruibeke","Kruishoutem","Kumtich",
- "Kuringen","Kuttekoven","Kuurne","Kwaadmechelen",
- "Kwaremont","La","La Bruyère","La Glanerie",
- "La Gleize","La Hestre","La Hulpe","La Louvière",
- "La bouverie","La-Roche-en-Ardenne","Laakdal","Laar",
- "Laarne","Labuissière","Lacuisine","Ladeuze",
- "Laforêt","Lahamaide","Laken","Lamain",
- "Lambermont","Lambusart","Lamine","Lamontzée",
- "Lamorteau","Lampernisse","Lanaken","Lanaye",
- "Landegem","Landelies","Landen","Landenne",
- "Landskouter","Laneffe","Langdorp","Langemark",
- "Langemark-Poelkapelle","Lanklaar","Lanquesaint","Lantin",
- "Lantremange","Laplaigne","Lapscheure","Lasne",
- "Lasne-Chapelle-Saint-Lambert","Lathuy","Latinne","Latour",
- "Lauw","Lauwe","Lavacherie","Lavaux-Sainte-Anne",
- "Lavoir","Le Mesniel","Le Roeulx","Le Roux",
- "Lebbeke","Lede","Ledeberg","Ledegem",
- "Leefdaal","Leerbeek","Leernes","Leers-Nord",
- "Leers-et-Fosteau","Leest","Leeuwergem","Leffinge",
- "Leignon","Leisele","Leke","Lembeek",
- "Lembeke","Lemberge","Lendelede","Lennik",
- "Lens","Lens-Saint-Remy","Lens-Saint-Servais","Lens-sur-Geer",
- "Leopoldsburg","Les Avins","Les Bons","Les Bulles",
- "Les Hayons","Les Waleffes","Lesdain","Lessines",
- "Lessive","Lesterny","Lesve","Lettelingen",
- "Letterhoutem","Leugnies","Leupegem","Leut",
- "Leuven","Leuze","Leuze-en-Hainaut","Leval-Chaudeville",
- "Leval-Trahegnies","Liberchies","Libin","Libramont",
- "Libramont-Chevigny","Lichtaart","Lichtervelde","Liedekerke",
- "Lieferinge","Lier","Lierde","Lierneux",
- "Liernu","Liers","Liezele","Ligne",
- "Ligney","Ligny","Lille","Lillo",
- "Lillois-Witterzée","Limal","Limbourg","Limelette",
- "Limerlé","Limont","Lincent","Linden",
- "Linkebeek","Linkhout","Linsmeau","Lint",
- "Linter","Lippelo","Lisogne","Lissewege",
- "Lives-sur-Meuse","Lixhe","Liège","Lo",
- "Lo-Reninge","Lobbes","Lochristi","Lodelinsart",
- "Loenhout","Loker","Lokeren","Loksbergen",
- "Lombardsijde","Lombise","Lommel","Lommersweiler",
- "Lompret","Lomprez","Loncin","Londerzeel",
- "Longchamps","Longlier","Longueville","Longvilly",
- "Lontzen","Lonzée","Loonbeek","Loppem",
- "Lorcé","Lot","Lotenhulle","Louette-Saint-Denis",
- "Louette-Saint-Pierre","Loupoigne","Louvain-la-Neuve",
- "Louveigné","Lovendegem","Lovenjoel","Loverval","Loyers",
- "Lubbeek","Luingne","Lummen","Lustin",
- "Luttre","Léglise","Maarke-Kerkem","Maarkedal",
- "Maaseik","Maasmechelen","Mabompré","Machelen",
- "Macon","Macquenoise","Maffe","Maffle",
- "Magnée","Maillen","Mainvault","Maisières",
- "Maissin","Maizeret","Mal","Maldegem",
- "Malderen","Malempré","Malle","Malmedy",
- "Malonne","Malvoisin","Malèves-Sainte-Marie-Wastines","Manage",
- "Manderfeld","Manhay","Mannekensvere","Maransart",
- "Marbais","Marbaix","Marbehan","Marche-en-Famenne",
- "Marche-les-Dames","Marche-lez-Ecaussinnes","Marchienne-au-Pont",
- "Marchin","Marchipont","Marchovelette","Marcinelle","Marcourt",
- "Marenne","Mariakerke","Mariekerke","Mariembourg",
- "Marilles","Mark","Marke","Markegem",
- "Marneffe","Marquain","Martelange","Martenslinde",
- "Martouzin-Neuville","Masbourg","Masnuy-Saint-Jean",
- "Masnuy-Saint-Pierre","Massemen","Massenhoven","Matagne-la-Grande",
- "Matagne-la-Petite","Mater","Maubray","Maulde","Maurage",
- "Mazenzele","Mazy","Mazée","Mechelen",
- "Mechelen-Bovelingen","Mechelen-aan-de-Maas","Meeffe",
- "Meensel-Kiezegem","Meer","Meerbeek","Meerbeke","Meerdonk",
- "Meerhout","Meerle","Meeswijk","Meetkerke",
- "Meeuwen","Meeuwen-Gruitrode","Mehaigne","Meigem",
- "Meilegem","Meise","Meix-devant-Virton","Meix-le-Tige",
- "Melden","Meldert","Melen","Melkwezer",
- "Melle","Mellery","Melles","Mellet",
- "Mellier","Melsbroek","Melsele","Melsen",
- "Membach","Membre","Membruggen","Mendonk",
- "Menen","Merbes-Sainte-Marie","Merbes-le-Château","Merchtem",
- "Merdorp","Mere","Merelbeke","Merendree",
- "Merkem","Merksem","Merksplas","Merlemont",
- "Mesen","Meslin-l'Evêque","Mesnil-Eglise","Mesnil-Saint-Blaise",
- "Mespelare","Messancy","Messelbroek","Mesvin",
- "Mettekoven","Mettet","Meulebeke","Meux",
- "Meyerode","Michelbeke","Micheroux","Middelburg",
- "Middelkerke","Mielen-boven-Aalst","Mignault","Millen",
- "Milmort","Minderhout","Mirwart","Miécret",
- "Modave","Moelingen","Moen","Moerbeke",
- "Moerbeke-Waas","Moere","Moerkerke","Moerzeke",
- "Moeskroen","Moha","Mohiville","Moignelée",
- "Moircy","Mol","Molenbaix","Molenbeek-Wersbeek",
- "Molenbeersel","Molenstede","Mollem","Momalle",
- "Momignies","Monceau-Imbrechies","Monceau-en-Ardenne",
- "Monceau-sur-Sambre","Mons","Mons-lez-Liège","Monstreux","Mont",
- "Mont-Gauthier","Mont-Saint-André","Mont-Saint-Aubert",
- "Mont-Saint-Guibert","Mont-Sainte-Aldegonde","Mont-Sainte-Geneviève",
- "Mont-de-l'Enclus","Mont-sur-Marchienne","Montbliart","Montegnée",
- "Montenaken","Montignies-Saint-Christophe","Montignies-lez-Lens",
- "Montignies-sur-Roc","Montignies-sur-Sambre","Montigny-le-Tilleul",
- "Montleban","Montroeul-au-Bois","Montroeul-sur-Haine","Montzen",
- "Moorsel","Moorsele","Moorslede","Moortsele",
- "Mopertingen","Moregem","Moresnet","Morhet",
- "Morialmé","Morkhoven","Morlanwelz","Morlanwelz-Mariemont",
- "Mormont","Mornimont","Mortier","Mortroux",
- "Mortsel","Morville","Moulbaix","Mourcourt",
- "Moustier","Moustier-sur-Sambre","Mouzaive","Moxhe",
- "Mozet","Muizen","Mullem","Munkzwalm",
- "Muno","Munsterbilzen","Munte","Musson",
- "Mussy-la-Ville","My","Méan","Mélin",
- "Mévergnies-lez-Lens","Naast","Nadrin","Nafraiture",
- "Nalinnes","Namur","Namêche","Nandrin",
- "Naninne","Naomé","Nassogne","Natoye",
- "Nazareth","Neder-over-Heembeek","Nederboelare","Nederbrakel",
- "Nederename","Nederhasselt","Nederokkerzeel","Nederzwalm-Hermelgem",
- "Neerglabbeek","Neerharen","Neerhespen","Neerheylissem",
- "Neerijse","Neerlanden","Neerlinter","Neeroeteren",
- "Neerpelt","Neerrepen","Neervelp","Neerwaasten",
- "Neerwinden","Neigem","Nerem","Nessonvaux",
- "Nethen","Nettinne","Neu-Moresnet","Neufchâteau",
- "Neufmaison","Neufvilles","Neupré","Neuville",
- "Neuville-en-Condroz","Nevele","Niel","Niel-bij-As",
- "Niel-bij-Sint-Truiden","Nieuwenhove","Nieuwenrode","Nieuwerkerken",
- "Nieuwkapelle","Nieuwkerke","Nieuwkerken-Waas","Nieuwmunster",
- "Nieuwpoort","Nieuwrode","Nijlen","Nil-Saint-Vincent-Saint-Martin",
- "Nimy","Ninove","Nismes","Nivelles",
- "Niverlée","Nives","Nobressart","Nodebais",
- "Noduwez","Noirchain","Noirefontaine","Noiseux",
- "Nokere","Nollevaux","Noorderwijk","Noordschote",
- "Nossegem","Nothomb","Nouvelles","Noville",
- "Noville-les-Bois","Noville-sur-Méhaigne","Nukerke","Néchin",
- "Obaix","Obigies","Obourg","Ochamps",
- "Ocquier","Odeigne","Odeur","Oedelem",
- "Oekene","Oelegem","Oeren","Oeselgem",
- "Oetingen","Oeudeghien","Oevel","Offagne",
- "Ogy","Ohain","Ohey","Oignies-en-Thiérache",
- "Oisquercq","Oizy","Okegem","Olen",
- "Oleye","Ollignies","Olloy-sur-Viroin","Olmen",
- "Olne","Olsene","Omal","Ombret",
- "Omezée","On","Onhaye","Onkerzele",
- "Onnezies","Onoz","Onze-Lieve-Vrouw-Lombeek",
- "Onze-Lieve-Vrouw-Waver","Ooigem","Ooike","Oombergen","Oorbeek",
- "Oordegem","Oostakker","Oostduinkerke","Oosteeklo",
- "Oostende","Oosterzele","Oostham","Oostkamp",
- "Oostkerke-Damme","Oostkerke-Diksmuide","Oostmalle","Oostnieuwkerke",
- "Oostrozebeke","Oostvleteren","Oostwinkel","Opbrakel",
- "Opdorp","Opglabbeek","Opgrimbie","Ophain-Bois-Seigneur-Isaac",
- "Ophasselt","Opheers","Opheylissem","Ophoven",
- "Opitter","Oplinter","Opoeteren","Opont",
- "Opprebais","Oppuurs","Opvelp","Opwijk",
- "Orbais","Orchimont","Orcq","Ordingen",
- "Oret","Oreye","Orgeo","Ormeignies",
- "Orp-Jauche","Orp-le-Grand","Orroir","Orsmaal-Gussenhoven",
- "Ortho","Ostiches","Otegem","Oteppe",
- "Othée","Otrange","Ottenburg","Ottergem",
- "Ottignies","Ottignies-Louvain-la-Neuve","Oud-Heverlee",
- "Oud-Turnhout","Oudegem","Oudekapelle","Oudenaarde","Oudenaken",
- "Oudenburg","Oudergem","Ouffet","Ougrée",
- "Oupeye","Outer","Outgaarden","Outrelouxhe",
- "Outrijve","Ouwegem","Overboelare","Overhespen",
- "Overijse","Overmere","Overpelt","Overrepen",
- "Overwinden","Paal","Paifve","Pailhe",
- "Paliseul","Pamel","Papignies","Parike",
- "Passendale","Patignies","Paturages","Paulatem",
- "Pecq","Peer","Peissant","Pellaines",
- "Pellenberg","Pepingen","Pepinster","Perk",
- "Pervijze","Perwez","Perwez-Haillot","Pesche",
- "Pessoux","Petegem-aan-de-Leie","Petegem-aan-de-Schelde","Petigny",
- "Petit-Fays","Petit-Hallet","Petit-Rechain","Petit-Roeulx-lez-Braine",
- "Petit-Roeulx-lez-Nivelles","Petit-Thier","Petite-Chapelle","Peutie",
- "Philippeville","Pipaix","Piringen","Pironchamps",
- "Pittem","Piéton","Piétrain","Piétrebais",
- "Plainevaux","Plancenoit","Ploegsteert","Plombières",
- "Poederlee","Poeke","Poelkapelle","Poesele",
- "Pollare","Polleur","Pollinkhove","Pommeroeul",
- "Pondrôme","Pont-de-Loup","Pont-à-Celles","Pontillas",
- "Poperinge","Poppel","Popuelles","Porcheresse",
- "Pottes","Poucet","Poulseur","Poupehan",
- "Pousset","Presgaux","Presles","Profondeville",
- "Proven","Pry","Pulderbos","Pulle",
- "Purnode","Pussemange","Putte","Puurs",
- "Péronnes-lez-Antoing","Péronnes-lez-Binche","Péruwelz","Quaregnon",
- "Quartes","Quenast","Queue-du-Bois","Quevaucamps",
- "Quiévrain","Quévy","Quévy-le-Grand","Quévy-le-Petit",
- "Rachecourt","Racour","Raeren","Ragnies",
- "Rahier","Ramegnies","Ramegnies-Chin","Ramelot",
- "Ramillies-Offus","Ramsdonk","Ramsel","Ramskapelle-Knokke-Heist",
- "Ramskapelle-Nieuwpoort","Rance","Ransart","Ransberg",
- "Ranst","Ravels","Rebaix","Rebecq",
- "Rebecq-Rognon","Recht","Recogne","Redu",
- "Reet","Rekem","Rekkem","Relegem",
- "Remagne","Remersdaal","Remicourt","Rendeux",
- "Reninge","Reningelst","Renlies","Reppel",
- "Ressaix","Ressegem","Resteigne","Retie",
- "Retinne","Reuland","Rhisnes","Richelle",
- "Riemst","Rienne","Rijkel","Rijkevorsel",
- "Rijkhoven","Rijmenam","Riksingen","Rillaar",
- "Rivière","Rixensart","Rièzes","Robechies",
- "Robelmont","Robertville","Roborst","Rochefort",
- "Rochehaut","Rocherath","Roclenge-sur-Geer","Rocourt",
- "Roesbrugge-Haringe","Roeselare","Rognée","Roisin",
- "Roksem","Rollegem","Rollegem-Kapelle","Roloux",
- "Roly","Romedenne","Romershoven","Romerée",
- "Romsée","Rongy","Ronquières","Ronse",
- "Ronsele","Roosbeek","Roosdaal","Roselies",
- "Rosières","Rosmeer","Rosoux-Crenwick","Rossignol",
- "Rosée","Rotem","Rotheux-Rimière","Rotselaar",
- "Roucourt","Rouveroy","Rouvreux","Rouvroy",
- "Roux","Roux-Miroir","Roy","Rozebeke",
- "Ruddervoorde","Ruette","Ruien","Ruisbroek",
- "Ruiselede","Rukkelingen-Loon","Rulles","Rumbeke",
- "Rumes","Rumillies","Rummen","Rumsdorp",
- "Rumst","Runkelen","Rupelmonde","Russeignies",
- "Rutten","Rèves","Saint-Amand","Saint-André",
- "Saint-Aubin","Saint-Denis","Saint-Denis-Bovesse",
- "Saint-Georges-sur-Meuse","Saint-Germain","Saint-Ghislain",
- "Saint-Gérard","Saint-Géry","Saint-Hubert","Saint-Jean-Geest",
- "Saint-Léger","Saint-Marc","Saint-Mard","Saint-Martin","Saint-Maur",
- "Saint-Médard","Saint-Nicolas","Saint-Pierre","Saint-Remy",
- "Saint-Remy-Geest","Saint-Sauveur","Saint-Servais","Saint-Symphorien",
- "Saint-Séverin","Saint-Vaast","Saint-Vincent","Sainte-Cécile",
- "Sainte-Marie-Chevigny","Sainte-Marie-sur-Semois","Sainte-Ode",
- "Saintes","Saive","Salles","Samart","Sambreville","Samrée",
- "Sankt-Vith","Sars-la-Bruyère","Sars-la-Buissière","Sart-Bernard",
- "Sart-Custinne","Sart-Dames-Avelines","Sart-Eustache",
- "Sart-Saint-Laurent","Sart-en-Fagne","Sart-lez-Spa","Sautin",
- "Sautour","Sauvenière","Schaarbeek","Schaffen","Schalkhoven",
- "Schaltin","Schelderode","Scheldewindeke","Schelle",
- "Schellebelle","Schendelbeke","Schepdaal","Scherpenheuvel",
- "Scherpenheuvel-Zichem","Schilde","Schoonaarde","Schore",
- "Schorisse","Schoten","Schriek","Schuiferskapelle",
- "Schulen","Schönberg","Sclayn","Scy",
- "Seilles","Seloignes","Semmerzake","Seneffe",
- "Sensenruth","Seny","Senzeille","Septon",
- "Seraing","Seraing-le-Château","Serinchamps","Serskamp",
- "Serville","Sibret","Signeulx","Sijsele",
- "Silenrieux","Silly","Sinaai-Waas","Sinsin",
- "Sint-Agatha-Berchem","Sint-Agatha-Rode","Sint-Amands",
- "Sint-Amandsberg","Sint-Andries","Sint-Antelinks","Sint-Baafs-Vijve",
- "Sint-Blasius-Boekel","Sint-Denijs","Sint-Denijs-Boekel",
- "Sint-Denijs-Westrem","Sint-Eloois-Vijve","Sint-Eloois-Winkel",
- "Sint-Genesius-Rode","Sint-Gillis","Sint-Gillis-Waas",
- "Sint-Gillis-bij-Dendermonde","Sint-Goriks-Oudenhove",
- "Sint-Huibrechts-Hern","Sint-Huibrechts-Lille","Sint-Jacobs-Kapelle",
- "Sint-Jan","Sint-Jan-in-Eremo","Sint-Jans-Molenbeek",
- "Sint-Job-in-'t-Goor","Sint-Joost-ten-Node","Sint-Joris-Beernem",
- "Sint-Joris-Nieuwpoort","Sint-Joris-Weert","Sint-Joris-Winge",
- "Sint-Katelijne-Waver","Sint-Katherina-Lombeek",
- "Sint-Kornelis-Horebeke","Sint-Kruis","Sint-Kruis-Winkel",
- "Sint-Kwintens-Lennik","Sint-Lambrechts-Herk",
- "Sint-Lambrechts-Woluwe","Sint-Laureins","Sint-Laureins-Berchem",
- "Sint-Lenaarts","Sint-Lievens-Esse","Sint-Lievens-Houtem",
- "Sint-Margriete","Sint-Margriete-Houtem","Sint-Maria-Horebeke",
- "Sint-Maria-Latem","Sint-Maria-Lierde","Sint-Maria-Oudenhove-Brakel",
- "Sint-Maria-Oudenhove-Zottegem","Sint-Martens-Bodegem",
- "Sint-Martens-Latem","Sint-Martens-Leerne","Sint-Martens-Lennik",
- "Sint-Martens-Lierde","Sint-Martens-Voeren","Sint-Michiels",
- "Sint-Niklaas","Sint-Pauwels","Sint-Pieters-Kapelle",
- "Sint-Pieters-Leeuw","Sint-Pieters-Rode","Sint-Pieters-Voeren",
- "Sint-Pieters-Woluwe","Sint-Rijkers","Sint-Stevens-Woluwe",
- "Sint-Truiden","Sint-Ulriks-Kapelle","Sippenaeken","Sirault","Sivry",
- "Sivry-Rance","Sleidinge","Slijpe","Slins","Sluizen",
- "Smeerebbe-Vloerzegem","Smetlede","Smuid","Snaaskerke",
- "Snellegem","Soheit-Tinlot","Sohier","Soignies",
- "Soiron","Solre-Saint-Géry","Solre-sur-Sambre","Sombreffe",
- "Somme-Leuze","Sommethonne","Sommière","Somzée",
- "Sorinne-la-Longue","Sorinnes","Sorée","Sosoye",
- "Sougné-Remouchamps","Soulme","Soumagne","Soumoy",
- "Sourbrodt","Souvret","Sovet","Soy",
- "Soye","Spa","Spalbeek","Spermalie",
- "Spiennes","Spiere","Spiere-Helkijn","Spontin",
- "Spouwen","Sprimont","Spy","Stabroek",
- "Staden","Stalhille","Stambruges","Stave",
- "Stavele","Stavelot","Steendorp","Steenhuffel",
- "Steenhuize-Wijnhuize","Steenkerke","Steenkerque","Steenokkerzeel",
- "Stekene","Stembert","Stene","Sterrebeek",
- "Stevoort","Stokrooie","Stoumont","Straimont",
- "Strijpen","Strijtem","Strombeek-Bever","Strée",
- "Strée-lez-Huy","Strépy-Bracquegnies","Stuivekenskerke","Suarlée",
- "Sugny","Surice","Suxy","Sélange",
- "Tailles","Taintignies","Tamines","Tarcienne",
- "Tavier","Taviers","Tavigny","Tellin",
- "Templeuve","Temploux","Temse","Tenneville",
- "Teralfene","Terhagen","Termes","Ternat",
- "Tertre","Tervuren","Terwagne","Tessenderlo",
- "Testelt","Teuven","Theux","Thiaumont",
- "Thieu","Thieulain","Thieusies","Thimister",
- "Thimister-Clermont","Thimougies","Thiméon","Thines",
- "Thirimont","Thisnes","Thommen","Thon",
- "Thorembais-Saint-Trond","Thorembais-les-Béguines",
- "Thoricourt","Thuillies","Thuin","Thulin","Thumaide","Thy-le-Bauduin",
- "Thy-le-Château","Thynes","Thys","Tiegem",
- "Tielen","Tielrode","Tielt","Tielt-Winge",
- "Tienen","Tignée","Tihange","Tildonk",
- "Tilff","Tillet","Tilleur","Tillier",
- "Tilly","Tinlot","Tintange","Tintigny",
- "Tisselt","Toernich","Tohogne","Tollembeek",
- "Tongeren","Tongerlo","Tongre-Notre-Dame","Tongre-Saint-Martin",
- "Tongrinne","Tontelange","Torgny","Torhout",
- "Tourinne","Tourinnes-Saint-Lambert","Tournai","Tournay",
- "Tourpes","Transinne","Trazegnies","Treignes",
- "Trembleur","Tremelo","Trivières","Trognée",
- "Trois-Ponts","Trooz","Tubize","Turnhout",
- "Ucimont","Uikhoven","Uitbergen","Uitkerke",
- "Ukkel","Ulbeek","Upigny","Ursel",
- "Vaalbeek","Val-Meer","Vance","Varendonk",
- "Varsenare","Vaucelles","Vaulx","Vaulx-lez-Chimay",
- "Vaux-Chavanne","Vaux-et-Borset","Vaux-lez-Rosières",
- "Vaux-sous-Chèvremont","Vaux-sur-Sûre","Vechmaal","Vedrin","Veerle",
- "Velaine-sur-Sambre","Velaines","Veldegem","Veldwezelt",
- "Vellereille-le-Sec","Vellereille-les-Brayeux","Velm","Velroux",
- "Veltem-Beisem","Velzeke-Ruddershove","Vencimont","Vergnies",
- "Verlaine","Verlée","Verrebroek","Vertrijk",
- "Verviers","Vesqueville","Veulen","Veurne",
- "Vezin","Vezon","Viane","Vichte",
- "Vielsalm","Viemme","Viersel","Vierset-Barse",
- "Vierves-sur-Viroin","Viesville","Vieux-Genappe","Vieux-Waleffe",
- "Vieuxville","Villance","Ville-Pommeroeul","Ville-en-Hesbaye",
- "Ville-sur-Haine","Villerot","Villers-Deux-Eglises",
- "Villers-Notre-Dame","Villers-Perwin","Villers-Poterie",
- "Villers-Saint-Amand","Villers-Saint-Ghislain",
- "Villers-Saint-Siméon","Villers-Sainte-Gertrude","Villers-aux-Tours",
- "Villers-devant-Orval","Villers-en-Fagne","Villers-l'Evêque",
- "Villers-la-Bonne-Eau","Villers-la-Loue","Villers-la-Tour",
- "Villers-la-Ville","Villers-le-Bouillet","Villers-le-Gambon",
- "Villers-le-Peuplier","Villers-le-Temple","Villers-lez-Heest",
- "Villers-sur-Lesse","Villers-sur-Semois","Vilvoorde","Vinalmont",
- "Vinderhoute","Vinkem","Vinkt","Virelles","Virginal-Samme",
- "Viroinval","Virton","Vissenaken","Visé",
- "Vitrival","Vivegnis","Vivy","Vladslo",
- "Vlamertinge","Vlekkem","Vleteren","Vlezenbeek",
- "Vliermaal","Vliermaalroot","Vlierzele","Vlijtingen",
- "Vlimmeren","Vlissegem","Vloesberg","Vodecée",
- "Vodelée","Voeren","Vogenée","Volkegem",
- "Vollezele","Vonêche","Voorde","Voormezele",
- "Voort","Voroux-Goreux","Voroux-lez-Liers","Vorselaar",
- "Vorsen","Vorst","Vosselaar","Vosselare",
- "Vossem","Vottem","Vrasene","Vremde",
- "Vreren","Vresse-sur-Semois","Vroenhoven","Vucht",
- "Vurste","Vyle-et-Tharoul","Waanrode","Waarbeke",
- "Waardamme","Waarloos","Waarmaarde","Waarschoot",
- "Waasmont","Waasmunster","Waasten","Wachtebeke",
- "Wadelincourt","Wagnelée","Waha","Waillet",
- "Wakken","Walcourt","Walem","Walhain",
- "Walhain-Saint-Paul","Walhorn","Walsbets","Walshoutem",
- "Waltwilder","Wambeek","Wancennes","Wandre",
- "Wanfercée-Baulet","Wange","Wangenies","Wanlin",
- "Wanne","Wannebecq","Wannegem-Lede","Wansin",
- "Wanze","Wanzele","Warchin","Warcoing",
- "Wardin","Waregem","Waremme","Waret-l'Evêque",
- "Waret-la-Chaussée","Warisoulx","Warnant","Warnant-Dreye",
- "Warquignies","Warsage","Warzée","Wasmes",
- "Wasmes-Audemez-Briffoeil","Wasmuel","Wasseiges","Waterland-Oudeman",
- "Waterloo","Watermaal-Bosvoorde","Watervliet","Watou",
- "Wattripont","Waudrez","Waulsort","Wauthier-Braine",
- "Waver","Wavreille","Wayaux","Ways",
- "Webbekom","Wechelderzande","Weelde","Weerde",
- "Weert","Wegnez","Weillen","Weismes",
- "Welden","Welkenraedt","Welle","Wellen",
- "Wellin","Wemmel","Wenduine","Werbomont",
- "Werchter","Werken","Werm","Wervik",
- "Wespelaar","Westende","Westerlo","Westkapelle",
- "Westkerke","Westmalle","Westmeerbeek","Westouter",
- "Westrem","Westrozebeke","Westvleteren","Wetteren",
- "Wevelgem","Wez-Velvain","Wezemaal","Wezembeek-Oppem",
- "Wezeren","Wibrin","Wichelen","Widooie",
- "Wiekevorst","Wielsbeke","Wierde","Wiers",
- "Wiesme","Wieze","Wihogne","Wihéries",
- "Wijchmaal","Wijer","Wijgmaal","Wijnegem",
- "Wijshagen","Wijtschate","Wilderen","Willaupuis",
- "Willebringen","Willebroek","Willemeau","Willerzie",
- "Wilrijk","Wilsele","Wilskerke","Wimmertingen",
- "Winenne","Wingene","Winksele","Wintershoven",
- "Witry","Wodecq","Woesten","Wolkrange",
- "Wolvertem","Wommelgem","Wommersom","Wonck",
- "Wondelgem","Wontergem","Wortegem","Wortegem-Petegem",
- "Wortel","Woubrechtegem","Woumen","Wulpen",
- "Wulvergem","Wulveringem","Wuustwezel","Wépion",
- "Wéris","Xhendelesse","Xhendremael","Xhoris",
- "Yernée-Fraineux","Yves-Gomezée","Yvoir","Zaffelare",
- "Zandbergen","Zande","Zandhoven","Zandvliet",
- "Zandvoorde-Oostende","Zandvoorde-Zonnebeke","Zarlardinge","Zarren",
- "Zaventem","Zedelgem","Zeebrugge","Zegelsem",
- "Zele","Zelem","Zellik","Zelzate",
- "Zemst","Zepperen","Zerkegem","Zevekote",
- "Zeveneken","Zeveren","Zevergem","Zichem",
- "Zichen-Zussen-Bolder","Zillebeke","Zingem","Zoerle-Parwijs",
- "Zoersel","Zolder","Zomergem","Zonhoven",
- "Zonnebeke","Zonnegem","Zottegem","Zoutenaaie",
- "Zoutleeuw","Zuidschote","Zuienkerke","Zulte",
- "Zulzeke","Zutendaal","Zwalm","Zwevegem",
- "Zwevezele","Zwijnaarde","Zwijndrecht","Zétrud-Lumay",
- "l'Escaillère"
+ "'s Herenelderen", "'s-Gravenvoeren", "'s-Gravenwezel", "Aaigem", "Aalbeke",
+ "Aalst", "Aalter", "Aarschot", "Aarsele", "Aartrijke", "Aartselaar", "Abolens",
+ "Abée", "Achel", "Achet", "Achêne", "Acosse", "Acoz", "Adegem", "Adinkerke",
+ "Affligem", "Afsnee", "Agimont", "Aineffe", "Aische-en-Refail", "Aiseau",
+ "Aiseau-Presles", "Aisemont", "Alken", "Alle", "Alleur", "Alsemberg",
+ "Alveringem", "Amay", "Amberloup", "Ambly", "Ambresin", "Amel", "Amonines",
+ "Amougies", "Ampsin", "Andenne", "Anderlecht", "Anderlues", "Andrimont",
+ "Angleur", "Angre", "Angreau", "Anhée", "Anlier", "Anloy", "Annevoie-Rouillon",
+ "Ans", "Anseremme", "Anseroeul", "Antheit", "Anthisnes", "Anthée", "Antoing",
+ "Antwerpen", "Anvaing", "Anzegem", "Appels", "Appelterre-Eichem", "Arbre",
+ "Arbrefontaine", "Arc-Ainières", "Arc-Wattripont", "Archennes", "Ardooie",
+ "Arendonk", "Argenteau", "Arlon", "Arquennes", "Arsimont", "Arville", "As",
+ "Aspelare", "Asper", "Asquillies", "Asse", "Assebroek", "Assenede", "Assenois",
+ "Assent", "Assesse", "Astene", "Ath", "Athis", "Athus", "Attenhoven", "Attenrode",
+ "Attert", "Attre", "Aubange", "Aubechies", "Aubel", "Aublain", "Auby-sur-Semois",
+ "Audregnies", "Aulnois", "Autelbas", "Autre-Eglise", "Autreppe", "Auvelais",
+ "Ave-et-Auffe", "Avekapelle", "Avelgem", "Avennes", "Averbode",
+ "Avernas-le-Bauduin", "Avin", "Awans", "Awenne", "Awirs", "Aye", "Ayeneux",
+ "Aywaille", "Baaigem", "Baal", "Baardegem", "Baarle-Hertog", "Baasrode",
+ "Bachte-Maria-Leerne", "Baelen", "Bagimont", "Baileux", "Bailièvre", "Baillamont",
+ "Bailleul", "Baillonville", "Baisieux", "Baisy-Thy", "Balegem", "Balen",
+ "Balâtre", "Bambrugge", "Bande", "Barbençon", "Barchon", "Baronville", "Barry",
+ "Barvaux-Condroz", "Barvaux-sur-Ourthe", "Bas-Oha", "Basse-Bodeux", "Bassenge",
+ "Bassevelde", "Bassilly", "Bastogne", "Basècles", "Batsheers", "Battice",
+ "Battignies", "Baudour", "Bauffe", "Baugnies", "Baulers", "Bavegem", "Bavikhove",
+ "Bazel", "Beaufays", "Beaumont", "Beauraing", "Beausaint", "Beauvoorde",
+ "Beauwelz", "Beclers", "Beek", "Beerlegem", "Beernem", "Beerse", "Beersel",
+ "Beerst", "Beert", "Beervelde", "Beerzel", "Beez", "Beffe", "Begijnendijk",
+ "Beho", "Beigem", "Bekegem", "Bekkerzeel", "Bekkevoort", "Belgrade", "Bellaire",
+ "Bellecourt", "Bellefontaine", "Bellegem", "Bellem", "Bellevaux",
+ "Bellevaux-Ligneuville", "Bellingen", "Beloeil", "Belsele", "Ben-Ahin", "Bende",
+ "Berbroek", "Berchem", "Berendrecht", "Berg", "Bergilers", "Beringen", "Berlaar",
+ "Berlare", "Berlingen", "Berloz", "Berneau", "Bernissart", "Bersillies-l'Abbaye",
+ "Bertem", "Bertogne", "Bertrix", "Bertrée", "Berzée", "Beselare", "Betekom",
+ "Bettincourt", "Beuzet", "Bevekom", "Bevel", "Bever", "Bevercé", "Bevere",
+ "Beveren-Leie", "Beveren-Roeselare", "Beveren-Waas", "Beveren-aan-den-Ijzer",
+ "Beverlo", "Beverst", "Beyne-Heusay", "Bienne-lez-Happart", "Bierbeek", "Biercée",
+ "Bierges", "Bierghes", "Bierset", "Bierwart", "Biesme", "Biesme-sous-Thuin",
+ "Biesmerée", "Biez", "Bihain", "Bikschote", "Bilstain", "Bilzen", "Binche",
+ "Binderveld", "Binkom", "Bioul", "Bissegem", "Bizet", "Bièvre", "Blaasveld",
+ "Blaimont", "Blandain", "Blanden", "Blankenberge", "Blaregnies", "Blaton",
+ "Blaugies", "Blehen", "Bleid", "Bleret", "Blicquy", "Blégny", "Bléharies",
+ "Bocholt", "Boechout", "Boekhout", "Boekhoute", "Boezinge", "Bogaarden", "Bohan",
+ "Boignée", "Boirs", "Bois-d'Haine", "Bois-de-Lessines", "Bois-de-Villers",
+ "Bois-et-Borsu", "Bolinne", "Bolland", "Bomal", "Bomal-sur-Ourthe", "Bombaye",
+ "Bommershoven", "Bon-Secours", "Boncelles", "Boneffe", "Bonheiden", "Boninne",
+ "Bonlez", "Bonnert", "Bonneville", "Bonsin", "Booischot", "Booitshoeke", "Boom",
+ "Boorsem", "Boortmeerbeek", "Borchtlombeek", "Borgerhout", "Borgloon", "Borlez",
+ "Borlo", "Borlon", "Bornem", "Bornival", "Borsbeek", "Borsbeke", "Bossière",
+ "Bossuit", "Bossut-Gottechain", "Bost", "Bothey", "Bottelare", "Bouffioulx",
+ "Bouge", "Bougnies", "Bouillon", "Bourlers", "Bourseigne-Neuve",
+ "Bourseigne-Vieille", "Boussoit", "Boussu", "Boussu-en-Fagne",
+ "Boussu-lez-Walcourt", "Bousval", "Boutersem", "Bouvignes-sur-Meuse",
+ "Bouvignies", "Bouwel", "Bovekerke", "Bovelingen", "Bovenistier", "Bovesse",
+ "Bovigny", "Boëlhe", "Bra", "Braffe", "Braibant", "Braine-l'Alleud",
+ "Braine-le-Château", "Braine-le-Comte", "Braives", "Brakel", "Branchon", "Bras",
+ "Brasmenil", "Brasschaat", "Bray", "Brecht", "Bredene", "Bree", "Breendonk",
+ "Bressoux", "Briegden", "Brielen", "Broechem", "Broekom", "Brugelette", "Brugge",
+ "Brunehaut", "Brussegem", "Brussel", "Brustem", "Bruyelle", "Brye", "Brûly",
+ "Brûly-de-Pesche", "Budingen", "Buggenhout", "Buissenal", "Buissonville",
+ "Buizingen", "Buken", "Bulskamp", "Bunsbeek", "Burcht", "Burdinne", "Bure",
+ "Burg-Reuland", "Burst", "Bury", "Buvingen", "Buvrinnes", "Buzenol", "Buzet",
+ "Büllingen", "Bütgenbach", "Callenelle", "Calonne", "Cambron-Casteau",
+ "Cambron-Saint-Vincent", "Carlsbourg", "Carnières", "Casteau", "Castillon",
+ "Celles", "Cerfontaine", "Chaineux", "Chairière", "Champion", "Champlon",
+ "Chanly", "Chantemelle", "Chapelle-lez-Herlaimont", "Chapelle-à-Oie",
+ "Chapelle-à-Wattines", "Chapon-Seraing", "Charleroi", "Charneux", "Chassepierre",
+ "Chastre", "Chastre-Villeroux-Blanmont", "Chastrès", "Chaudfontaine",
+ "Chaumont-Gistoux", "Chaussée-Notre-Dame-Louvignies", "Cherain", "Cheratte",
+ "Chercq", "Chevetogne", "Chevron", "Chimay", "Chiny", "Chièvres", "Chokier",
+ "Châtelet", "Châtelineau", "Châtillon", "Chênée", "Ciergnon", "Ciney", "Ciplet",
+ "Ciply", "Clabecq", "Clavier", "Clermont", "Clermont-sous-Huy", "Cognelée",
+ "Colfontaine", "Comblain-Fairon", "Comblain-au-Pont", "Comblain-la-Tour",
+ "Conneux", "Corbais", "Corbion", "Cordes", "Corenne", "Cornesse", "Cornimont",
+ "Corroy-le-Château", "Corroy-le-Grand", "Corswarem", "Cortil-Noirmont",
+ "Cortil-Wodon", "Couillet", "Cour-sur-Heure", "Courcelles", "Courrière",
+ "Court-Saint-Etienne", "Couthuin", "Coutisse", "Couture-Saint-Germain", "Couvin",
+ "Cras-Avernas", "Crehen", "Crisnée", "Croix-lez-Rouveroy", "Crombach", "Crupet",
+ "Cuesmes", "Cugnon", "Cul-des-Sarts", "Custinne", "Cérexhe-Heuseux",
+ "Céroux-Mousty", "Dadizele", "Dailly", "Daknam", "Dalhem", "Damme", "Dampicourt",
+ "Dampremy", "Darion", "Daussois", "Daussoulx", "Dave", "Daverdisse", "De Haan",
+ "De Klinge", "De Moeren", "De Panne", "De Pinte", "Deerlijk", "Deftinge",
+ "Deinze", "Denderbelle", "Denderhoutem", "Denderleeuw", "Dendermonde",
+ "Denderwindeke", "Dentergem", "Denée", "Dergneau", "Dessel", "Desselgem",
+ "Destelbergen", "Desteldonk", "Deurle", "Deurne", "Deux-Acren", "Dhuy",
+ "Diepenbeek", "Diest", "Diets-Heur", "Dikkebus", "Dikkele", "Dikkelvenne",
+ "Diksmuide", "Dilbeek", "Dilsen-Stokkem", "Dinant", "Dion", "Dion-Valmont",
+ "Dison", "Dochamps", "Doel", "Dohan", "Doische", "Dolembreux", "Donceel",
+ "Dongelberg", "Donk", "Donstiennes", "Dorinne", "Dormaal", "Dottenijs", "Dour",
+ "Dourbes", "Dranouter", "Driekapellen", "Drieslinter", "Drogenbos", "Drongen",
+ "Dréhance", "Dudzele", "Duffel", "Duisburg", "Duras", "Durbuy", "Durnal", "Dworp",
+ "Eben-Emael", "Ebly", "Ecaussinnes", "Ecaussinnes-Lalaing",
+ "Ecaussinnes-d'Enghien", "Edegem", "Edelare", "Edingen", "Eeklo", "Eernegem",
+ "Egem", "Eggewaartskapelle", "Eghezée", "Ehein", "Eigenbilzen", "Eindhout",
+ "Eine", "Eisden", "Eke", "Ekeren", "Eksaarde", "Eksel", "Elen", "Elene",
+ "Elewijt", "Eliksem", "Elingen", "Ellemelle", "Ellezelles",
+ "Ellignies-Sainte-Anne", "Ellignies-lez-Frasnes", "Ellikom", "Elouges", "Elsegem",
+ "Elsenborn", "Elsene", "Elst", "Elverdinge", "Elversele", "Emblem", "Embourg",
+ "Emelgem", "Emines", "Emptinne", "Ename", "Engelmanshoven", "Engis", "Enines",
+ "Ensival", "Epinois", "Eppegem", "Eprave", "Erbaut", "Erbisoeul", "Ere",
+ "Erembodegem", "Erezée", "Ermeton-sur-Biert", "Ernage", "Erneuville", "Ernonheid",
+ "Erondegem", "Erpe", "Erpe-Mere", "Erpent", "Erpion", "Erps-Kwerps",
+ "Erquelinnes", "Erquennes", "Ertvelde", "Erwetegem", "Escanaffles", "Esen",
+ "Esneux", "Esplechin", "Esquelmes", "Essen", "Essene", "Estaimbourg",
+ "Estaimpuis", "Estinnes", "Estinnes-au-Mont", "Estinnes-au-Val", "Etalle", "Ethe",
+ "Etikhove", "Ettelgem", "Etterbeek", "Eugies", "Eupen", "Evegnée", "Evelette",
+ "Everbeek", "Everberg", "Evere", "Evergem", "Evregnies", "Evrehailles",
+ "Eynatten", "Ezemaal", "Fagnolle", "Faimes", "Falaën", "Falisolle", "Fallais",
+ "Falmagne", "Falmignoul", "Familleureux", "Farciennes", "Faulx-les-Tombes",
+ "Fauroeulx", "Fauvillers", "Faymonville", "Fays-les-Veneurs", "Fayt-le-Franc",
+ "Fayt-lez-Manage", "Felenne", "Feluy", "Feneur", "Fernelmont", "Ferrières",
+ "Feschaux", "Fexhe-Slins", "Fexhe-le-Haut-Clocher", "Filot", "Finnevaux",
+ "Fize-Fontaine", "Fize-le-Marsal", "Flamierge", "Flavion", "Flawinne", "Fleurus",
+ "Floreffe", "Florennes", "Florenville", "Floriffoux", "Florée", "Flostoy",
+ "Flémalle", "Flémalle-Grande", "Flémalle-Haute", "Flénu", "Fléron", "Flône",
+ "Focant", "Folx-les-Caves", "Fontaine-Valmont", "Fontaine-l'Evêque", "Fontenelle",
+ "Fontenoille", "Fontenoy", "Fooz", "Forchies-la-Marche", "Forest", "Forges",
+ "Forges-Philippe", "Forrières", "Forville", "Forêt", "Fosse", "Fosses-la-Ville",
+ "Fouleng", "Fourbechies", "Foy-Notre-Dame", "Fraipont", "Fraire", "Fraiture",
+ "Frameries", "Framont", "Franc-Waret", "Franchimont", "Francorchamps", "Franière",
+ "Frasnes", "Frasnes-lez-Anvaing", "Frasnes-lez-Buissenal",
+ "Frasnes-lez-Gosselies", "Freloux", "Freux", "Froidchapelle", "Froidfontaine",
+ "Froidmont", "Fronville", "Froyennes", "Fumal", "Furfooz", "Furnaux", "Gaasbeek",
+ "Gages", "Gallaix", "Galmaarden", "Ganshoren", "Gaurain-Ramecroix", "Gavere",
+ "Gedinne", "Geel", "Geer", "Geest-Gérompont-Petit-Rosière", "Geetbets",
+ "Gelbressée", "Gelinden", "Gellik", "Gelrode", "Geluveld", "Geluwe", "Gembes",
+ "Gembloux", "Gemmenich", "Genappe", "Genk", "Genly", "Genoelselderen", "Gent",
+ "Gentbrugge", "Gentinnes", "Genval", "Geraardsbergen", "Gerdingen", "Gerin",
+ "Gerpinnes", "Gestel", "Gesves", "Ghislenghien", "Ghlin", "Ghoy", "Gibecq",
+ "Gierle", "Gijverinkhove", "Gijzegem", "Gijzelbrechtegem", "Gijzenzele", "Gilly",
+ "Gimnée", "Gingelom", "Gistel", "Gits", "Givry", "Glabais", "Glabbeek-Zuurbemde",
+ "Glain", "Gleixhe", "Glimes", "Glons", "Gochenée", "Godarville", "Godinne",
+ "Godveerdegem", "Goeferdinge", "Goegnies-Chaussée", "Goesnes", "Goetsenhoven",
+ "Gomzé-Andoumont", "Gondregnies", "Gonrieux", "Gontrode", "Gooik", "Gors-Opleeuw",
+ "Gorsem", "Gosselies", "Gotem", "Gottem", "Gottignies", "Gougnies", "Gourdinne",
+ "Goutroux", "Gouvy", "Gouy-lez-Piéton", "Gozée", "Goé", "Graide", "Grammene",
+ "Grand-Axhe", "Grand-Hallet", "Grand-Halleux", "Grand-Leez", "Grand-Manil",
+ "Grand-Rechain", "Grand-Reng", "Grand-Rosière-Hottomont", "Grandglise",
+ "Grandhan", "Grandmenil", "Grandmetz", "Grandrieu", "Grandville", "Grandvoir",
+ "Grapfontaine", "Graty", "Graux", "Grazen", "Grembergen", "Grez-Doiceau",
+ "Grimbergen", "Grimminge", "Grivegnée", "Grobbendonk", "Groot-Bijgaarden",
+ "Groot-Gelmen", "Groot-Loon", "Gros-Fays", "Grosage", "Grote-Brogel",
+ "Grote-Spouwen", "Grotenberge", "Gruitrode", "Grune", "Grupont", "Grâce-Berleur",
+ "Grâce-Hollogne", "Guignies", "Guigoven", "Guirsch", "Gullegem", "Gutschoven",
+ "Gérompont", "Gérouville", "Haacht", "Haaltert", "Haasdonk", "Haasrode", "Habay",
+ "Habay-la-Neuve", "Habay-la-Vieille", "Habergy", "Haccourt", "Hachy",
+ "Hacquegnies", "Haillot", "Haine-Saint-Paul", "Haine-Saint-Pierre", "Hainin",
+ "Hakendover", "Halanzy", "Halen", "Hallaar", "Halle", "Halle-Booienhoven",
+ "Halleux", "Halma", "Halmaal", "Haltinne", "Ham", "Ham-sur-Heure",
+ "Ham-sur-Heure-Nalinnes", "Ham-sur-Sambre", "Hamipré", "Hamme", "Hamme-Mille",
+ "Hamoir", "Hamois", "Hamont", "Hamont-Achel", "Hampteau", "Han-sur-Lesse",
+ "Handzame", "Haneffe", "Hannut", "Hannêche", "Hanret", "Hansbeke",
+ "Hantes-Wihéries", "Hanzinelle", "Hanzinne", "Harchies", "Harelbeke", "Haren",
+ "Haren-Borgloon", "Haren-Tongeren", "Hargimont", "Harmignies", "Harnoncourt",
+ "Harre", "Harsin", "Harveng", "Harzé", "Hasselt", "Hastière", "Hastière-Lavaux",
+ "Hastière-par-Delà", "Hatrival", "Haulchin", "Hauset", "Haut-Fays", "Haut-Ittre",
+ "Haut-le-Wastia", "Hautrage", "Havay", "Havelange", "Haversin", "Havinnes",
+ "Havré", "Hechtel", "Hechtel-Eksel", "Heer", "Heers", "Hees", "Heestert",
+ "Heffen", "Heikruis", "Heindonk", "Heinsch", "Heist-aan-Zee", "Heist-op-den-Berg",
+ "Hekelgem", "Heks", "Helchteren", "Heldergem", "Helen-Bos", "Helkijn",
+ "Hellebecq", "Hemelveerdegem", "Hemiksem", "Hemptinne", "Hemptinne-lez-Florennes",
+ "Hendrieken", "Henis", "Hennuyères", "Henri-Chapelle", "Henripont", "Hensies",
+ "Heppen", "Heppenbach", "Heppignies", "Herbeumont", "Herchies", "Herderen",
+ "Herdersem", "Herent", "Herentals", "Herenthout", "Herfelingen", "Hergenrath",
+ "Herk-de-Stad", "Hermalle-sous-Argenteau", "Hermalle-sous-Huy",
+ "Hermeton-sur-Meuse", "Hermée", "Herne", "Herquegies", "Herseaux", "Herselt",
+ "Herstal", "Herstappe", "Hertain", "Herten", "Hertsberge", "Herve", "Herzele",
+ "Heule", "Heure", "Heure-le-Romain", "Heurne", "Heusden", "Heusden-Zolder",
+ "Heusy", "Heuvelland", "Hever", "Heverlee", "Heyd", "Hillegem", "Hingene",
+ "Hingeon", "Hives", "Hoboken", "Hodeige", "Hodister", "Hody", "Hoegaarden",
+ "Hoeilaart", "Hoeke", "Hoelbeek", "Hoeleden", "Hoepertingen", "Hoeselt",
+ "Hoevenen", "Hofstade", "Hogne", "Hognoul", "Hollain", "Hollange", "Hollebeke",
+ "Hollogne-aux-Pierres", "Hollogne-sur-Geer", "Holsbeek", "Hombeek", "Hombourg",
+ "Hompré", "Hondelange", "Honnay", "Honnelles", "Hooglede", "Hoogstade",
+ "Hoogstraten", "Horebeke", "Horion-Hozémont", "Hornu", "Horpmaal", "Horrues",
+ "Hotton", "Houdemont", "Houdeng-Aimeries", "Houdeng-Goegnies", "Houdremont",
+ "Houffalize", "Hour", "Housse", "Houtain-Saint-Siméon", "Houtain-le-Val",
+ "Houtaing", "Houtave", "Houtem", "Houthalen", "Houthalen-Helchteren", "Houthem",
+ "Houthulst", "Houtvenne", "Houwaart", "Houx", "Houyet", "Hove", "Hoves",
+ "Howardries", "Huccorgne", "Huise", "Huissignies", "Huizingen", "Huldenberg",
+ "Hulshout", "Hulsonniaux", "Hulste", "Humain", "Humbeek", "Hundelgem", "Huppaye",
+ "Huy", "Hyon", "Hélécine", "Hérinnes-lez-Pecq", "Héron", "Hévillers", "Ichtegem",
+ "Iddergem", "Idegem", "Ieper", "Impe", "Incourt", "Ingelmunster", "Ingooigem",
+ "Irchonwelz", "Isières", "Isnes", "Itegem", "Itterbeek", "Ittre", "Ivoz-Ramet",
+ "Izegem", "Izel", "Izenberge", "Izier", "Jabbeke", "Jalhay", "Jallet", "Jamagne",
+ "Jambes", "Jamiolle", "Jamioulx", "Jamoigne", "Jandrain-Jandrenouille", "Jauche",
+ "Jauchelette", "Javingue", "Jehay", "Jehonville", "Jemappes", "Jemelle",
+ "Jemeppe-sur-Meuse", "Jemeppe-sur-Sambre", "Jeneffe", "Jesseren", "Jette", "Jeuk",
+ "Jodoigne", "Jodoigne-Souveraine", "Jollain-Merlin", "Joncret", "Julémont",
+ "Jumet", "Jupille-sur-Meuse", "Juprelle", "Jurbise", "Juseret", "Kaaskerke",
+ "Kachtem", "Kaggevinne", "Kain", "Kalken", "Kallo", "Kallo-Kieldrecht",
+ "Kalmthout", "Kampenhout", "Kanegem", "Kanne", "Kapelle-op-den-Bos", "Kapellen",
+ "Kaprijke", "Kaster", "Kasterlee", "Kaulille", "Keerbergen", "Keiem", "Kelmis",
+ "Kemexhe", "Kemmel", "Kemzeke", "Kerkhove", "Kerkom", "Kerkom-bij-Sint-Truiden",
+ "Kerksken", "Kermt", "Kerniel", "Kersbeek-Miskom", "Kessel", "Kessel-Lo",
+ "Kessenich", "Kester", "Kettenis", "Keumiée", "Kieldrecht", "Kinrooi",
+ "Klein-Gelmen", "Kleine-Brogel", "Kleine-Spouwen", "Klemskerke", "Klerken",
+ "Kluisbergen", "Kluizen", "Knesselare", "Knokke", "Knokke-Heist", "Kobbegem",
+ "Koekelare", "Koekelberg", "Koersel", "Koksijde", "Kolmont-Borgloon",
+ "Kolmont-Tongeren", "Komen", "Komen-Waasten", "Koningshooikt", "Koninksem",
+ "Kontich", "Kooigem", "Koolkerke", "Koolskamp", "Korbeek-Dijle", "Korbeek-Lo",
+ "Kortemark", "Kortenaken", "Kortenberg", "Kortessem", "Kortijs", "Kortrijk",
+ "Kortrijk-Dutsel", "Kozen", "Kraainem", "Krombeke", "Kruibeke", "Kruishoutem",
+ "Kumtich", "Kuringen", "Kuttekoven", "Kuurne", "Kwaadmechelen", "Kwaremont", "La",
+ "La Bruyère", "La Glanerie", "La Gleize", "La Hestre", "La Hulpe", "La Louvière",
+ "La bouverie", "La-Roche-en-Ardenne", "Laakdal", "Laar", "Laarne", "Labuissière",
+ "Lacuisine", "Ladeuze", "Laforêt", "Lahamaide", "Laken", "Lamain", "Lambermont",
+ "Lambusart", "Lamine", "Lamontzée", "Lamorteau", "Lampernisse", "Lanaken",
+ "Lanaye", "Landegem", "Landelies", "Landen", "Landenne", "Landskouter", "Laneffe",
+ "Langdorp", "Langemark", "Langemark-Poelkapelle", "Lanklaar", "Lanquesaint",
+ "Lantin", "Lantremange", "Laplaigne", "Lapscheure", "Lasne",
+ "Lasne-Chapelle-Saint-Lambert", "Lathuy", "Latinne", "Latour", "Lauw", "Lauwe",
+ "Lavacherie", "Lavaux-Sainte-Anne", "Lavoir", "Le Mesniel", "Le Roeulx",
+ "Le Roux", "Lebbeke", "Lede", "Ledeberg", "Ledegem", "Leefdaal", "Leerbeek",
+ "Leernes", "Leers-Nord", "Leers-et-Fosteau", "Leest", "Leeuwergem", "Leffinge",
+ "Leignon", "Leisele", "Leke", "Lembeek", "Lembeke", "Lemberge", "Lendelede",
+ "Lennik", "Lens", "Lens-Saint-Remy", "Lens-Saint-Servais", "Lens-sur-Geer",
+ "Leopoldsburg", "Les Avins", "Les Bons", "Les Bulles", "Les Hayons",
+ "Les Waleffes", "Lesdain", "Lessines", "Lessive", "Lesterny", "Lesve",
+ "Lettelingen", "Letterhoutem", "Leugnies", "Leupegem", "Leut", "Leuven", "Leuze",
+ "Leuze-en-Hainaut", "Leval-Chaudeville", "Leval-Trahegnies", "Liberchies",
+ "Libin", "Libramont", "Libramont-Chevigny", "Lichtaart", "Lichtervelde",
+ "Liedekerke", "Lieferinge", "Lier", "Lierde", "Lierneux", "Liernu", "Liers",
+ "Liezele", "Ligne", "Ligney", "Ligny", "Lille", "Lillo", "Lillois-Witterzée",
+ "Limal", "Limbourg", "Limelette", "Limerlé", "Limont", "Lincent", "Linden",
+ "Linkebeek", "Linkhout", "Linsmeau", "Lint", "Linter", "Lippelo", "Lisogne",
+ "Lissewege", "Lives-sur-Meuse", "Lixhe", "Liège", "Lo", "Lo-Reninge", "Lobbes",
+ "Lochristi", "Lodelinsart", "Loenhout", "Loker", "Lokeren", "Loksbergen",
+ "Lombardsijde", "Lombise", "Lommel", "Lommersweiler", "Lompret", "Lomprez",
+ "Loncin", "Londerzeel", "Longchamps", "Longlier", "Longueville", "Longvilly",
+ "Lontzen", "Lonzée", "Loonbeek", "Loppem", "Lorcé", "Lot", "Lotenhulle",
+ "Louette-Saint-Denis", "Louette-Saint-Pierre", "Loupoigne", "Louvain-la-Neuve",
+ "Louveigné", "Lovendegem", "Lovenjoel", "Loverval", "Loyers", "Lubbeek",
+ "Luingne", "Lummen", "Lustin", "Luttre", "Léglise", "Maarke-Kerkem", "Maarkedal",
+ "Maaseik", "Maasmechelen", "Mabompré", "Machelen", "Macon", "Macquenoise",
+ "Maffe", "Maffle", "Magnée", "Maillen", "Mainvault", "Maisières", "Maissin",
+ "Maizeret", "Mal", "Maldegem", "Malderen", "Malempré", "Malle", "Malmedy",
+ "Malonne", "Malvoisin", "Malèves-Sainte-Marie-Wastines", "Manage", "Manderfeld",
+ "Manhay", "Mannekensvere", "Maransart", "Marbais", "Marbaix", "Marbehan",
+ "Marche-en-Famenne", "Marche-les-Dames", "Marche-lez-Ecaussinnes",
+ "Marchienne-au-Pont", "Marchin", "Marchipont", "Marchovelette", "Marcinelle",
+ "Marcourt", "Marenne", "Mariakerke", "Mariekerke", "Mariembourg", "Marilles",
+ "Mark", "Marke", "Markegem", "Marneffe", "Marquain", "Martelange", "Martenslinde",
+ "Martouzin-Neuville", "Masbourg", "Masnuy-Saint-Jean", "Masnuy-Saint-Pierre",
+ "Massemen", "Massenhoven", "Matagne-la-Grande", "Matagne-la-Petite", "Mater",
+ "Maubray", "Maulde", "Maurage", "Mazenzele", "Mazy", "Mazée", "Mechelen",
+ "Mechelen-Bovelingen", "Mechelen-aan-de-Maas", "Meeffe", "Meensel-Kiezegem",
+ "Meer", "Meerbeek", "Meerbeke", "Meerdonk", "Meerhout", "Meerle", "Meeswijk",
+ "Meetkerke", "Meeuwen", "Meeuwen-Gruitrode", "Mehaigne", "Meigem", "Meilegem",
+ "Meise", "Meix-devant-Virton", "Meix-le-Tige", "Melden", "Meldert", "Melen",
+ "Melkwezer", "Melle", "Mellery", "Melles", "Mellet", "Mellier", "Melsbroek",
+ "Melsele", "Melsen", "Membach", "Membre", "Membruggen", "Mendonk", "Menen",
+ "Merbes-Sainte-Marie", "Merbes-le-Château", "Merchtem", "Merdorp", "Mere",
+ "Merelbeke", "Merendree", "Merkem", "Merksem", "Merksplas", "Merlemont", "Mesen",
+ "Meslin-l'Evêque", "Mesnil-Eglise", "Mesnil-Saint-Blaise", "Mespelare",
+ "Messancy", "Messelbroek", "Mesvin", "Mettekoven", "Mettet", "Meulebeke", "Meux",
+ "Meyerode", "Michelbeke", "Micheroux", "Middelburg", "Middelkerke",
+ "Mielen-boven-Aalst", "Mignault", "Millen", "Milmort", "Minderhout", "Mirwart",
+ "Miécret", "Modave", "Moelingen", "Moen", "Moerbeke", "Moerbeke-Waas", "Moere",
+ "Moerkerke", "Moerzeke", "Moeskroen", "Moha", "Mohiville", "Moignelée", "Moircy",
+ "Mol", "Molenbaix", "Molenbeek-Wersbeek", "Molenbeersel", "Molenstede", "Mollem",
+ "Momalle", "Momignies", "Monceau-Imbrechies", "Monceau-en-Ardenne",
+ "Monceau-sur-Sambre", "Mons", "Mons-lez-Liège", "Monstreux", "Mont",
+ "Mont-Gauthier", "Mont-Saint-André", "Mont-Saint-Aubert", "Mont-Saint-Guibert",
+ "Mont-Sainte-Aldegonde", "Mont-Sainte-Geneviève", "Mont-de-l'Enclus",
+ "Mont-sur-Marchienne", "Montbliart", "Montegnée", "Montenaken",
+ "Montignies-Saint-Christophe", "Montignies-lez-Lens", "Montignies-sur-Roc",
+ "Montignies-sur-Sambre", "Montigny-le-Tilleul", "Montleban", "Montroeul-au-Bois",
+ "Montroeul-sur-Haine", "Montzen", "Moorsel", "Moorsele", "Moorslede", "Moortsele",
+ "Mopertingen", "Moregem", "Moresnet", "Morhet", "Morialmé", "Morkhoven",
+ "Morlanwelz", "Morlanwelz-Mariemont", "Mormont", "Mornimont", "Mortier",
+ "Mortroux", "Mortsel", "Morville", "Moulbaix", "Mourcourt", "Moustier",
+ "Moustier-sur-Sambre", "Mouzaive", "Moxhe", "Mozet", "Muizen", "Mullem",
+ "Munkzwalm", "Muno", "Munsterbilzen", "Munte", "Musson", "Mussy-la-Ville", "My",
+ "Méan", "Mélin", "Mévergnies-lez-Lens", "Naast", "Nadrin", "Nafraiture",
+ "Nalinnes", "Namur", "Namêche", "Nandrin", "Naninne", "Naomé", "Nassogne",
+ "Natoye", "Nazareth", "Neder-over-Heembeek", "Nederboelare", "Nederbrakel",
+ "Nederename", "Nederhasselt", "Nederokkerzeel", "Nederzwalm-Hermelgem",
+ "Neerglabbeek", "Neerharen", "Neerhespen", "Neerheylissem", "Neerijse",
+ "Neerlanden", "Neerlinter", "Neeroeteren", "Neerpelt", "Neerrepen", "Neervelp",
+ "Neerwaasten", "Neerwinden", "Neigem", "Nerem", "Nessonvaux", "Nethen",
+ "Nettinne", "Neu-Moresnet", "Neufchâteau", "Neufmaison", "Neufvilles", "Neupré",
+ "Neuville", "Neuville-en-Condroz", "Nevele", "Niel", "Niel-bij-As",
+ "Niel-bij-Sint-Truiden", "Nieuwenhove", "Nieuwenrode", "Nieuwerkerken",
+ "Nieuwkapelle", "Nieuwkerke", "Nieuwkerken-Waas", "Nieuwmunster", "Nieuwpoort",
+ "Nieuwrode", "Nijlen", "Nil-Saint-Vincent-Saint-Martin", "Nimy", "Ninove",
+ "Nismes", "Nivelles", "Niverlée", "Nives", "Nobressart", "Nodebais", "Noduwez",
+ "Noirchain", "Noirefontaine", "Noiseux", "Nokere", "Nollevaux", "Noorderwijk",
+ "Noordschote", "Nossegem", "Nothomb", "Nouvelles", "Noville", "Noville-les-Bois",
+ "Noville-sur-Méhaigne", "Nukerke", "Néchin", "Obaix", "Obigies", "Obourg",
+ "Ochamps", "Ocquier", "Odeigne", "Odeur", "Oedelem", "Oekene", "Oelegem", "Oeren",
+ "Oeselgem", "Oetingen", "Oeudeghien", "Oevel", "Offagne", "Ogy", "Ohain", "Ohey",
+ "Oignies-en-Thiérache", "Oisquercq", "Oizy", "Okegem", "Olen", "Oleye",
+ "Ollignies", "Olloy-sur-Viroin", "Olmen", "Olne", "Olsene", "Omal", "Ombret",
+ "Omezée", "On", "Onhaye", "Onkerzele", "Onnezies", "Onoz",
+ "Onze-Lieve-Vrouw-Lombeek", "Onze-Lieve-Vrouw-Waver", "Ooigem", "Ooike",
+ "Oombergen", "Oorbeek", "Oordegem", "Oostakker", "Oostduinkerke", "Oosteeklo",
+ "Oostende", "Oosterzele", "Oostham", "Oostkamp", "Oostkerke-Damme",
+ "Oostkerke-Diksmuide", "Oostmalle", "Oostnieuwkerke", "Oostrozebeke",
+ "Oostvleteren", "Oostwinkel", "Opbrakel", "Opdorp", "Opglabbeek", "Opgrimbie",
+ "Ophain-Bois-Seigneur-Isaac", "Ophasselt", "Opheers", "Opheylissem", "Ophoven",
+ "Opitter", "Oplinter", "Opoeteren", "Opont", "Opprebais", "Oppuurs", "Opvelp",
+ "Opwijk", "Orbais", "Orchimont", "Orcq", "Ordingen", "Oret", "Oreye", "Orgeo",
+ "Ormeignies", "Orp-Jauche", "Orp-le-Grand", "Orroir", "Orsmaal-Gussenhoven",
+ "Ortho", "Ostiches", "Otegem", "Oteppe", "Othée", "Otrange", "Ottenburg",
+ "Ottergem", "Ottignies", "Ottignies-Louvain-la-Neuve", "Oud-Heverlee",
+ "Oud-Turnhout", "Oudegem", "Oudekapelle", "Oudenaarde", "Oudenaken", "Oudenburg",
+ "Oudergem", "Ouffet", "Ougrée", "Oupeye", "Outer", "Outgaarden", "Outrelouxhe",
+ "Outrijve", "Ouwegem", "Overboelare", "Overhespen", "Overijse", "Overmere",
+ "Overpelt", "Overrepen", "Overwinden", "Paal", "Paifve", "Pailhe", "Paliseul",
+ "Pamel", "Papignies", "Parike", "Passendale", "Patignies", "Paturages",
+ "Paulatem", "Pecq", "Peer", "Peissant", "Pellaines", "Pellenberg", "Pepingen",
+ "Pepinster", "Perk", "Pervijze", "Perwez", "Perwez-Haillot", "Pesche", "Pessoux",
+ "Petegem-aan-de-Leie", "Petegem-aan-de-Schelde", "Petigny", "Petit-Fays",
+ "Petit-Hallet", "Petit-Rechain", "Petit-Roeulx-lez-Braine",
+ "Petit-Roeulx-lez-Nivelles", "Petit-Thier", "Petite-Chapelle", "Peutie",
+ "Philippeville", "Pipaix", "Piringen", "Pironchamps", "Pittem", "Piéton",
+ "Piétrain", "Piétrebais", "Plainevaux", "Plancenoit", "Ploegsteert", "Plombières",
+ "Poederlee", "Poeke", "Poelkapelle", "Poesele", "Pollare", "Polleur",
+ "Pollinkhove", "Pommeroeul", "Pondrôme", "Pont-de-Loup", "Pont-à-Celles",
+ "Pontillas", "Poperinge", "Poppel", "Popuelles", "Porcheresse", "Pottes",
+ "Poucet", "Poulseur", "Poupehan", "Pousset", "Presgaux", "Presles",
+ "Profondeville", "Proven", "Pry", "Pulderbos", "Pulle", "Purnode", "Pussemange",
+ "Putte", "Puurs", "Péronnes-lez-Antoing", "Péronnes-lez-Binche", "Péruwelz",
+ "Quaregnon", "Quartes", "Quenast", "Queue-du-Bois", "Quevaucamps", "Quiévrain",
+ "Quévy", "Quévy-le-Grand", "Quévy-le-Petit", "Rachecourt", "Racour", "Raeren",
+ "Ragnies", "Rahier", "Ramegnies", "Ramegnies-Chin", "Ramelot", "Ramillies-Offus",
+ "Ramsdonk", "Ramsel", "Ramskapelle-Knokke-Heist", "Ramskapelle-Nieuwpoort",
+ "Rance", "Ransart", "Ransberg", "Ranst", "Ravels", "Rebaix", "Rebecq",
+ "Rebecq-Rognon", "Recht", "Recogne", "Redu", "Reet", "Rekem", "Rekkem", "Relegem",
+ "Remagne", "Remersdaal", "Remicourt", "Rendeux", "Reninge", "Reningelst",
+ "Renlies", "Reppel", "Ressaix", "Ressegem", "Resteigne", "Retie", "Retinne",
+ "Reuland", "Rhisnes", "Richelle", "Riemst", "Rienne", "Rijkel", "Rijkevorsel",
+ "Rijkhoven", "Rijmenam", "Riksingen", "Rillaar", "Rivière", "Rixensart", "Rièzes",
+ "Robechies", "Robelmont", "Robertville", "Roborst", "Rochefort", "Rochehaut",
+ "Rocherath", "Roclenge-sur-Geer", "Rocourt", "Roesbrugge-Haringe", "Roeselare",
+ "Rognée", "Roisin", "Roksem", "Rollegem", "Rollegem-Kapelle", "Roloux", "Roly",
+ "Romedenne", "Romershoven", "Romerée", "Romsée", "Rongy", "Ronquières", "Ronse",
+ "Ronsele", "Roosbeek", "Roosdaal", "Roselies", "Rosières", "Rosmeer",
+ "Rosoux-Crenwick", "Rossignol", "Rosée", "Rotem", "Rotheux-Rimière", "Rotselaar",
+ "Roucourt", "Rouveroy", "Rouvreux", "Rouvroy", "Roux", "Roux-Miroir", "Roy",
+ "Rozebeke", "Ruddervoorde", "Ruette", "Ruien", "Ruisbroek", "Ruiselede",
+ "Rukkelingen-Loon", "Rulles", "Rumbeke", "Rumes", "Rumillies", "Rummen",
+ "Rumsdorp", "Rumst", "Runkelen", "Rupelmonde", "Russeignies", "Rutten", "Rèves",
+ "Saint-Amand", "Saint-André", "Saint-Aubin", "Saint-Denis", "Saint-Denis-Bovesse",
+ "Saint-Georges-sur-Meuse", "Saint-Germain", "Saint-Ghislain", "Saint-Gérard",
+ "Saint-Géry", "Saint-Hubert", "Saint-Jean-Geest", "Saint-Léger", "Saint-Marc",
+ "Saint-Mard", "Saint-Martin", "Saint-Maur", "Saint-Médard", "Saint-Nicolas",
+ "Saint-Pierre", "Saint-Remy", "Saint-Remy-Geest", "Saint-Sauveur",
+ "Saint-Servais", "Saint-Symphorien", "Saint-Séverin", "Saint-Vaast",
+ "Saint-Vincent", "Sainte-Cécile", "Sainte-Marie-Chevigny",
+ "Sainte-Marie-sur-Semois", "Sainte-Ode", "Saintes", "Saive", "Salles", "Samart",
+ "Sambreville", "Samrée", "Sankt-Vith", "Sars-la-Bruyère", "Sars-la-Buissière",
+ "Sart-Bernard", "Sart-Custinne", "Sart-Dames-Avelines", "Sart-Eustache",
+ "Sart-Saint-Laurent", "Sart-en-Fagne", "Sart-lez-Spa", "Sautin", "Sautour",
+ "Sauvenière", "Schaarbeek", "Schaffen", "Schalkhoven", "Schaltin", "Schelderode",
+ "Scheldewindeke", "Schelle", "Schellebelle", "Schendelbeke", "Schepdaal",
+ "Scherpenheuvel", "Scherpenheuvel-Zichem", "Schilde", "Schoonaarde", "Schore",
+ "Schorisse", "Schoten", "Schriek", "Schuiferskapelle", "Schulen", "Schönberg",
+ "Sclayn", "Scy", "Seilles", "Seloignes", "Semmerzake", "Seneffe", "Sensenruth",
+ "Seny", "Senzeille", "Septon", "Seraing", "Seraing-le-Château", "Serinchamps",
+ "Serskamp", "Serville", "Sibret", "Signeulx", "Sijsele", "Silenrieux", "Silly",
+ "Sinaai-Waas", "Sinsin", "Sint-Agatha-Berchem", "Sint-Agatha-Rode", "Sint-Amands",
+ "Sint-Amandsberg", "Sint-Andries", "Sint-Antelinks", "Sint-Baafs-Vijve",
+ "Sint-Blasius-Boekel", "Sint-Denijs", "Sint-Denijs-Boekel", "Sint-Denijs-Westrem",
+ "Sint-Eloois-Vijve", "Sint-Eloois-Winkel", "Sint-Genesius-Rode", "Sint-Gillis",
+ "Sint-Gillis-Waas", "Sint-Gillis-bij-Dendermonde", "Sint-Goriks-Oudenhove",
+ "Sint-Huibrechts-Hern", "Sint-Huibrechts-Lille", "Sint-Jacobs-Kapelle",
+ "Sint-Jan", "Sint-Jan-in-Eremo", "Sint-Jans-Molenbeek", "Sint-Job-in-'t-Goor",
+ "Sint-Joost-ten-Node", "Sint-Joris-Beernem", "Sint-Joris-Nieuwpoort",
+ "Sint-Joris-Weert", "Sint-Joris-Winge", "Sint-Katelijne-Waver",
+ "Sint-Katherina-Lombeek", "Sint-Kornelis-Horebeke", "Sint-Kruis",
+ "Sint-Kruis-Winkel", "Sint-Kwintens-Lennik", "Sint-Lambrechts-Herk",
+ "Sint-Lambrechts-Woluwe", "Sint-Laureins", "Sint-Laureins-Berchem",
+ "Sint-Lenaarts", "Sint-Lievens-Esse", "Sint-Lievens-Houtem", "Sint-Margriete",
+ "Sint-Margriete-Houtem", "Sint-Maria-Horebeke", "Sint-Maria-Latem",
+ "Sint-Maria-Lierde", "Sint-Maria-Oudenhove-Brakel",
+ "Sint-Maria-Oudenhove-Zottegem", "Sint-Martens-Bodegem", "Sint-Martens-Latem",
+ "Sint-Martens-Leerne", "Sint-Martens-Lennik", "Sint-Martens-Lierde",
+ "Sint-Martens-Voeren", "Sint-Michiels", "Sint-Niklaas", "Sint-Pauwels",
+ "Sint-Pieters-Kapelle", "Sint-Pieters-Leeuw", "Sint-Pieters-Rode",
+ "Sint-Pieters-Voeren", "Sint-Pieters-Woluwe", "Sint-Rijkers",
+ "Sint-Stevens-Woluwe", "Sint-Truiden", "Sint-Ulriks-Kapelle", "Sippenaeken",
+ "Sirault", "Sivry", "Sivry-Rance", "Sleidinge", "Slijpe", "Slins", "Sluizen",
+ "Smeerebbe-Vloerzegem", "Smetlede", "Smuid", "Snaaskerke", "Snellegem",
+ "Soheit-Tinlot", "Sohier", "Soignies", "Soiron", "Solre-Saint-Géry",
+ "Solre-sur-Sambre", "Sombreffe", "Somme-Leuze", "Sommethonne", "Sommière",
+ "Somzée", "Sorinne-la-Longue", "Sorinnes", "Sorée", "Sosoye", "Sougné-Remouchamps",
+ "Soulme", "Soumagne", "Soumoy", "Sourbrodt", "Souvret", "Sovet", "Soy", "Soye",
+ "Spa", "Spalbeek", "Spermalie", "Spiennes", "Spiere", "Spiere-Helkijn", "Spontin",
+ "Spouwen", "Sprimont", "Spy", "Stabroek", "Staden", "Stalhille", "Stambruges",
+ "Stave", "Stavele", "Stavelot", "Steendorp", "Steenhuffel",
+ "Steenhuize-Wijnhuize", "Steenkerke", "Steenkerque", "Steenokkerzeel", "Stekene",
+ "Stembert", "Stene", "Sterrebeek", "Stevoort", "Stokrooie", "Stoumont",
+ "Straimont", "Strijpen", "Strijtem", "Strombeek-Bever", "Strée", "Strée-lez-Huy",
+ "Strépy-Bracquegnies", "Stuivekenskerke", "Suarlée", "Sugny", "Surice", "Suxy",
+ "Sélange", "Tailles", "Taintignies", "Tamines", "Tarcienne", "Tavier", "Taviers",
+ "Tavigny", "Tellin", "Templeuve", "Temploux", "Temse", "Tenneville", "Teralfene",
+ "Terhagen", "Termes", "Ternat", "Tertre", "Tervuren", "Terwagne", "Tessenderlo",
+ "Testelt", "Teuven", "Theux", "Thiaumont", "Thieu", "Thieulain", "Thieusies",
+ "Thimister", "Thimister-Clermont", "Thimougies", "Thiméon", "Thines", "Thirimont",
+ "Thisnes", "Thommen", "Thon", "Thorembais-Saint-Trond", "Thorembais-les-Béguines",
+ "Thoricourt", "Thuillies", "Thuin", "Thulin", "Thumaide", "Thy-le-Bauduin",
+ "Thy-le-Château", "Thynes", "Thys", "Tiegem", "Tielen", "Tielrode", "Tielt",
+ "Tielt-Winge", "Tienen", "Tignée", "Tihange", "Tildonk", "Tilff", "Tillet",
+ "Tilleur", "Tillier", "Tilly", "Tinlot", "Tintange", "Tintigny", "Tisselt",
+ "Toernich", "Tohogne", "Tollembeek", "Tongeren", "Tongerlo", "Tongre-Notre-Dame",
+ "Tongre-Saint-Martin", "Tongrinne", "Tontelange", "Torgny", "Torhout", "Tourinne",
+ "Tourinnes-Saint-Lambert", "Tournai", "Tournay", "Tourpes", "Transinne",
+ "Trazegnies", "Treignes", "Trembleur", "Tremelo", "Trivières", "Trognée",
+ "Trois-Ponts", "Trooz", "Tubize", "Turnhout", "Ucimont", "Uikhoven", "Uitbergen",
+ "Uitkerke", "Ukkel", "Ulbeek", "Upigny", "Ursel", "Vaalbeek", "Val-Meer", "Vance",
+ "Varendonk", "Varsenare", "Vaucelles", "Vaulx", "Vaulx-lez-Chimay",
+ "Vaux-Chavanne", "Vaux-et-Borset", "Vaux-lez-Rosières", "Vaux-sous-Chèvremont",
+ "Vaux-sur-Sûre", "Vechmaal", "Vedrin", "Veerle", "Velaine-sur-Sambre", "Velaines",
+ "Veldegem", "Veldwezelt", "Vellereille-le-Sec", "Vellereille-les-Brayeux", "Velm",
+ "Velroux", "Veltem-Beisem", "Velzeke-Ruddershove", "Vencimont", "Vergnies",
+ "Verlaine", "Verlée", "Verrebroek", "Vertrijk", "Verviers", "Vesqueville",
+ "Veulen", "Veurne", "Vezin", "Vezon", "Viane", "Vichte", "Vielsalm", "Viemme",
+ "Viersel", "Vierset-Barse", "Vierves-sur-Viroin", "Viesville", "Vieux-Genappe",
+ "Vieux-Waleffe", "Vieuxville", "Villance", "Ville-Pommeroeul", "Ville-en-Hesbaye",
+ "Ville-sur-Haine", "Villerot", "Villers-Deux-Eglises", "Villers-Notre-Dame",
+ "Villers-Perwin", "Villers-Poterie", "Villers-Saint-Amand",
+ "Villers-Saint-Ghislain", "Villers-Saint-Siméon", "Villers-Sainte-Gertrude",
+ "Villers-aux-Tours", "Villers-devant-Orval", "Villers-en-Fagne",
+ "Villers-l'Evêque", "Villers-la-Bonne-Eau", "Villers-la-Loue", "Villers-la-Tour",
+ "Villers-la-Ville", "Villers-le-Bouillet", "Villers-le-Gambon",
+ "Villers-le-Peuplier", "Villers-le-Temple", "Villers-lez-Heest",
+ "Villers-sur-Lesse", "Villers-sur-Semois", "Vilvoorde", "Vinalmont",
+ "Vinderhoute", "Vinkem", "Vinkt", "Virelles", "Virginal-Samme", "Viroinval",
+ "Virton", "Vissenaken", "Visé", "Vitrival", "Vivegnis", "Vivy", "Vladslo",
+ "Vlamertinge", "Vlekkem", "Vleteren", "Vlezenbeek", "Vliermaal", "Vliermaalroot",
+ "Vlierzele", "Vlijtingen", "Vlimmeren", "Vlissegem", "Vloesberg", "Vodecée",
+ "Vodelée", "Voeren", "Vogenée", "Volkegem", "Vollezele", "Vonêche", "Voorde",
+ "Voormezele", "Voort", "Voroux-Goreux", "Voroux-lez-Liers", "Vorselaar", "Vorsen",
+ "Vorst", "Vosselaar", "Vosselare", "Vossem", "Vottem", "Vrasene", "Vremde",
+ "Vreren", "Vresse-sur-Semois", "Vroenhoven", "Vucht", "Vurste", "Vyle-et-Tharoul",
+ "Waanrode", "Waarbeke", "Waardamme", "Waarloos", "Waarmaarde", "Waarschoot",
+ "Waasmont", "Waasmunster", "Waasten", "Wachtebeke", "Wadelincourt", "Wagnelée",
+ "Waha", "Waillet", "Wakken", "Walcourt", "Walem", "Walhain", "Walhain-Saint-Paul",
+ "Walhorn", "Walsbets", "Walshoutem", "Waltwilder", "Wambeek", "Wancennes",
+ "Wandre", "Wanfercée-Baulet", "Wange", "Wangenies", "Wanlin", "Wanne",
+ "Wannebecq", "Wannegem-Lede", "Wansin", "Wanze", "Wanzele", "Warchin", "Warcoing",
+ "Wardin", "Waregem", "Waremme", "Waret-l'Evêque", "Waret-la-Chaussée",
+ "Warisoulx", "Warnant", "Warnant-Dreye", "Warquignies", "Warsage", "Warzée",
+ "Wasmes", "Wasmes-Audemez-Briffoeil", "Wasmuel", "Wasseiges", "Waterland-Oudeman",
+ "Waterloo", "Watermaal-Bosvoorde", "Watervliet", "Watou", "Wattripont", "Waudrez",
+ "Waulsort", "Wauthier-Braine", "Waver", "Wavreille", "Wayaux", "Ways", "Webbekom",
+ "Wechelderzande", "Weelde", "Weerde", "Weert", "Wegnez", "Weillen", "Weismes",
+ "Welden", "Welkenraedt", "Welle", "Wellen", "Wellin", "Wemmel", "Wenduine",
+ "Werbomont", "Werchter", "Werken", "Werm", "Wervik", "Wespelaar", "Westende",
+ "Westerlo", "Westkapelle", "Westkerke", "Westmalle", "Westmeerbeek", "Westouter",
+ "Westrem", "Westrozebeke", "Westvleteren", "Wetteren", "Wevelgem", "Wez-Velvain",
+ "Wezemaal", "Wezembeek-Oppem", "Wezeren", "Wibrin", "Wichelen", "Widooie",
+ "Wiekevorst", "Wielsbeke", "Wierde", "Wiers", "Wiesme", "Wieze", "Wihogne",
+ "Wihéries", "Wijchmaal", "Wijer", "Wijgmaal", "Wijnegem", "Wijshagen",
+ "Wijtschate", "Wilderen", "Willaupuis", "Willebringen", "Willebroek", "Willemeau",
+ "Willerzie", "Wilrijk", "Wilsele", "Wilskerke", "Wimmertingen", "Winenne",
+ "Wingene", "Winksele", "Wintershoven", "Witry", "Wodecq", "Woesten", "Wolkrange",
+ "Wolvertem", "Wommelgem", "Wommersom", "Wonck", "Wondelgem", "Wontergem",
+ "Wortegem", "Wortegem-Petegem", "Wortel", "Woubrechtegem", "Woumen", "Wulpen",
+ "Wulvergem", "Wulveringem", "Wuustwezel", "Wépion", "Wéris", "Xhendelesse",
+ "Xhendremael", "Xhoris", "Yernée-Fraineux", "Yves-Gomezée", "Yvoir", "Zaffelare",
+ "Zandbergen", "Zande", "Zandhoven", "Zandvliet", "Zandvoorde-Oostende",
+ "Zandvoorde-Zonnebeke", "Zarlardinge", "Zarren", "Zaventem", "Zedelgem",
+ "Zeebrugge", "Zegelsem", "Zele", "Zelem", "Zellik", "Zelzate", "Zemst",
+ "Zepperen", "Zerkegem", "Zevekote", "Zeveneken", "Zeveren", "Zevergem", "Zichem",
+ "Zichen-Zussen-Bolder", "Zillebeke", "Zingem", "Zoerle-Parwijs", "Zoersel",
+ "Zolder", "Zomergem", "Zonhoven", "Zonnebeke", "Zonnegem", "Zottegem",
+ "Zoutenaaie", "Zoutleeuw", "Zuidschote", "Zuienkerke", "Zulte", "Zulzeke",
+ "Zutendaal", "Zwalm", "Zwevegem", "Zwevezele", "Zwijnaarde", "Zwijndrecht",
+ "Zétrud-Lumay", "l'Escaillère",
)
provinces = (
- "Antwerpen", "Henegouwen", "Limburg", "Luik", "Luxemburg", "Namen",
- "Oost-Vlaanderen", "Vlaams-Brabant", "Waals-Brabant", "West-Vlaanderen"
+ "Antwerpen", "Henegouwen", "Limburg", "Luik", "Luxemburg", "Namen",
+ "Oost-Vlaanderen", "Vlaams-Brabant", "Waals-Brabant", "West-Vlaanderen",
)
street_name_formats = (
@@ -789,7 +569,8 @@ class Provider(AddressProvider):
)
address_formats = (
- "{{street_address}}\n{{postcode}}\n{{city}}","{{street_address}}\n{{postcode}} {{city}}",
+ "{{street_address}}\n{{postcode}}\n{{city}}",
+ "{{street_address}}\n{{postcode}} {{city}}",
)
def province(self):
diff --git a/src/libs/faker/providers/address/nl_NL/__init__.py b/src/libs/faker/providers/address/nl_NL/__init__.py
index ece01df..d3d820b 100644
--- a/src/libs/faker/providers/address/nl_NL/__init__.py
+++ b/src/libs/faker/providers/address/nl_NL/__init__.py
@@ -5,7 +5,7 @@
class Provider(AddressProvider):
- building_number_formats = ('#', '##', '###', '#', '##', '###',)
+ building_number_formats = ('#', '##', '###', '#', '##', '###')
street_suffixes = (
'baan', 'boulevard', 'dreef', 'hof', 'laan', 'pad',
@@ -14,7 +14,7 @@ class Provider(AddressProvider):
# the 4 digit numerical part of Dutch postcodes is between 1000 and 9999;
# see http://nl.wikipedia.org/wiki/Postcode#Postcodes_in_Nederland
- postcode_formats = ('%###??', '%### ??',)
+ postcode_formats = ('%###??', '%### ??')
city_formats = ('{{city}}',)
diff --git a/src/libs/faker/providers/address/no_NO/__init__.py b/src/libs/faker/providers/address/no_NO/__init__.py
index 2259624..046fd28 100644
--- a/src/libs/faker/providers/address/no_NO/__init__.py
+++ b/src/libs/faker/providers/address/no_NO/__init__.py
@@ -25,7 +25,7 @@ class Provider(AddressProvider):
]
street_address_formats = ('{{street_name}} {{building_number}}',)
address_formats = ('{{street_address}}, {{postcode}} {{city}}',)
- building_number_formats = ('%', '%', '%', '%?', '##', '##', '##?', '###',)
+ building_number_formats = ('%', '%', '%', '%?', '##', '##', '##?', '###')
building_number_suffixes = {
'A': 0.2, 'B': 0.2, 'C': 0.2, 'D': 0.1, 'E': 0.1, 'F': 0.1, 'G': 0.05,
'H': 0.05}
@@ -33,7 +33,10 @@ class Provider(AddressProvider):
def building_number(self):
suffix = self.random_element(self.building_number_suffixes)
- return self.numerify(self.random_element(self.building_number_formats)).replace('?', suffix)
+ return self.numerify(
+ self.random_element(
+ self.building_number_formats)).replace(
+ '?', suffix)
def city_suffix(self):
return self.random_element(self.city_suffixes)
diff --git a/src/libs/faker/providers/address/pl_PL/__init__.py b/src/libs/faker/providers/address/pl_PL/__init__.py
index a1d0e73..a63c3cb 100644
--- a/src/libs/faker/providers/address/pl_PL/__init__.py
+++ b/src/libs/faker/providers/address/pl_PL/__init__.py
@@ -46,7 +46,7 @@ class Provider(AddressProvider):
'Kluczbork', 'Lubliniec', 'Skawina', 'Jawor', 'Kościan', 'Wieluń',
'Kościerzyna', 'Nowa Ruda', 'Świebodzice', 'Koło', 'Piastów',
'Goleniów', 'Ostrów Mazowiecka', 'Polkowice', 'Lubartów', 'Zambrów',
- 'Płońsk', 'Reda', 'Łaziska Górne', 'Środa Wielkopolska'
+ 'Płońsk', 'Reda', 'Łaziska Górne', 'Środa Wielkopolska',
)
street_prefixes = (
@@ -134,7 +134,7 @@ class Provider(AddressProvider):
'Makuszyńskiego', 'Sybiraków', 'Kowalska', 'Morcinka', 'Odrzańska',
'Okulickiego', 'Solidarnosci', 'Zapolskiej', 'Łabędzia', 'Wojciecha',
'Bałtycka', 'Lwowska', 'Rajska', 'Korfantego', 'Pszenna', 'Ciasna',
- 'Floriana', 'Hutnicza', 'Kielecka'
+ 'Floriana', 'Hutnicza', 'Kielecka',
)
regions = (
@@ -144,7 +144,7 @@ class Provider(AddressProvider):
"Warmińsko - mazurskie", "Wielkopolskie", "Zachodniopomorskie",
)
- building_number_formats = ('##', '###', "##/##",)
+ building_number_formats = ('##', '###', "##/##")
postcode_formats = ('##-###',)
street_address_formats = (
'{{street_prefix}} {{street_name}} {{building_number}}',
@@ -166,7 +166,7 @@ def street_prefix_short(self):
Randomly returns an abbreviation of the street prefix.
:example 'al.'
"""
- return self.random_element(self.street_prefixes)[:2]+'.'
+ return self.random_element(self.street_prefixes)[:2] + '.'
def street_name(self):
"""
diff --git a/src/libs/faker/providers/address/pt_BR/__init__.py b/src/libs/faker/providers/address/pt_BR/__init__.py
index 3c50ba2..88bc1ae 100644
--- a/src/libs/faker/providers/address/pt_BR/__init__.py
+++ b/src/libs/faker/providers/address/pt_BR/__init__.py
@@ -5,15 +5,70 @@
class Provider(AddressProvider):
city_suffixes = (
- 'do Sul', 'do Norte', 'de Minas', 'do Campo', 'Grande', 'da Serra', 'do Oeste', 'de Goiás', 'Paulista',
- 'da Mata', 'Alegre', 'da Praia', 'das Flores', 'das Pedras', 'dos Dourados',
- 'do Amparo', 'do Galho', 'da Prata', 'Verde'
- )
- street_prefixes = ('Aeroporto', 'Alameda', 'Área', 'Avenida', 'Campo', 'Chácara', 'Colônia', 'Condomínio',
- 'Conjunto', 'Distrito', 'Esplanada', 'Estação', 'Estrada', 'Favela', 'Fazenda', 'Feira',
- 'Jardim', 'Ladeira', 'Lago', 'Lagoa', 'Largo', 'Loteamento', 'Morro', 'Núcleo', 'Parque',
- 'Passarela', 'Pátio', 'Praça', 'Quadra', 'Recanto', 'Residencial', 'Rodovia', 'Rua', 'Setor',
- 'Sítio', 'Travessa', 'Trecho', 'Trevo', 'Vale', 'Vereda', 'Via', 'Viaduto', 'Viela', 'Vila')
+ 'do Sul',
+ 'do Norte',
+ 'de Minas',
+ 'do Campo',
+ 'Grande',
+ 'da Serra',
+ 'do Oeste',
+ 'de Goiás',
+ 'Paulista',
+ 'da Mata',
+ 'Alegre',
+ 'da Praia',
+ 'das Flores',
+ 'das Pedras',
+ 'dos Dourados',
+ 'do Amparo',
+ 'do Galho',
+ 'da Prata',
+ 'Verde')
+ street_prefixes = (
+ 'Aeroporto',
+ 'Alameda',
+ 'Área',
+ 'Avenida',
+ 'Campo',
+ 'Chácara',
+ 'Colônia',
+ 'Condomínio',
+ 'Conjunto',
+ 'Distrito',
+ 'Esplanada',
+ 'Estação',
+ 'Estrada',
+ 'Favela',
+ 'Fazenda',
+ 'Feira',
+ 'Jardim',
+ 'Ladeira',
+ 'Lago',
+ 'Lagoa',
+ 'Largo',
+ 'Loteamento',
+ 'Morro',
+ 'Núcleo',
+ 'Parque',
+ 'Passarela',
+ 'Pátio',
+ 'Praça',
+ 'Quadra',
+ 'Recanto',
+ 'Residencial',
+ 'Rodovia',
+ 'Rua',
+ 'Setor',
+ 'Sítio',
+ 'Travessa',
+ 'Trecho',
+ 'Trevo',
+ 'Vale',
+ 'Vereda',
+ 'Via',
+ 'Viaduto',
+ 'Viela',
+ 'Vila')
city_formats = (
'{{last_name}}',
'{{last_name}}',
@@ -41,8 +96,7 @@ class Provider(AddressProvider):
)
address_formats = (
- "{{street_address}}\n{{bairro}}\n{{postcode}} {{city}} / {{estado_sigla}}",
- )
+ "{{street_address}}\n{{bairro}}\n{{postcode}} {{city}} / {{estado_sigla}}", )
building_number_formats = ('%', '%#', '%#', '%#', '%##')
@@ -145,7 +199,7 @@ class Provider(AddressProvider):
'Horto',
'Cidade Jardim', 'Castelo', 'Cidade Nova', 'Savassi', 'Serra', 'Silveira', 'Sion', 'Centro',
'Alto Barroca', 'Nova Vista', 'Coração De Jesus', 'Coração Eucarístico', 'Funcionários', 'Cruzeiro',
- 'João Pinheiro', 'Nova Granada', 'Nova Suíça', 'Itaipu'
+ 'João Pinheiro', 'Nova Granada', 'Nova Suíça', 'Itaipu',
)
countries = (
'Afeganistão', 'África do Sul', 'Akrotiri', 'Albânia', 'Alemanha', 'Andorra', 'Angola', 'Anguila',
@@ -191,14 +245,19 @@ class Provider(AddressProvider):
)
estados = (
- ('AC', 'Acre'), ('AL', 'Alagoas'), ('AP', 'Amapá'), ('AM', 'Amazonas'), ('BA', 'Bahia'),
- ('CE', 'Ceará'), ('DF', 'Distrito Federal'), ('ES', 'Espírito Santo'), ('GO', 'Goiás'), ('MA', 'Maranhão'),
- ('MT', 'Mato Grosso'), ('MS', 'Mato Grosso do Sul'), ('MG', 'Minas Gerais'), ('PA', 'Pará'), ('PB', 'Paraíba'),
- ('PR', 'Paraná'), ('PE', 'Pernambuco'), ('PI', 'Piauí'), ('RJ', 'Rio de Janeiro'),
+ ('AC', 'Acre'), ('AL', 'Alagoas'), ('AP',
+ 'Amapá'), ('AM', 'Amazonas'), ('BA', 'Bahia'),
+ ('CE', 'Ceará'), ('DF', 'Distrito Federal'), ('ES',
+ 'Espírito Santo'), ('GO', 'Goiás'), ('MA', 'Maranhão'),
+ ('MT', 'Mato Grosso'), ('MS', 'Mato Grosso do Sul'), ('MG',
+ 'Minas Gerais'), ('PA', 'Pará'), ('PB', 'Paraíba'),
+ ('PR', 'Paraná'), ('PE', 'Pernambuco'), ('PI',
+ 'Piauí'), ('RJ', 'Rio de Janeiro'),
('RN', 'Rio Grande do Norte'),
- ('RS', 'Rio Grande do Sul'), ('RO', 'Rondônia'), ('RR', 'Roraima'), ('SC', 'Santa Catarina'),
+ ('RS', 'Rio Grande do Sul'), ('RO', 'Rondônia'), ('RR',
+ 'Roraima'), ('SC', 'Santa Catarina'),
('SP', 'São Paulo'),
- ('SE', 'Sergipe'), ('TO', 'Tocantins')
+ ('SE', 'Sergipe'), ('TO', 'Tocantins'),
)
def street_prefix(self):
@@ -231,7 +290,8 @@ def estado_sigla(self):
def bairro(self):
"""
- Randomly returns a bairro (neighborhood) name. The names were taken from the city of Belo Horizonte - Minas Gerais
+ Randomly returns a bairro (neighborhood) name.
+ The names were taken from the city of Belo Horizonte - Minas Gerais
:example 'Serra'
"""
diff --git a/src/libs/faker/providers/address/pt_PT/__init__.py b/src/libs/faker/providers/address/pt_PT/__init__.py
index 19a8482..1b5e381 100644
--- a/src/libs/faker/providers/address/pt_PT/__init__.py
+++ b/src/libs/faker/providers/address/pt_PT/__init__.py
@@ -117,6 +117,87 @@ class Provider(AddressProvider):
'Wake Island', 'Wallis e Futuna', 'West Bank', 'Zâmbia', 'Zimbabué',
)
+ # From https://pt.wikipedia.org/wiki/Distritos_de_Portugal
+ distritos = (
+ 'Aveiro', 'Beja', 'Braga', 'Bragança', 'Castelo Branco', 'Coimbra',
+ 'Évora', 'Faro', 'Guarda', 'Leiria', 'Lisboa', 'Portalegre', 'Porto',
+ 'Santarém', 'Setúbal', 'Viana do Castelo', 'Vila Real', 'Viseu',
+ )
+
+ # From https://pt.wikipedia.org/wiki/Lista_de_freguesias_de_Portugal
+ freguesias = [
+ "Abrantes", "Águeda", "Aguiar da Beira", "Alandroal",
+ "Albergaria-a-Velha", "Albufeira", "Alcácer do Sal", "Alcanena",
+ "Alcobaça", "Alcochete", "Alcoutim", "Alenquer", "Alfândega da Fé",
+ "Alijó", "Aljezur", "Aljustrel", "Almada", "Almeida", "Almeirim",
+ "Almodôvar", "Alpiarça", "Alter do Chão", "Alvaiázere", "Alvito",
+ "Amadora", "Amarante", "Amares", "Anadia", "Angra do Heroísmo",
+ "Ansião", "Arcos de Valdevez", "Arganil", "Armamar", "Arouca",
+ "Arraiolos", "Arronches", "Arruda dos Vinhos", "Aveiro", "Avis",
+ "Azambuja", "Baião", "Barcelos", "Barrancos", "Barreiro", "Batalha",
+ "Beja", "Belmonte", "Benavente", "Bombarral", "Borba", "Boticas",
+ "Braga", "Bragança", "Cabeceiras de Basto", "Cadaval",
+ "Caldas da Rainha", "Calheta (Açores)", "Calheta (Madeira)",
+ "Câmara de Lobos", "Caminha", "Campo Maior", "Cantanhede",
+ "Carrazeda de Ansiães", "Carregal do Sal", "Cartaxo", "Cascais",
+ "Castanheira de Pêra", "Castelo Branco", "Castelo de Paiva",
+ "Castelo de Vide", "Castro Daire", "Castro Marim", "Castro Verde",
+ "Celorico da Beira", "Celorico de Basto", "Chamusca", "Chaves",
+ "Cinfães", "Coimbra", "Condeixa-a-Nova", "Constância", "Coruche",
+ "Corvo", "Covilhã", "Crato", "Cuba", "Elvas", "Entroncamento",
+ "Espinho", "Esposende", "Estarreja", "Estremoz", "Évora", "Fafe",
+ "Faro", "Felgueiras", "Ferreira do Alentejo", "Ferreira do Zêzere",
+ "Figueira da Foz", "Figueira de Castelo Rodrigo",
+ "Figueiró dos Vinhos", "Fornos de Algodres",
+ "Freixo de Espada à Cinta", "Fronteira", "Funchal", "Fundão", "Gavião",
+ "Góis", "Golegã", "Gondomar", "Gouveia", "Grândola", "Guarda",
+ "Guimarães", "Horta", "Idanha-a-Nova", "Ílhavo", "Lagoa",
+ "Lagoa (Açores)", "Lagos", "Lajes das Flores", "Lajes do Pico",
+ "Lamego", "Leiria", "Lisboa", "Loulé", "Loures", "Lourinhã", "Lousã",
+ "Lousada", "Mação", "Macedo de Cavaleiros", "Machico", "Madalena",
+ "Mafra", "Maia", "Mangualde", "Manteigas", "Marco de Canaveses",
+ "Marinha Grande", "Marvão", "Matosinhos", "Mealhada", "Mêda",
+ "Melgaço", "Mértola", "Mesão Frio", "Mira", "Miranda do Corvo",
+ "Miranda do Douro", "Mirandela", "Mogadouro", "Moimenta da Beira",
+ "Moita", "Monção", "Monchique", "Mondim de Basto", "Monforte",
+ "Montalegre", "Montemor-o-Novo", "Montemor-o-Velho", "Montijo",
+ "Mora", "Mortágua", "Moura", "Mourão", "Murça", "Murtosa", "Nazaré",
+ "Nelas", "Nisa", "Nordeste", "Óbidos", "Odemira", "Odivelas",
+ "Oeiras", "Oleiros", "Olhão", "Oliveira de Azeméis",
+ "Oliveira de Frades", "Oliveira do Bairro", "Oliveira do Hospital",
+ "Ourém", "Ourique", "Ovar", "Paços de Ferreira", "Palmela",
+ "Pampilhosa da Serra", "Paredes", "Paredes de Coura", "Pedrógão Grande",
+ "Penacova", "Penafiel", "Penalva do Castelo", "Penamacor", "Penedono",
+ "Penela", "Peniche", "Peso da Régua", "Pinhel", "Pombal",
+ "Ponta Delgada", "Ponta do Sol", "Ponte da Barca", "Ponte de Lima",
+ "Ponte de Sor", "Portalegre", "Portel", "Portimão", "Porto",
+ "Porto de Mós", "Porto Moniz", "Porto Santo", "Póvoa de Lanhoso",
+ "Póvoa de Varzim", "Povoação", "Praia da Vitória", "Proença-a-Nova",
+ "Redondo", "Reguengos de Monsaraz", "Resende", "Ribeira Brava",
+ "Ribeira de Pena", "Ribeira Grande", "Rio Maior", "Sabrosa", "Sabugal",
+ "Salvaterra de Magos", "Santa Comba Dão", "Santa Cruz",
+ "Santa Cruz da Graciosa", "Santa Cruz das Flores",
+ "Santa Maria da Feira", "Santa Marta de Penaguião", "Santana",
+ "Santarém", "Santiago do Cacém", "Santo Tirso", "São Brás de Alportel",
+ "São João da Madeira", "São João da Pesqueira", "São Pedro do Sul",
+ "São Roque do Pico", "São Vicente (Madeira)", "Sardoal", "Sátão",
+ "Seia", "Seixal", "Sernancelhe", "Serpa", "Sertã", "Sesimbra",
+ "Setúbal", "Sever do Vouga", "Silves", "Sines", "Sintra",
+ "Sobral de Monte Agraço", "Soure", "Sousel", "Tábua", "Tabuaço",
+ "Tarouca", "Tavira", "Terras de Bouro", "Tomar", "Tondela",
+ "Torre de Moncorvo", "Torres Novas", "Torres Vedras", "Trancoso",
+ "Trofa", "Vagos", "Vale de Cambra", "Valença", "Valongo", "Valpaços",
+ "Velas", "Vendas Novas", "Viana do Alentejo", "Viana do Castelo",
+ "Vidigueira", "Vieira do Minho", "Vila de Rei", "Vila do Bispo",
+ "Vila do Conde", "Vila do Porto", "Vila Flor", "Vila Franca de Xira",
+ "Vila Franca do Campo", "Vila Nova da Barquinha",
+ "Vila Nova de Cerveira", "Vila Nova de Famalicão",
+ "Vila Nova de Foz Côa", "Vila Nova de Gaia", "Vila Nova de Paiva",
+ "Vila Nova de Poiares", "Vila Pouca de Aguiar", "Vila Real",
+ "Vila Real de Santo António", "Vila Velha de Ródão", "Vila Verde",
+ "Vila Viçosa", "Vimioso", "Vinhais", "Viseu", "Vizela", "Vouzela",
+ ]
+
def street_prefix(self):
"""
:example 'Rua'
@@ -125,6 +206,18 @@ def street_prefix(self):
def city_name(self):
"""
- :example Amora
+ :example 'Amora'
"""
return self.random_element(self.cities)
+
+ def distrito(self):
+ """
+ :example 'Bragança'
+ """
+ return self.random_element(self.distritos)
+
+ def freguesia(self):
+ """
+ :example 'Miranda do Douro'
+ """
+ return self.random_element(self.freguesias)
diff --git a/src/libs/faker/providers/address/ru_RU/__init__.py b/src/libs/faker/providers/address/ru_RU/__init__.py
index 884364f..0ebe1c4 100644
--- a/src/libs/faker/providers/address/ru_RU/__init__.py
+++ b/src/libs/faker/providers/address/ru_RU/__init__.py
@@ -3,18 +3,17 @@
from .. import Provider as AddressProvider
+
class Provider(AddressProvider):
- #city_suffixes = []
- street_suffixes = [ 'ул.', ]
+ street_suffixes = ['ул.']
city_formats = ('{{city_prefix}} {{city_name}}', )
street_name_formats = ('{{street_suffix}} {{street_title}}', )
street_address_formats = ('{{street_name}}, д. {{building_number}}', )
address_formats = ('{{city}}, {{street_address}}, {{postcode}}', )
- #building_number_formats = ('##', )
postcode_formats = ('######', )
city_prefixes = (
- 'г.', 'п.', 'к.', 'с.', 'д.', 'клх', 'ст.'
+ 'г.', 'п.', 'к.', 'с.', 'д.', 'клх', 'ст.',
)
street_titles = (
@@ -123,7 +122,7 @@ class Provider(AddressProvider):
'Культуры', 'Мая 1', 'Минина', 'Машиностроителей', 'Детская', 'ДОС',
'Тюленина', 'Запорожская', 'Дальневосточная', 'Громова', 'О.Кошевого',
'Балтийская', 'Р.Люксембург', 'Февральская', 'Толбухина', 'Лунная',
- 'Дарвина', 'З.Космодемьянской', 'Высотная', 'Рязанская', 'Малиновая'
+ 'Дарвина', 'З.Космодемьянской', 'Высотная', 'Рязанская', 'Малиновая',
)
city_names = (
@@ -251,7 +250,7 @@ class Provider(AddressProvider):
'Энгельс', 'Югорск', 'Южно-Курильск', 'Южно-Сахалинск', 'Южноуральск',
'Юровск', 'Юрьев-Польский', 'Юрьевец (Иван.)', 'Юрюзань', 'Якутск',
'Якша', 'Ялуторовск', 'Ямбург', 'Яр-Сале', 'Ярославль',
- 'Ясный (Оренб.)', 'Яхрома', 'Яшалта', 'Яшкуль'
+ 'Ясный (Оренб.)', 'Яхрома', 'Яшалта', 'Яшкуль',
)
def city_prefix(self):
diff --git a/src/libs/faker/providers/address/sk_SK/__init__.py b/src/libs/faker/providers/address/sk_SK/__init__.py
index 830799e..fce27fe 100644
--- a/src/libs/faker/providers/address/sk_SK/__init__.py
+++ b/src/libs/faker/providers/address/sk_SK/__init__.py
@@ -580,7 +580,8 @@ class Provider(AddressProvider):
'Žbince', 'Ždaňa', 'Ždiar', 'Žehňa', 'Žehra', 'Železník', 'Želiezovce',
'Želmanovce', 'Žemberovce', 'Žemliare', 'Žiar', 'Žiar',
'Žiar nad Hronom', 'Žihárec', 'Žikava', 'Žilina', 'Žipov', 'Žirany',
- 'Žitavany', 'Žitavce', 'Žitná - Radiša', 'Žlkovce', 'Župčany', )
+ 'Žitavany', 'Žitavce', 'Žitná - Radiša', 'Žlkovce', 'Župčany',
+ )
streets = (
'Adámiho', 'Agátová', 'Ahoj', 'Albánska', 'Albrechtova', 'Alejová',
@@ -985,12 +986,14 @@ class Provider(AddressProvider):
'Železničná', 'Želiarska', 'Žellova', 'Žiacka', 'Žiarska', 'Židovská',
'Žihľavová', 'Žilinská', 'Žilinská', 'Žitavská', 'Žitná', 'Živnostenská',
'Žižkova', 'Žulová', 'Župné námestie', 'Borágova', 'Parenicová',
- 'Loparová', 'Jegnešská', 'Jonatanová', 'Monardová', 'Perličková', )
+ 'Loparová', 'Jegnešská', 'Jonatanová', 'Monardová', 'Perličková',
+ )
states = (
'Bratislavský kraj', 'Trnavský kraj', 'Trenčiansky kraj',
'Nitriansky kraj', 'Žilinský kraj', 'Banskobystrický kraj',
- 'Prešovský kraj', 'Košický kraj', )
+ 'Prešovský kraj', 'Košický kraj',
+ )
countries = (
'Afganistan', 'Afghanistanská islamská republika', 'Ålandy',
@@ -1139,7 +1142,8 @@ class Provider(AddressProvider):
'Republika Horná Volta', 'Vatikánsky mestský štát (Svätá stolica)',
'Vietnamská demokratická republika', 'Wake',
'Jemenská ľudovodemokratická republika', 'Jemenská arabská republika',
- 'Socialistická federatívna republika Juhoslávia', 'Zairská republika', )
+ 'Socialistická federatívna republika Juhoslávia', 'Zairská republika',
+ )
def street_suffix_short(self):
return self.random_element(self.street_suffixes_short)
diff --git a/src/libs/faker/providers/address/sv_SE/__init__.py b/src/libs/faker/providers/address/sv_SE/__init__.py
index 790d937..75bc463 100644
--- a/src/libs/faker/providers/address/sv_SE/__init__.py
+++ b/src/libs/faker/providers/address/sv_SE/__init__.py
@@ -16,7 +16,7 @@ class Provider(AddressProvider):
'Björk', 'Järnvägs', 'Ring', 'Skol', 'Skogs', 'Ny', 'Gran', 'Idrotts',
'Stor', 'Kyrk', 'Industri', 'Park', 'Strand', 'Skol', 'Trädgårds',
'Industri', 'Ängs', 'Kyrko', 'Park', 'Villa', 'Ek', 'Kvarn', 'Stations',
- 'Back', 'Furu', 'Gen', 'Fabriks', 'Åker', 'Bäck', 'Asp'
+ 'Back', 'Furu', 'Gen', 'Fabriks', 'Åker', 'Bäck', 'Asp',
)
street_suffixes = ('gatan', 'gatan', 'vägen', 'vägen',
@@ -36,7 +36,7 @@ class Provider(AddressProvider):
'Borlänge', 'Falun', 'Kalmar', 'Skövde', 'Kristianstad', 'Karlskrona',
'Skellefteå', 'Uddevalla', 'Lidingö', 'Motala', 'Landskrona',
'Örnsköldsvik', 'Nyköping', 'Karlskoga', 'Varberg', 'Trelleborg',
- 'Lidköping', 'Alingsås', 'Piteå', 'Sandviken', 'Ängelholm'
+ 'Lidköping', 'Alingsås', 'Piteå', 'Sandviken', 'Ängelholm',
)
countries = (
@@ -87,17 +87,17 @@ class Provider(AddressProvider):
'Tuvalu', 'Tyskland', 'Uganda', 'Ukraina', 'Ungern', 'Uruguay', 'USA',
'Uzbekistan', 'Vanuatu', 'Vatikanstaten', 'Venezuela', 'Vietnam',
'Vitryssland', 'Wake', 'Wallis-och Futunaöarna', 'Zambia', 'Zimbabwe',
- 'Österrike', 'Östtimor'
+ 'Österrike', 'Östtimor',
)
states = (
- 'Stockholms län', 'Uppsala län', 'Södermanlands län'
+ 'Stockholms län', 'Uppsala län', 'Södermanlands län',
'Östergötlands län', 'Jönköpings län', 'Kronobergs län', 'Kalmar län',
'Gotlands län', 'Blekinge län', 'Skåne län', 'Hallands län',
'Västra Götalands län', 'Värmlands län', 'Örebro län',
'Västmanlands län', 'Dalarnas län', 'Gävleborgs län',
'Västernorrlands län', 'Jämtlands län', 'Västerbottens län',
- 'Norrbottens län'
+ 'Norrbottens län',
)
def street_prefix(self):
diff --git a/src/libs/faker/providers/address/uk_UA/__init__.py b/src/libs/faker/providers/address/uk_UA/__init__.py
index 6cc02ee..59a33e9 100644
--- a/src/libs/faker/providers/address/uk_UA/__init__.py
+++ b/src/libs/faker/providers/address/uk_UA/__init__.py
@@ -9,8 +9,7 @@ class Provider(AddressProvider):
building_number_formats = ['#', '##', '###']
city_formats = ['{{city_prefix}} {{first_name}}']
street_address_formats = ['{{street_name}}, {{building_number}}']
- street_name_formats = ['{{street_prefix}} {{last_name}}',
- '{{last_name}} {{street_suffix}}']
+ street_name_formats = ('{{street_prefix}} {{street_title}}', )
city_prefixes = ['місто', 'село', 'селище', 'хутір']
countries = [
@@ -51,19 +50,127 @@ class Provider(AddressProvider):
'Туркменістан', 'Уганда', 'Угорщина', 'Узбекистан', 'Україна',
'Уругвай', 'Фіджі', 'Філіппіни', 'Фінляндія', 'Франція', 'Хорватія',
'Центральноафриканська Республіка', 'Чад', 'Чехія', 'Чилі',
- 'Чорногорія', 'Швейцарія', 'Швеція', 'Шрі-Ланка', 'Ямайка', 'Японія'
+ 'Чорногорія', 'Швейцарія', 'Швеція', 'Шрі-Ланка', 'Ямайка', 'Японія',
]
street_prefixes = [
- 'вулиця', 'проспект', 'майдан', 'набережна', 'бульвар', 'провулок'
+ 'вулиця', 'набережна',
]
street_suffixes = ['узвіз']
+ street_titles = [
+ '40-летия Октября',
+ 'Академика Шлихтера',
+ 'Алексея Давыдова',
+ 'Анищенко',
+ 'Антонова-Овсеенко',
+ 'Артема',
+ 'Бабушкина',
+ 'Бакинских Комиссаров',
+ 'Баумана',
+ 'Блюхера',
+ 'Боженко',
+ 'Бонч-Бруевича',
+ 'Буденного',
+ 'Ветрова',
+ 'Воровского',
+ 'Воссоединения',
+ 'Гамарника',
+ 'Горького',
+ 'Дзержинского',
+ 'Димитрова',
+ 'Дубового Ивана',
+ 'Дундича Олеко',
+ 'Жданова',
+ 'Ивана Клименко',
+ 'Ивана Лепсе',
+ 'Иванова Андрея',
+ 'Ильича',
+ 'Калининская',
+ 'Киквидзе',
+ 'Кирова',
+ 'Коллективизации',
+ 'Коллонтай',
+ 'Командарма Уборевич',
+ 'Комиссара Рыкова',
+ 'Коммунистическая',
+ 'Комсомольская',
+ 'Котовского',
+ 'Кравченко Николая',
+ 'Красикова Петра',
+ 'Красноармейская',
+ 'Красногвардейская',
+ 'Краснопартизанская',
+ 'Краснофлотская',
+ 'Крупской',
+ 'Крыленко',
+ 'Кутузова',
+ 'Лазо Сергея',
+ 'Лайоша Гавро',
+ 'Ластовского',
+ 'Ленина',
+ 'Ленинская',
+ 'Луначарского',
+ 'Майорова Михаила',
+ 'Маршала Буденного',
+ 'Маршала Тухачевского',
+ 'Мате Залки',
+ 'Машина Михаила',
+ 'Мильчакова Александра',
+ 'Михаила Скрипника',
+ 'Московская',
+ 'Октябрьская',
+ 'Омельяна Горбачова',
+ 'Островского Николая',
+ 'Павла Дибенко',
+ 'Павлика Морозова',
+ 'Патриса Лумумбы',
+ 'Перспективная',
+ 'Петра Дегтяренко',
+ 'Петра Шелеста',
+ 'Петровского',
+ 'Пика Вильгельма',
+ 'Полупанова',
+ 'Примакова',
+ 'Профинтерна',
+ 'Руднева Николая',
+ 'Сагайдика Степана',
+ 'Сарафимовича',
+ 'Сергея Струтинского',
+ 'Смирнова-Ласточкина',
+ 'Советская',
+ 'Софьи Перовской',
+ 'Строкача Тимофея',
+ 'Суворова',
+ 'Терешковой Валентины',
+ 'Трутенко Онуфрия',
+ 'Фадеева',
+ 'Федько Ивана',
+ 'Фрунзе',
+ 'Фурманова',
+ 'Цурюпинская',
+ 'Чапаева',
+ 'Чекистов',
+ 'Чеслава Белинского',
+ 'Чудновского',
+ 'Шаумяна',
+ 'Щербакова',
+ 'Щорса',
+ 'Юрия Коцюбинского',
+ 'Якира',
+ ]
+
def city_prefix(self):
return self.random_element(self.city_prefixes)
def postcode(self):
"""The code consists of five digits (01000-99999)"""
- return '{}{}'.format(self.generator.random.randint(0, 10), self.generator.random.randint(1000, 10000))
+ return '{}{}'.format(
+ self.generator.random.randint(
+ 0, 10), self.generator.random.randint(
+ 1000, 10000))
def street_prefix(self):
return self.random_element(self.street_prefixes)
+
+ def street_title(self):
+ return self.random_element(self.street_titles)
diff --git a/src/libs/faker/providers/address/zh_CN/__init__.py b/src/libs/faker/providers/address/zh_CN/__init__.py
index 7286cf3..de5eba7 100644
--- a/src/libs/faker/providers/address/zh_CN/__init__.py
+++ b/src/libs/faker/providers/address/zh_CN/__init__.py
@@ -5,18 +5,21 @@
class Provider(AddressProvider):
city_suffixes = ("市", "县")
- city_formats = ("{{city_name}}{{city_suffix}}", "{{first_name}}{{city_suffix}}")
+ city_formats = ("{{city_name}}{{city_suffix}}",
+ "{{first_name}}{{city_suffix}}")
district_formats = ("{{district}}区",)
building_number_formats = ("?座",)
postcode_formats = ("%#####",)
- street_suffixes = ("街", "路",)
- street_name_formats = ("{{city_name}}{{street_suffix}}", "{{last_name}}{{street_suffix}}")
+ street_suffixes = ("街", "路")
+ street_name_formats = ("{{city_name}}{{street_suffix}}",
+ "{{last_name}}{{street_suffix}}")
street_address_formats = ("{{street_name}}{{building_number}}",)
- address_formats = ("{{province}}{{city}}{{district}}{{street_address}} {{postcode}}",)
+ address_formats = (
+ "{{province}}{{city}}{{district}}{{street_address}} {{postcode}}",)
provinces = (
"内蒙古自治区", "山西省", "河北省", "吉林省", "江苏省", "辽宁省", "黑龍江省",
@@ -43,7 +46,7 @@ class Provider(AddressProvider):
"兴安盟", "太原", "辛集", "邯郸", "沈阳", "辽阳", "兴城", "北镇", "阜新",
"哈尔滨", "齐齐哈尔", "淮安", "张家港", "海门", "六安", "巢湖", "马鞍山",
"永安", "宁德", "嘉禾", "荆门", "潜江", "大冶", "宜都", "佛山", "深圳",
- "潮州", "惠州", "汕尾", "东莞", "梧州", "柳州", "合山", "六盘水", "关岭", )
+ "潮州", "惠州", "汕尾", "东莞", "梧州", "柳州", "合山", "六盘水", "关岭")
countries = (
"阿富汗", "阿拉斯加", "阿尔巴尼亚", "阿尔及利亚", "安道尔", "安哥拉", "安圭拉岛英", "安提瓜和巴布达",
"阿根廷", "亚美尼亚", "阿鲁巴岛", "阿森松", "澳大利亚", "奥地利", "阿塞拜疆", "巴林", "孟加拉国",
diff --git a/src/libs/faker/providers/address/zh_TW/__init__.py b/src/libs/faker/providers/address/zh_TW/__init__.py
index af12e22..ff58dc8 100644
--- a/src/libs/faker/providers/address/zh_TW/__init__.py
+++ b/src/libs/faker/providers/address/zh_TW/__init__.py
@@ -4,13 +4,14 @@
class Provider(AddressProvider):
- city_formats = ("{{city_name}}", )
- building_number_formats = ("%號", "%#號", "%##號", )
- postcode_formats = ("%####", "%##", )
- section_formats = ( "", "", "", "", "%段", )
- street_address_formats = ( "{{street_name}}{{street_name_suffix}}{{section_number}}{{building_number}}", )
- city_formats = ( "{{city_name}}{{city_name_suffix}}", )
- address_formats = ("{{postcode}} {{city}}{{street_address}}{{secondary_address}}", )
+ city_formats = ("{{city_name}}", "{{city_name}}{{city_name_suffix}}")
+ building_number_formats = ("%號", "%#號", "%##號")
+ postcode_formats = ("%####", "%##")
+ section_formats = ("", "", "", "", "%段")
+ street_address_formats = (
+ "{{street_name}}{{street_name_suffix}}{{section_number}}{{building_number}}", )
+ address_formats = (
+ "{{postcode}} {{city}}{{street_address}}{{secondary_address}}", )
secondary_address_formats = ('#樓', '之#')
street_names = ("中正", "中山", "民生", "中華", "和平",
@@ -36,7 +37,7 @@ class Provider(AddressProvider):
"關渡", "北投", "石牌", "芝山", "景美",
"士林", "劍潭", "雙連", "新北投", "萬隆")
- street_suffixes = ( "路", "街", "巷" )
+ street_suffixes = ("路", "街", "巷")
cities = ("基隆", "台北", "新北", "桃園", "新竹",
"新竹", "苗栗", "台中", "彰化", "南投",
@@ -52,7 +53,7 @@ class Provider(AddressProvider):
"北港", "卑南", "草屯", "梅山", "牡丹",
"橫山", "光復", "關山", "古坑", "竹田")
- city_suffixes = ( "市", "縣" )
+ city_suffixes = ("市", "縣")
# from
countries = ("阿爾巴尼亞", "剛果共和國", "阿爾及利亞", "丹麥",
@@ -89,7 +90,9 @@ class Provider(AddressProvider):
"聖克里斯多福及尼維斯")
def secondary_address(self):
- return self.numerify(self.random_element(self.secondary_address_formats))
+ return self.numerify(
+ self.random_element(
+ self.secondary_address_formats))
def building_number(self):
return self.numerify(self.random_element(self.building_number_formats))
diff --git a/src/libs/faker/providers/automotive/__init__.py b/src/libs/faker/providers/automotive/__init__.py
index 2287d90..bcdfc24 100644
--- a/src/libs/faker/providers/automotive/__init__.py
+++ b/src/libs/faker/providers/automotive/__init__.py
@@ -1,16 +1,17 @@
# coding=utf-8
-localized = True
-
from .. import BaseProvider
from string import ascii_uppercase
import re
+localized = True
+
+
class Provider(BaseProvider):
license_formats = ()
def license_plate(self):
temp = re.sub(r'\?',
- lambda x: self.random_element(ascii_uppercase),
- self.random_element(self.license_formats))
+ lambda x: self.random_element(ascii_uppercase),
+ self.random_element(self.license_formats))
return self.numerify(temp)
diff --git a/src/libs/faker/providers/automotive/ar_JO/__init__.py b/src/libs/faker/providers/automotive/ar_JO/__init__.py
index 362e084..78fd138 100644
--- a/src/libs/faker/providers/automotive/ar_JO/__init__.py
+++ b/src/libs/faker/providers/automotive/ar_JO/__init__.py
@@ -5,7 +5,8 @@
class Provider(AutomotiveProvider):
- # Source: https://en.wikipedia.org/wiki/Vehicle_registration_plates_of_Jordan
+ # Source:
+ # https://en.wikipedia.org/wiki/Vehicle_registration_plates_of_Jordan
license_formats = (
'{{initials}}-####',
'{{initials}}-#####',
diff --git a/src/libs/faker/providers/automotive/ar_PS/__init__.py b/src/libs/faker/providers/automotive/ar_PS/__init__.py
index 4c43cad..5d0c0b8 100644
--- a/src/libs/faker/providers/automotive/ar_PS/__init__.py
+++ b/src/libs/faker/providers/automotive/ar_PS/__init__.py
@@ -5,7 +5,8 @@
class Provider(AutomotiveProvider):
- # Source: https://en.wikipedia.org/wiki/Vehicle_registration_plates_of_the_Palestinian_National_Authority
+ # Source:
+ # https://en.wikipedia.org/wiki/Vehicle_registration_plates_of_the_Palestinian_National_Authority
license_formats = (
# Private vehicles
'{{district}}-####-3#',
diff --git a/src/libs/faker/providers/automotive/ar_SA/__init__.py b/src/libs/faker/providers/automotive/ar_SA/__init__.py
index 0b43cac..cb5ce62 100644
--- a/src/libs/faker/providers/automotive/ar_SA/__init__.py
+++ b/src/libs/faker/providers/automotive/ar_SA/__init__.py
@@ -8,7 +8,8 @@
class Provider(AutomotiveProvider):
- # Source: https://en.wikipedia.org/wiki/Vehicle_registration_plates_of_Saudi_Arabia
+ # Source:
+ # https://en.wikipedia.org/wiki/Vehicle_registration_plates_of_Saudi_Arabia
LICENSE_FORMAT_EN = '#### ???'
LICENSE_FORMAT_AR = '? ? ? ####'
@@ -48,7 +49,7 @@ class Provider(AutomotiveProvider):
def license_plate_en(self):
return self.bothify(
- self.LICENSE_FORMAT_EN, letters=self.PLATE_CHARS_EN
+ self.LICENSE_FORMAT_EN, letters=self.PLATE_CHARS_EN,
)
def license_plate_ar(self):
@@ -62,12 +63,12 @@ def _translate_license_plate(self, license_plate):
numerated = re.sub(
r'\#',
lambda x: self.PLATE_MAP[nums.pop()],
- self.LICENSE_FORMAT_AR
+ self.LICENSE_FORMAT_AR,
)
ar_plate = re.sub(
r'\?',
lambda x: self.PLATE_MAP[chars.pop()],
- numerated
+ numerated,
)
return ar_plate
@@ -77,5 +78,3 @@ def license_plate(self):
ar_palate = self._translate_license_plate(en_palate)
return en_palate, ar_palate
-
-
diff --git a/src/libs/faker/providers/automotive/de_DE/__init__.py b/src/libs/faker/providers/automotive/de_DE/__init__.py
new file mode 100644
index 0000000..14bc54d
--- /dev/null
+++ b/src/libs/faker/providers/automotive/de_DE/__init__.py
@@ -0,0 +1,46 @@
+# coding=utf-8
+
+
+from __future__ import unicode_literals
+from .. import Provider as AutomotiveProvider
+import string
+
+
+class Provider(AutomotiveProvider):
+
+ # http://berlin.de/daten/liste-der-kfz-kennzeichen/kfz-kennz-d.csv
+ license_plate_prefix = (
+ 'A', 'AA', 'AB', 'ABI', 'ABG', 'AC', 'AE', 'AIC', 'AK', 'AM', 'AN', 'AÖ', 'AP', 'AS', 'AUR', 'AW', 'AZ', 'B',
+ 'BA', 'BAD', 'BAR', 'BB', 'BC', 'BD', 'BGL', 'BI', 'BIR', 'BIT', 'BK', 'BL', 'BLK', 'BM', 'BN', 'BO', 'BOR',
+ 'BOT', 'BP', 'BRA', 'BRB', 'BS', 'BT', 'BTF', 'BÜS', 'BW', 'BWL', 'BYL', 'BZ', 'C', 'CB', 'CE', 'CHA', 'CO',
+ 'COC', 'COE', 'CUX', 'CW', 'D', 'DA', 'DAH', 'DAN', 'DAU', 'DBR', 'DD', 'DE', 'DEG', 'DEL', 'DGF', 'DH', 'DL',
+ 'DLG', 'DN', 'Do', 'DON', 'DU', 'DÜW', 'E', 'EA', 'EB', 'EBE', 'ED', 'EE', 'EF', 'EI', 'EIC', 'EL', 'EM', 'EMD',
+ 'EMS', 'EN', 'ER', 'ERB', 'ERH', 'ERZ', 'ES', 'ESW', 'EU', 'F', 'FB', 'FD', 'FDS', 'FF', 'FFB', 'FG', 'FL',
+ 'FN', 'FO', 'FR', 'FRG', 'FRI', 'FS', 'FT', 'FÜ', 'G', 'GAP', 'GE', 'GER', 'GF', 'GG', 'GI', 'GL', 'GM', 'GÖ',
+ 'GP', 'GR', 'GRZ', 'GS', 'GT', 'GTH', 'GÜ', 'GZ', 'H', 'HA', 'HAL', 'HAM', 'HAS', 'HB', 'HBN', 'HD', 'HDH',
+ 'HE', 'HEF', 'HEI', 'HEL', 'HER', 'HF', 'HG', 'HGW', 'HH', 'HI', 'HL', 'HM', 'HN', 'HO', 'HOL', 'HOM', 'HP',
+ 'HR', 'HRO', 'HS', 'HSK', 'HST', 'HU', 'HVL', 'HWI', 'HX', 'HZ', 'IGB', 'IK', 'IN', 'IZ', 'J', 'JL', 'K', 'KA',
+ 'KB', 'KC', 'KE', 'KEH', 'KF', 'KG', 'KH', 'KI', 'KIB', 'KL', 'KLE', 'KN', 'KO', 'KR', 'KS', 'KT', 'KU', 'KÜN',
+ 'KUS', 'KYF', 'L', 'LA', 'LAU', 'LB', 'LD', 'LDK', 'LDS', 'LER', 'LEV', 'LG', 'LI', 'LIF', 'LIP', 'LL', 'LM',
+ 'LÖ', 'LOS', 'LRO', 'LSA', 'LSN', 'LU', 'LWL', 'M', 'MA', 'MB', 'MD', 'ME', 'MEI', 'MG', 'MI', 'MIL', 'MK',
+ 'MKK', 'MM', 'MN', 'MOL', 'MOS', 'MR', 'MS', 'MSH', 'MSP', 'MST', 'MTK', 'MÜ', 'MÜR', 'MVL', 'MYK', 'MZ', 'MZG',
+ 'N', 'NB', 'ND', 'NDH', 'NE', 'NEA', 'NES', 'NEW', 'NF', 'NI', 'NK', 'NL', 'NM', 'NMS', 'NOH', 'NOM', 'NR',
+ 'NU', 'NVP', 'NW', 'NWM', 'OA', 'OAL', 'OB', 'OD', 'OE', 'OF', 'OG', 'OH', 'OHA', 'OHV', 'OHZ', 'OL', 'OPR',
+ 'OS', 'OSL', 'OVP', 'P', 'PA', 'PAF', 'PAN', 'PB', 'PCH', 'PE', 'PF', 'PI', 'PIR', 'PLÖ', 'PM', 'PR', 'PS', 'R',
+ 'RA', 'RD', 'RE', 'REG', 'RO', 'ROS', 'ROW', 'RP', 'RPL', 'RS', 'RT', 'RÜD', 'RÜG', 'RV', 'RW', 'RZ', 'S',
+ 'SAD', 'SAL', 'SAW', 'SB', 'SC', 'SDL', 'SE', 'SG', 'SH', 'SHA', 'SHG', 'SHK', 'SHL', 'SI', 'SIG', 'SIM', 'SK',
+ 'SL', 'SLF', 'SLK', 'SLS', 'SM', 'SN', 'SO', 'SOK', 'SÖM', 'SON', 'SP', 'SPN', 'SR', 'ST', 'STA', 'STD', 'SU',
+ 'SÜW', 'SW', 'SZ', 'TDO', 'TBB', 'TF', 'TG', 'THL', 'THW', 'TIR', 'TÖL', 'TR', 'TS', 'TÜ', 'TUT', 'UE', 'UL',
+ 'UM', 'UN', 'V', 'VB', 'VEC', 'VER', 'VIE', 'VK', 'VR', 'VS', 'W', 'WAF', 'WAK', 'WB', 'WE', 'WEN', 'WES', 'WF',
+ 'WHV', 'WI', 'WIL', 'WL', 'WM', 'WN', 'WND', 'WO', 'WOB', 'WST', 'WT', 'WTM', 'WÜ', 'WUG', 'WUN', 'WW', 'WZ',
+ 'Y', 'Z', 'ZW',
+ )
+
+ license_plate_suffix = (
+ '-??-%@@@',
+ '-?-%@@@',
+ )
+
+ def license_plate(self):
+ return self.random_element(self.license_plate_prefix) + \
+ self.lexify(self.numerify(self.random_element(self.license_plate_suffix)), string.ascii_uppercase)
diff --git a/src/libs/faker/providers/automotive/en_CA/__init__.py b/src/libs/faker/providers/automotive/en_CA/__init__.py
index 473a7a4..82a1679 100644
--- a/src/libs/faker/providers/automotive/en_CA/__init__.py
+++ b/src/libs/faker/providers/automotive/en_CA/__init__.py
@@ -5,7 +5,8 @@
class Provider(AutomotiveProvider):
- # from https://www.revolvy.com/main/index.php?s=Canadian%20licence%20plate%20designs%20and%20serial%20formats
+ # from
+ # https://www.revolvy.com/main/index.php?s=Canadian%20licence%20plate%20designs%20and%20serial%20formats
license_formats = (
# Alberta
'???-####',
@@ -38,5 +39,5 @@ class Provider(AutomotiveProvider):
# Saskatchewan
'### ???',
# Yukon
- '???##'
- )
\ No newline at end of file
+ '???##',
+ )
diff --git a/src/libs/faker/providers/automotive/en_GB/__init__.py b/src/libs/faker/providers/automotive/en_GB/__init__.py
index b84c196..ccd5bf7 100644
--- a/src/libs/faker/providers/automotive/en_GB/__init__.py
+++ b/src/libs/faker/providers/automotive/en_GB/__init__.py
@@ -5,8 +5,9 @@
class Provider(AutomotiveProvider):
- # from https://en.wikipedia.org/wiki/Vehicle_registration_plates_of_the_United_Kingdom
+ # from
+ # https://en.wikipedia.org/wiki/Vehicle_registration_plates_of_the_United_Kingdom
license_formats = (
- '??## ???',
- '??##???'
- )
\ No newline at end of file
+ '??## ???',
+ '??##???',
+ )
diff --git a/src/libs/faker/providers/automotive/en_NZ/__init__.py b/src/libs/faker/providers/automotive/en_NZ/__init__.py
new file mode 100644
index 0000000..ef69fd2
--- /dev/null
+++ b/src/libs/faker/providers/automotive/en_NZ/__init__.py
@@ -0,0 +1,28 @@
+# -*- coding: utf-8 -*-
+from __future__ import unicode_literals
+from .. import Provider as AutomotiveProvider
+
+
+class Provider(AutomotiveProvider):
+ # See https://en.wikipedia.org/wiki/Vehicle_registration_plates_of_New_Zealand
+ license_formats = (
+ # Old plates
+ '??%##',
+ '??%###',
+ '??%###',
+ # Three letters since 2002
+ 'A??%##',
+ 'B??%##',
+ 'C??%##',
+ 'D??%##',
+ 'E??%##',
+ 'F??%##',
+ 'G??%##',
+ 'H??%##',
+ 'J??%##',
+ 'K??%##',
+ 'L??%##',
+ 'M??%##',
+ # After 2018
+ 'N??%##',
+ )
diff --git a/src/libs/faker/providers/automotive/en_US/__init__.py b/src/libs/faker/providers/automotive/en_US/__init__.py
index 8d2c9ea..562bf6c 100644
--- a/src/libs/faker/providers/automotive/en_US/__init__.py
+++ b/src/libs/faker/providers/automotive/en_US/__init__.py
@@ -3,8 +3,10 @@
from __future__ import unicode_literals
from .. import Provider as AutomotiveProvider
+
class Provider(AutomotiveProvider):
- # from https://en.wikipedia.org/wiki/United_States_license_plate_designs_and_serial_formats#Current_standard-issue_passenger_plate_designs_and_serial_formats
+ # from
+ # https://en.wikipedia.org/wiki/United_States_license_plate_designs_and_serial_formats#Current_standard-issue_passenger_plate_designs_and_serial_formats
license_formats = (
# Alabama
'#??####',
@@ -89,7 +91,7 @@ class Provider(AutomotiveProvider):
# Montana
'#-#####?',
'##-####?',
- # Nebraska
+ # Nebraska
'??? ###',
'#-?####',
'##-?###',
@@ -105,7 +107,7 @@ class Provider(AutomotiveProvider):
'???-###',
# New York
'???-####',
- # North Carolina
+ # North Carolina
'###-????',
# North Dakota
'### ???',
@@ -133,7 +135,7 @@ class Provider(AutomotiveProvider):
'##? ??#',
# Tennessee
'?##-##?',
- # Texas
+ # Texas
'???-####',
# Utah
'?## #??',
@@ -150,15 +152,15 @@ class Provider(AutomotiveProvider):
'???-####',
# Washington
'???####',
- '###-???'
+ '###-???',
# West Virginia
'#?? ###',
'??? ###',
# Wisconsin
'???-####',
- '###-???'
+ '###-???',
# Wyoming
'#-#####',
'#-####?',
- '##-#####'
- )
\ No newline at end of file
+ '##-#####',
+ )
diff --git a/src/libs/faker/providers/automotive/hu_HU/__init__.py b/src/libs/faker/providers/automotive/hu_HU/__init__.py
index 7bbc3fd..329844e 100644
--- a/src/libs/faker/providers/automotive/hu_HU/__init__.py
+++ b/src/libs/faker/providers/automotive/hu_HU/__init__.py
@@ -4,8 +4,9 @@
from __future__ import unicode_literals
from .. import Provider as AutomotiveProvider
+
class Provider(AutomotiveProvider):
# from https://en.wikipedia.org/wiki/Vehicle_registration_plates_of_Hungary
license_formats = (
- '???-###',
- )
+ '???-###',
+ )
diff --git a/src/libs/faker/providers/automotive/id_ID/__init__.py b/src/libs/faker/providers/automotive/id_ID/__init__.py
index 888a4d8..da38657 100644
--- a/src/libs/faker/providers/automotive/id_ID/__init__.py
+++ b/src/libs/faker/providers/automotive/id_ID/__init__.py
@@ -3,6 +3,7 @@
from __future__ import unicode_literals
from .. import Provider as AutomotiveProvider
+
class Provider(AutomotiveProvider):
# Currently this is my own work
license_formats = (
diff --git a/src/libs/faker/providers/automotive/ru_RU/__init__.py b/src/libs/faker/providers/automotive/ru_RU/__init__.py
new file mode 100644
index 0000000..f56f310
--- /dev/null
+++ b/src/libs/faker/providers/automotive/ru_RU/__init__.py
@@ -0,0 +1,210 @@
+# coding=utf-8
+
+
+from __future__ import unicode_literals
+from .. import Provider as AutomotiveProvider
+
+
+class Provider(AutomotiveProvider):
+
+ # https://en.wikipedia.org/wiki/Vehicle_registration_plates_of_Russia
+ license_plate_letters = ('A', 'B', 'E', 'M', 'Н', 'О', 'Р', 'С', 'Т', 'У', 'Х')
+
+ license_plate_suffix = (
+ # Republic of Adygea
+ '01',
+ # Republic of Bashkortostan
+ '02', '102',
+ # Republic of Buryatia
+ '03',
+ # Altai Republic
+ '04',
+ # Republic of Dagestan
+ '05',
+ # Republic of Ingushetia
+ '06',
+ # Kabardino-Balkar Republic
+ '07',
+ # Republic of Kalmykia
+ '08',
+ # Karachay-Cherkess Republic
+ '09',
+ # Republic of Karelia
+ '10',
+ # Komi Republic
+ '11',
+ # Mari El Republic
+ '12',
+ # Republic of Mordovia
+ '13', '113',
+ # Sakha Republic
+ '14',
+ # Republic of North Ossetia–Alania
+ '15',
+ # Republic of Tatarstan
+ '16', '116', '716',
+ # Tuva Republic
+ '17',
+ # Udmurt Republic
+ '18',
+ # Republic of Khakassia
+ '19',
+ # Chechen Republic
+ '20', '95',
+ # Chuvash Republic
+ '21', '121',
+ # Altai Krai
+ '22',
+ # Krasnodar Krai
+ '23', '93', '123',
+ # Krasnoyarsk Krai
+ '24', '84', '88', '124',
+ # Primorsky Krai
+ '25', '125',
+ # Stavropol Krai
+ '26', '126',
+ # Khabarovsk Krai
+ '27',
+ # Amur Oblast
+ '28',
+ # Arkhangelsk Oblast
+ '29',
+ # Astrakhan Oblast
+ '30',
+ # Belgorod Oblast
+ '31',
+ # Bryansk Oblast
+ '32',
+ # Vladimir Oblast
+ '33',
+ # Volgograd Oblast
+ '34', '134',
+ # Vologda Oblast
+ '35',
+ # Voronezh Oblast
+ '36', '136',
+ # Ivanovo Oblast
+ '37',
+ # Irkutsk Oblast
+ '38', '85', '38',
+ # Kaliningrad Oblast
+ '39', '91',
+ # Kaluga Oblast
+ '40',
+ # Kamchatka Krai
+ '41', '82',
+ # Kemerovo Oblast
+ '42', '142',
+ # Kirov Oblast
+ '43',
+ # Kostroma Oblast
+ '44',
+ # Kurgan Oblast
+ '45',
+ # Kursk Oblast
+ '46',
+ # Leningrad Oblast
+ '47',
+ # Lipetsk Oblast
+ '48',
+ # Magadan Oblast
+ '49',
+ # Moscow Oblast
+ '50', '90', '150', '190', '750',
+ # Murmansk Oblast
+ '51',
+ # Nizhny Novgorod Oblast
+ '52', '152',
+ # Novgorod Oblast
+ '53',
+ # Novosibirsk Oblast
+ '54', '154',
+ # Omsk Oblast
+ '55',
+ # Orenburg Oblast
+ '56',
+ # Oryol Oblast
+ '57',
+ # Penza Oblast
+ '58',
+ # Perm Krai
+ '59', '81', '159',
+ # Pskov Oblast
+ '60',
+ # Rostov Oblast
+ '61', '161',
+ # Ryazan Oblast
+ '62',
+ # Samara Oblast
+ '63', '163', '763',
+ # Saratov Oblast
+ '64', '164',
+ # Sakhalin Oblast
+ '65',
+ # Sverdlovsk Oblast
+ '66', '96', '196',
+ # Smolensk Oblast
+ '67',
+ # Tambov Oblast
+ '68',
+ # Tver Oblast
+ '69',
+ # Tomsk Oblast
+ '70',
+ # Tula Oblast
+ '71',
+ # Tyumen Oblast
+ '72',
+ # Ulyanovsk Oblast
+ '73', '173',
+ # Chelyabinsk Oblast
+ '74', '174',
+ # Zabaykalsky Krai
+ '75', '80',
+ # Yaroslavl Oblast
+ '76',
+ # Moscow
+ '77', '97', '99', '177', '197', '199', '777', '799',
+ # St. Petersburg
+ '78', '98', '178', '198',
+ # Jewish Autonomous Oblast
+ '79',
+ # Agin-Buryat Okrug / "Former Buryat Autonomous District of Aginskoye"
+ '80',
+ # Komi-Permyak Okrug / "Former Komi-Permyak Autonomous District"
+ '81',
+ # Republic of Crimea / De jure part of Ukraine as Autonomous Republic. Annexed by Russia in 2014.
+ '82',
+ # Koryak Okrug / "Former Koryak Autonomous District"
+ '82',
+ # Nenets Autonomous Okrug (Nenetsia)
+ '83',
+ # Taymyr Autonomous Okrug / "Former Taymyr (Dolgan-Nenets) Autonomous District"
+ '84',
+ # Ust-Orda Buryat Okrug / "Former Buryat Autonomous District of Ust-Ordynskoy"
+ '85',
+ # Khanty-Mansi Autonomous Okrug
+ '86', '186',
+ # Chukotka Autonomous Okrug
+ '87',
+ # Evenk Autonomous Okrug / "Former Evenk Autonomous District"
+ '88',
+ # Yamalo-Nenets Autonomous Okrug
+ '89',
+ # Sevastopol / De jure part of Ukraine as City with special status. Annexed by Russia in 2014.
+ '92',
+ # Territories outside of the Russian Federation,
+ # served by the bodies of internal affairs of the Russian Federation, such as Baikonur
+ '94',
+ )
+
+ license_plate_number = (
+ '##%'
+ )
+
+ def license_plate(self):
+ return self.random_element(self.license_plate_letters) + \
+ self.numerify(self.generator.parse(self.license_plate_number)) + \
+ self.random_element(self.license_plate_letters) + \
+ self.random_element(self.license_plate_letters) + \
+ self.random_element(self.license_plate_suffix)
diff --git a/src/libs/faker/providers/automotive/sv_SE/__init__.py b/src/libs/faker/providers/automotive/sv_SE/__init__.py
new file mode 100644
index 0000000..1cb540a
--- /dev/null
+++ b/src/libs/faker/providers/automotive/sv_SE/__init__.py
@@ -0,0 +1,16 @@
+# coding=utf-8
+
+
+from __future__ import unicode_literals
+from .. import Provider as AutomotiveProvider
+
+
+class Provider(AutomotiveProvider):
+ # Source: https://en.wikipedia.org/wiki/Vehicle_registration_plates_of_Sweden
+ # New possible format: https://goo.gl/gSjsnV
+ license_formats = (
+ # Classic format
+ '??? ###',
+ # New possible format
+ '??? ##?',
+ )
diff --git a/src/libs/faker/providers/bank/__init__.py b/src/libs/faker/providers/bank/__init__.py
new file mode 100644
index 0000000..b8f1e0f
--- /dev/null
+++ b/src/libs/faker/providers/bank/__init__.py
@@ -0,0 +1,41 @@
+# coding=utf-8
+from .. import BaseProvider
+import string
+from string import ascii_uppercase
+import re
+
+localized = True
+default_locale = 'en_GB'
+
+
+class Provider(BaseProvider):
+ """
+ Provider for IBAN/BBAN: it generates valid (valid length, valid checksum)
+ IBAN/BBANs for the given country. But the ids of the banks are random and
+ not valid banks! Same for account numbers.
+ """
+
+ ALPHA = {c: str(ord(c) % 55) for c in string.ascii_uppercase}
+
+ # see https://en.wikipedia.org/wiki/International_Bank_Account_Number
+ bban_format = '????#############'
+ country_code = 'GB'
+
+ def bank_country(self):
+ return self.country_code
+
+ def bban(self):
+ temp = re.sub(r'\?',
+ lambda x: self.random_element(ascii_uppercase),
+ self.bban_format)
+ return self.numerify(temp)
+
+ def iban(self):
+ bban = self.bban()
+
+ check = bban + self.country_code + '00'
+ check = int(''.join(self.ALPHA.get(c, c) for c in check))
+ check = 98 - (check % 97)
+ check = str(check).zfill(2)
+
+ return self.country_code + check + bban
diff --git a/src/libs/faker/providers/bank/de_AT/__init__.py b/src/libs/faker/providers/bank/de_AT/__init__.py
new file mode 100644
index 0000000..d70af33
--- /dev/null
+++ b/src/libs/faker/providers/bank/de_AT/__init__.py
@@ -0,0 +1,6 @@
+from .. import Provider as BankProvider
+
+
+class Provider(BankProvider):
+ bban_format = '################'
+ country_code = 'AT'
diff --git a/src/libs/faker/providers/bank/de_DE/__init__.py b/src/libs/faker/providers/bank/de_DE/__init__.py
new file mode 100644
index 0000000..84c9474
--- /dev/null
+++ b/src/libs/faker/providers/bank/de_DE/__init__.py
@@ -0,0 +1,6 @@
+from .. import Provider as BankProvider
+
+
+class Provider(BankProvider):
+ bban_format = '##################'
+ country_code = 'DE'
diff --git a/src/libs/faker/providers/bank/en_GB/__init__.py b/src/libs/faker/providers/bank/en_GB/__init__.py
new file mode 100644
index 0000000..9486de7
--- /dev/null
+++ b/src/libs/faker/providers/bank/en_GB/__init__.py
@@ -0,0 +1,6 @@
+from .. import Provider as BankProvider
+
+
+class Provider(BankProvider):
+ bban_format = '????#############'
+ country_code = 'GB'
diff --git a/src/libs/faker/providers/bank/fr_FR/__init__.py b/src/libs/faker/providers/bank/fr_FR/__init__.py
new file mode 100644
index 0000000..0047f58
--- /dev/null
+++ b/src/libs/faker/providers/bank/fr_FR/__init__.py
@@ -0,0 +1,6 @@
+from .. import Provider as BankProvider
+
+
+class Provider(BankProvider):
+ bban_format = '########################'
+ country_code = 'FR'
diff --git a/src/libs/faker/providers/bank/it_IT/__init__.py b/src/libs/faker/providers/bank/it_IT/__init__.py
new file mode 100644
index 0000000..c15cec8
--- /dev/null
+++ b/src/libs/faker/providers/bank/it_IT/__init__.py
@@ -0,0 +1,6 @@
+from .. import Provider as BankProvider
+
+
+class Provider(BankProvider):
+ bban_format = '?######################'
+ country_code = 'IT'
diff --git a/src/libs/faker/providers/bank/nl_NL/__init__.py b/src/libs/faker/providers/bank/nl_NL/__init__.py
new file mode 100644
index 0000000..1a56995
--- /dev/null
+++ b/src/libs/faker/providers/bank/nl_NL/__init__.py
@@ -0,0 +1,6 @@
+from .. import Provider as BankProvider
+
+
+class Provider(BankProvider):
+ bban_format = '????##########'
+ country_code = 'NL'
diff --git a/src/libs/faker/providers/bank/no_NO/__init__.py b/src/libs/faker/providers/bank/no_NO/__init__.py
new file mode 100644
index 0000000..17b9984
--- /dev/null
+++ b/src/libs/faker/providers/bank/no_NO/__init__.py
@@ -0,0 +1,6 @@
+from .. import Provider as BankProvider
+
+
+class Provider(BankProvider):
+ bban_format = '###########'
+ country_code = 'NO'
diff --git a/src/libs/faker/providers/bank/pl_PL/__init__.py b/src/libs/faker/providers/bank/pl_PL/__init__.py
new file mode 100644
index 0000000..8fa318a
--- /dev/null
+++ b/src/libs/faker/providers/bank/pl_PL/__init__.py
@@ -0,0 +1,6 @@
+from .. import Provider as BankProvider
+
+
+class Provider(BankProvider):
+ bban_format = '#' * 26
+ country_code = 'PL'
diff --git a/src/libs/faker/providers/barcode/__init__.py b/src/libs/faker/providers/barcode/__init__.py
index f0914df..0ccd34e 100644
--- a/src/libs/faker/providers/barcode/__init__.py
+++ b/src/libs/faker/providers/barcode/__init__.py
@@ -7,7 +7,7 @@
class Provider(BaseProvider):
def ean(self, length=13):
- code = [self.random_digit() for i in range(length - 1)]
+ code = [self.random_digit() for _ in range(length - 1)]
if length not in (8, 13):
raise AssertionError("length can only be 8 or 13")
@@ -17,7 +17,7 @@ def ean(self, length=13):
elif length == 13:
weights = [1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3]
- weighted_sum = sum([x * y for x, y in zip(code, weights)])
+ weighted_sum = sum(x * y for x, y in zip(code, weights))
check_digit = (10 - weighted_sum % 10) % 10
code.append(check_digit)
diff --git a/src/libs/faker/providers/color/__init__.py b/src/libs/faker/providers/color/__init__.py
index ad314a6..75e669a 100644
--- a/src/libs/faker/providers/color/__init__.py
+++ b/src/libs/faker/providers/color/__init__.py
@@ -164,7 +164,11 @@ def safe_color_name(self):
return self.random_element(self.safe_colors)
def hex_color(self):
- return "#{0}".format(("%x" % self.random_int(1, 16777215)).ljust(6, '0'))
+ return "#{0}".format(
+ ("%x" %
+ self.random_int(
+ 1, 16777215)).ljust(
+ 6, '0'))
def safe_hex_color(self):
color = ("%x" % self.random_int(0, 255)).ljust(3, '0')
@@ -174,4 +178,5 @@ def rgb_color(self):
return ','.join(map(str, (self.random_int(0, 255) for _ in range(3))))
def rgb_css_color(self):
- return 'rgb(%s)' % ','.join(map(str, (self.random_int(0, 255) for _ in range(3))))
+ return 'rgb(%s)' % ','.join(
+ map(str, (self.random_int(0, 255) for _ in range(3))))
diff --git a/src/libs/faker/providers/color/ar_PS/__init__.py b/src/libs/faker/providers/color/ar_PS/__init__.py
index 717fa31..94ab825 100644
--- a/src/libs/faker/providers/color/ar_PS/__init__.py
+++ b/src/libs/faker/providers/color/ar_PS/__init__.py
@@ -154,4 +154,3 @@ class Provider(ColorProvider):
'أرجواني', 'حذفي', 'ليمي', 'أزرق', 'فضي',
'رمادي', 'أصفر', 'فوشي', 'مائي', 'أبيض',
)
-
diff --git a/src/libs/faker/providers/color/fr_FR/__init__.py b/src/libs/faker/providers/color/fr_FR/__init__.py
index 33b9c97..124b30b 100644
--- a/src/libs/faker/providers/color/fr_FR/__init__.py
+++ b/src/libs/faker/providers/color/fr_FR/__init__.py
@@ -151,6 +151,5 @@ class Provider(ColorProvider):
safe_colors = (
'noir', 'bordeaux', 'vert', 'rouge',
'violet', 'sarcelle', 'bleu', 'argent',
- 'gris', 'jaune', 'fuchsia', 'cyan', 'blanc'
+ 'gris', 'jaune', 'fuchsia', 'cyan', 'blanc',
)
-
diff --git a/src/libs/faker/providers/color/hr_HR/__init__.py b/src/libs/faker/providers/color/hr_HR/__init__.py
index cf06376..676f5e9 100644
--- a/src/libs/faker/providers/color/hr_HR/__init__.py
+++ b/src/libs/faker/providers/color/hr_HR/__init__.py
@@ -157,4 +157,3 @@ class Provider(ColorProvider):
'purpurna', 'modrozelena', 'lipa', 'plava', 'srebrna',
'siva', 'žuta', 'fuksija', 'voda', 'bijela',
)
-
diff --git a/src/libs/faker/providers/color/hu_HU/__init__.py b/src/libs/faker/providers/color/hu_HU/__init__.py
index f5c378f..1ad1b98 100644
--- a/src/libs/faker/providers/color/hu_HU/__init__.py
+++ b/src/libs/faker/providers/color/hu_HU/__init__.py
@@ -1,5 +1,4 @@
# coding=utf-8
-from collections import OrderedDict
from faker.providers import BaseProvider
@@ -11,4 +10,3 @@ class Provider(BaseProvider):
'bíbor', 'kékeszöld', 'citromzöld', 'kék', 'ezüst',
'szürke', 'sárga', 'mályva', 'akvamarin', 'fehér',
)
-
diff --git a/src/libs/faker/providers/color/ru_RU/__init__.py b/src/libs/faker/providers/color/ru_RU/__init__.py
index efef06d..62d6d09 100644
--- a/src/libs/faker/providers/color/ru_RU/__init__.py
+++ b/src/libs/faker/providers/color/ru_RU/__init__.py
@@ -70,5 +70,5 @@ class Provider(ColorProvider):
safe_colors = (
'черный', 'бордовый', 'зеленый', 'оливковый',
'пурпурный', 'teal', 'lime', 'синий', 'серебряный',
- 'серый', 'желтый', 'фуксия', 'белый'
+ 'серый', 'желтый', 'фуксия', 'белый',
)
diff --git a/src/libs/faker/providers/color/uk_UA/__init__.py b/src/libs/faker/providers/color/uk_UA/__init__.py
index 6b72462..3f4c8fd 100644
--- a/src/libs/faker/providers/color/uk_UA/__init__.py
+++ b/src/libs/faker/providers/color/uk_UA/__init__.py
@@ -214,5 +214,5 @@ class Provider(ColorProvider):
('Ясно-брунатний', '#CD853F'),
('Ясно-вишневий', '#DE3163'),
('Ясно-лазуровий', '#007FFF'),
- ('Ясно-лазуровий (веб)', '#F0FFFF')
+ ('Ясно-лазуровий (веб)', '#F0FFFF'),
))
diff --git a/src/libs/faker/providers/company/__init__.py b/src/libs/faker/providers/company/__init__.py
index 539fa2b..2bf22c4 100644
--- a/src/libs/faker/providers/company/__init__.py
+++ b/src/libs/faker/providers/company/__init__.py
@@ -11,95 +11,488 @@ class Provider(BaseProvider):
formats = (
'{{last_name}} {{company_suffix}}',
'{{last_name}}-{{last_name}}',
- '{{last_name}}, {{last_name}} and {{last_name}}'
+ '{{last_name}}, {{last_name}} and {{last_name}}',
)
company_suffixes = ('Inc', 'and Sons', 'LLC', 'Group', 'PLC', 'Ltd')
catch_phrase_words = (
- (
- 'Adaptive', 'Advanced', 'Ameliorated', 'Assimilated', 'Automated', 'Balanced', 'Business-focused',
- 'Centralized', 'Cloned', 'Compatible', 'Configurable', 'Cross-group', 'Cross-platform', 'Customer-focused',
- 'Customizable', 'Decentralized', 'De-engineered', 'Devolved', 'Digitized', 'Distributed', 'Diverse',
- 'Down-sized', 'Enhanced', 'Enterprise-wide', 'Ergonomic', 'Exclusive', 'Expanded', 'Extended', 'Face-to-face',
- 'Focused', 'Front-line', 'Fully-configurable', 'Function-based', 'Fundamental', 'Future-proofed',
- 'Grass-roots', 'Horizontal', 'Implemented', 'Innovative', 'Integrated', 'Intuitive', 'Inverse', 'Managed',
- 'Mandatory', 'Monitored', 'Multi-channeled', 'Multi-lateral', 'Multi-layered', 'Multi-tiered', 'Networked',
- 'Object-based', 'Open-architected', 'Open-source', 'Operative', 'Optimized', 'Optional', 'Organic',
- 'Organized', 'Persevering', 'Persistent', 'Phased', 'Polarized', 'Pre-emptive', 'Proactive',
- 'Profit-focused', 'Profound', 'Programmable', 'Progressive', 'Public-key', 'Quality-focused', 'Reactive',
- 'Realigned', 'Re-contextualized', 'Re-engineered', 'Reduced', 'Reverse-engineered', 'Right-sized', 'Robust',
- 'Seamless', 'Secured', 'Self-enabling', 'Sharable', 'Stand-alone', 'Streamlined', 'Switchable',
- 'Synchronized', 'Synergistic', 'Synergized', 'Team-oriented', 'Total', 'Triple-buffered', 'Universal',
- 'Up-sized', 'Upgradable', 'User-centric', 'User-friendly', 'Versatile', 'Virtual', 'Visionary',
- 'Vision-oriented'
- ),
- (
- '24hour', '24/7', '3rdgeneration', '4thgeneration', '5thgeneration', '6thgeneration', 'actuating',
- 'analyzing', 'asymmetric', 'asynchronous', 'attitude-oriented', 'background', 'bandwidth-monitored',
- 'bi-directional', 'bifurcated', 'bottom-line', 'clear-thinking', 'client-driven', 'client-server',
- 'coherent', 'cohesive', 'composite', 'context-sensitive', 'contextually-based', 'content-based',
- 'dedicated', 'demand-driven', 'didactic', 'directional', 'discrete', 'disintermediate', 'dynamic',
- 'eco-centric', 'empowering', 'encompassing', 'even-keeled', 'executive', 'explicit', 'exuding',
- 'fault-tolerant', 'foreground', 'fresh-thinking', 'full-range', 'global', 'grid-enabled', 'heuristic',
- 'high-level', 'holistic', 'homogeneous', 'human-resource', 'hybrid', 'impactful', 'incremental',
- 'intangible', 'interactive', 'intermediate', 'leadingedge', 'local', 'logistical', 'maximized',
- 'methodical', 'mission-critical', 'mobile', 'modular', 'motivating', 'multimedia', 'multi-state',
- 'multi-tasking', 'national', 'needs-based', 'neutral', 'next generation', 'non-volatile', 'object-oriented',
- 'optimal', 'optimizing', 'radical', 'real-time', 'reciprocal', 'regional', 'responsive', 'scalable',
- 'secondary', 'solution-oriented', 'stable', 'static', 'systematic', 'systemic', 'system-worthy', 'tangible',
- 'tertiary', 'transitional', 'uniform', 'upward-trending', 'user-facing', 'value-added', 'web-enabled',
- 'well-modulated', 'zero administration', 'zero-defect', 'zero tolerance'
- ),
- (
- 'ability', 'access', 'adapter', 'algorithm', 'alliance', 'analyzer', 'application', 'approach',
- 'architecture', 'archive', 'artificial intelligence', 'array', 'attitude', 'benchmark',
- 'budgetary management', 'capability', 'capacity', 'challenge', 'circuit', 'collaboration', 'complexity',
- 'concept', 'conglomeration', 'contingency', 'core', 'customer loyalty', 'database', 'data-warehouse',
- 'definition', 'emulation', 'encoding', 'encryption', 'extranet', 'firmware', 'flexibility', 'focus group',
- 'forecast', 'frame', 'framework', 'function', 'functionalities', 'Graphic Interface', 'groupware',
- 'Graphical User Interface', 'hardware', 'help-desk', 'hierarchy', 'hub', 'implementation', 'info-mediaries',
- 'infrastructure', 'initiative', 'installation', 'instruction set', 'interface', 'Internet solution',
- 'intranet', 'knowledge user', 'knowledgebase', 'Local Area Network', 'leverage', 'matrices', 'matrix',
- 'methodology', 'middleware', 'migration', 'model', 'moderator', 'monitoring', 'moratorium', 'neural-net',
- 'open architecture', 'open system', 'orchestration', 'paradigm', 'parallelism', 'policy', 'portal',
- 'pricing structure', 'process improvement', 'product', 'productivity', 'project', 'projection', 'protocol',
- 'secured line', 'service-desk', 'software', 'solution', 'standardization', 'strategy', 'structure',
- 'success', 'superstructure', 'support', 'synergy', 'system engine', 'task-force', 'throughput', 'time-frame',
- 'toolset', 'utilization', 'website', 'workforce'
- )
- )
+ ('Adaptive',
+ 'Advanced',
+ 'Ameliorated',
+ 'Assimilated',
+ 'Automated',
+ 'Balanced',
+ 'Business-focused',
+ 'Centralized',
+ 'Cloned',
+ 'Compatible',
+ 'Configurable',
+ 'Cross-group',
+ 'Cross-platform',
+ 'Customer-focused',
+ 'Customizable',
+ 'Decentralized',
+ 'De-engineered',
+ 'Devolved',
+ 'Digitized',
+ 'Distributed',
+ 'Diverse',
+ 'Down-sized',
+ 'Enhanced',
+ 'Enterprise-wide',
+ 'Ergonomic',
+ 'Exclusive',
+ 'Expanded',
+ 'Extended',
+ 'Face-to-face',
+ 'Focused',
+ 'Front-line',
+ 'Fully-configurable',
+ 'Function-based',
+ 'Fundamental',
+ 'Future-proofed',
+ 'Grass-roots',
+ 'Horizontal',
+ 'Implemented',
+ 'Innovative',
+ 'Integrated',
+ 'Intuitive',
+ 'Inverse',
+ 'Managed',
+ 'Mandatory',
+ 'Monitored',
+ 'Multi-channeled',
+ 'Multi-lateral',
+ 'Multi-layered',
+ 'Multi-tiered',
+ 'Networked',
+ 'Object-based',
+ 'Open-architected',
+ 'Open-source',
+ 'Operative',
+ 'Optimized',
+ 'Optional',
+ 'Organic',
+ 'Organized',
+ 'Persevering',
+ 'Persistent',
+ 'Phased',
+ 'Polarized',
+ 'Pre-emptive',
+ 'Proactive',
+ 'Profit-focused',
+ 'Profound',
+ 'Programmable',
+ 'Progressive',
+ 'Public-key',
+ 'Quality-focused',
+ 'Reactive',
+ 'Realigned',
+ 'Re-contextualized',
+ 'Re-engineered',
+ 'Reduced',
+ 'Reverse-engineered',
+ 'Right-sized',
+ 'Robust',
+ 'Seamless',
+ 'Secured',
+ 'Self-enabling',
+ 'Sharable',
+ 'Stand-alone',
+ 'Streamlined',
+ 'Switchable',
+ 'Synchronized',
+ 'Synergistic',
+ 'Synergized',
+ 'Team-oriented',
+ 'Total',
+ 'Triple-buffered',
+ 'Universal',
+ 'Up-sized',
+ 'Upgradable',
+ 'User-centric',
+ 'User-friendly',
+ 'Versatile',
+ 'Virtual',
+ 'Visionary',
+ 'Vision-oriented'),
+ ('24hour',
+ '24/7',
+ '3rdgeneration',
+ '4thgeneration',
+ '5thgeneration',
+ '6thgeneration',
+ 'actuating',
+ 'analyzing',
+ 'asymmetric',
+ 'asynchronous',
+ 'attitude-oriented',
+ 'background',
+ 'bandwidth-monitored',
+ 'bi-directional',
+ 'bifurcated',
+ 'bottom-line',
+ 'clear-thinking',
+ 'client-driven',
+ 'client-server',
+ 'coherent',
+ 'cohesive',
+ 'composite',
+ 'context-sensitive',
+ 'contextually-based',
+ 'content-based',
+ 'dedicated',
+ 'demand-driven',
+ 'didactic',
+ 'directional',
+ 'discrete',
+ 'disintermediate',
+ 'dynamic',
+ 'eco-centric',
+ 'empowering',
+ 'encompassing',
+ 'even-keeled',
+ 'executive',
+ 'explicit',
+ 'exuding',
+ 'fault-tolerant',
+ 'foreground',
+ 'fresh-thinking',
+ 'full-range',
+ 'global',
+ 'grid-enabled',
+ 'heuristic',
+ 'high-level',
+ 'holistic',
+ 'homogeneous',
+ 'human-resource',
+ 'hybrid',
+ 'impactful',
+ 'incremental',
+ 'intangible',
+ 'interactive',
+ 'intermediate',
+ 'leadingedge',
+ 'local',
+ 'logistical',
+ 'maximized',
+ 'methodical',
+ 'mission-critical',
+ 'mobile',
+ 'modular',
+ 'motivating',
+ 'multimedia',
+ 'multi-state',
+ 'multi-tasking',
+ 'national',
+ 'needs-based',
+ 'neutral',
+ 'next generation',
+ 'non-volatile',
+ 'object-oriented',
+ 'optimal',
+ 'optimizing',
+ 'radical',
+ 'real-time',
+ 'reciprocal',
+ 'regional',
+ 'responsive',
+ 'scalable',
+ 'secondary',
+ 'solution-oriented',
+ 'stable',
+ 'static',
+ 'systematic',
+ 'systemic',
+ 'system-worthy',
+ 'tangible',
+ 'tertiary',
+ 'transitional',
+ 'uniform',
+ 'upward-trending',
+ 'user-facing',
+ 'value-added',
+ 'web-enabled',
+ 'well-modulated',
+ 'zero administration',
+ 'zero-defect',
+ 'zero tolerance'),
+ ('ability',
+ 'access',
+ 'adapter',
+ 'algorithm',
+ 'alliance',
+ 'analyzer',
+ 'application',
+ 'approach',
+ 'architecture',
+ 'archive',
+ 'artificial intelligence',
+ 'array',
+ 'attitude',
+ 'benchmark',
+ 'budgetary management',
+ 'capability',
+ 'capacity',
+ 'challenge',
+ 'circuit',
+ 'collaboration',
+ 'complexity',
+ 'concept',
+ 'conglomeration',
+ 'contingency',
+ 'core',
+ 'customer loyalty',
+ 'database',
+ 'data-warehouse',
+ 'definition',
+ 'emulation',
+ 'encoding',
+ 'encryption',
+ 'extranet',
+ 'firmware',
+ 'flexibility',
+ 'focus group',
+ 'forecast',
+ 'frame',
+ 'framework',
+ 'function',
+ 'functionalities',
+ 'Graphic Interface',
+ 'groupware',
+ 'Graphical User Interface',
+ 'hardware',
+ 'help-desk',
+ 'hierarchy',
+ 'hub',
+ 'implementation',
+ 'info-mediaries',
+ 'infrastructure',
+ 'initiative',
+ 'installation',
+ 'instruction set',
+ 'interface',
+ 'Internet solution',
+ 'intranet',
+ 'knowledge user',
+ 'knowledgebase',
+ 'Local Area Network',
+ 'leverage',
+ 'matrices',
+ 'matrix',
+ 'methodology',
+ 'middleware',
+ 'migration',
+ 'model',
+ 'moderator',
+ 'monitoring',
+ 'moratorium',
+ 'neural-net',
+ 'open architecture',
+ 'open system',
+ 'orchestration',
+ 'paradigm',
+ 'parallelism',
+ 'policy',
+ 'portal',
+ 'pricing structure',
+ 'process improvement',
+ 'product',
+ 'productivity',
+ 'project',
+ 'projection',
+ 'protocol',
+ 'secured line',
+ 'service-desk',
+ 'software',
+ 'solution',
+ 'standardization',
+ 'strategy',
+ 'structure',
+ 'success',
+ 'superstructure',
+ 'support',
+ 'synergy',
+ 'system engine',
+ 'task-force',
+ 'throughput',
+ 'time-frame',
+ 'toolset',
+ 'utilization',
+ 'website',
+ 'workforce'))
bsWords = (
- (
- 'implement', 'utilize', 'integrate', 'streamline', 'optimize', 'evolve', 'transform', 'embrace', 'enable',
- 'orchestrate', 'leverage', 'reinvent', 'aggregate', 'architect', 'enhance', 'incentivize', 'morph',
- 'empower', 'envisioneer', 'monetize', 'harness', 'facilitate', 'seize', 'disintermediate', 'synergize',
- 'strategize', 'deploy', 'brand', 'grow', 'target', 'syndicate', 'synthesize', 'deliver', 'mesh', 'incubate',
- 'engage', 'maximize', 'benchmark', 'expedite', 're-intermediate', 'whiteboard', 'visualize', 'repurpose',
- 'innovate', 'scale', 'unleash', 'drive', 'extend', 'engineer', 'revolutionize', 'generate', 'exploit',
- 'transition', 'e-enable', 'iterate', 'cultivate', 'matrix', 'productize', 'redefine', 're-contextualize'
- ),
- (
- 'clicks-and-mortar', 'value-added', 'vertical', 'proactive', 'robust', 'revolutionary', 'scalable',
- 'leading-edge', 'innovative', 'intuitive', 'strategic', 'e-business', 'mission-critical', 'sticky',
- 'one-to-one', '24/7', 'end-to-end', 'global', 'B2B', 'B2C', 'granular', 'frictionless', 'virtual', 'viral',
- 'dynamic', '24/365', 'best-of-breed', 'killer', 'magnetic', 'bleeding-edge', 'web-enabled', 'interactive',
- 'dot-com', 'sexy', 'back-end', 'real-time', 'efficient', 'front-end', 'distributed', 'seamless',
- 'extensible', 'turn-key', 'world-class', 'open-source', 'cross-platform', 'cross-media', 'synergistic',
- 'bricks-and-clicks', 'out-of-the-box', 'enterprise', 'integrated', 'impactful', 'wireless', 'transparent',
- 'next-generation', 'cutting-edge', 'user-centric', 'visionary', 'customized', 'ubiquitous', 'plug-and-play',
- 'collaborative', 'compelling', 'holistic', 'rich'
- ),
- (
- 'synergies', 'web-readiness', 'paradigms', 'markets', 'partnerships', 'infrastructures', 'platforms',
- 'initiatives', 'channels', 'eyeballs', 'communities', 'ROI', 'solutions', 'e-tailers', 'e-services',
- 'action-items', 'portals', 'niches', 'technologies', 'content', 'vortals', 'supply-chains', 'convergence',
- 'relationships', 'architectures', 'interfaces', 'e-markets', 'e-commerce', 'systems', 'bandwidth',
- 'info-mediaries', 'models', 'mindshare', 'deliverables', 'users', 'schemas', 'networks', 'applications',
- 'metrics', 'e-business', 'functionalities', 'experiences', 'web services', 'methodologies'
- )
- )
+ ('implement',
+ 'utilize',
+ 'integrate',
+ 'streamline',
+ 'optimize',
+ 'evolve',
+ 'transform',
+ 'embrace',
+ 'enable',
+ 'orchestrate',
+ 'leverage',
+ 'reinvent',
+ 'aggregate',
+ 'architect',
+ 'enhance',
+ 'incentivize',
+ 'morph',
+ 'empower',
+ 'envisioneer',
+ 'monetize',
+ 'harness',
+ 'facilitate',
+ 'seize',
+ 'disintermediate',
+ 'synergize',
+ 'strategize',
+ 'deploy',
+ 'brand',
+ 'grow',
+ 'target',
+ 'syndicate',
+ 'synthesize',
+ 'deliver',
+ 'mesh',
+ 'incubate',
+ 'engage',
+ 'maximize',
+ 'benchmark',
+ 'expedite',
+ 're-intermediate',
+ 'whiteboard',
+ 'visualize',
+ 'repurpose',
+ 'innovate',
+ 'scale',
+ 'unleash',
+ 'drive',
+ 'extend',
+ 'engineer',
+ 'revolutionize',
+ 'generate',
+ 'exploit',
+ 'transition',
+ 'e-enable',
+ 'iterate',
+ 'cultivate',
+ 'matrix',
+ 'productize',
+ 'redefine',
+ 're-contextualize'),
+ ('clicks-and-mortar',
+ 'value-added',
+ 'vertical',
+ 'proactive',
+ 'robust',
+ 'revolutionary',
+ 'scalable',
+ 'leading-edge',
+ 'innovative',
+ 'intuitive',
+ 'strategic',
+ 'e-business',
+ 'mission-critical',
+ 'sticky',
+ 'one-to-one',
+ '24/7',
+ 'end-to-end',
+ 'global',
+ 'B2B',
+ 'B2C',
+ 'granular',
+ 'frictionless',
+ 'virtual',
+ 'viral',
+ 'dynamic',
+ '24/365',
+ 'best-of-breed',
+ 'killer',
+ 'magnetic',
+ 'bleeding-edge',
+ 'web-enabled',
+ 'interactive',
+ 'dot-com',
+ 'sexy',
+ 'back-end',
+ 'real-time',
+ 'efficient',
+ 'front-end',
+ 'distributed',
+ 'seamless',
+ 'extensible',
+ 'turn-key',
+ 'world-class',
+ 'open-source',
+ 'cross-platform',
+ 'cross-media',
+ 'synergistic',
+ 'bricks-and-clicks',
+ 'out-of-the-box',
+ 'enterprise',
+ 'integrated',
+ 'impactful',
+ 'wireless',
+ 'transparent',
+ 'next-generation',
+ 'cutting-edge',
+ 'user-centric',
+ 'visionary',
+ 'customized',
+ 'ubiquitous',
+ 'plug-and-play',
+ 'collaborative',
+ 'compelling',
+ 'holistic',
+ 'rich'),
+ ('synergies',
+ 'web-readiness',
+ 'paradigms',
+ 'markets',
+ 'partnerships',
+ 'infrastructures',
+ 'platforms',
+ 'initiatives',
+ 'channels',
+ 'eyeballs',
+ 'communities',
+ 'ROI',
+ 'solutions',
+ 'e-tailers',
+ 'e-services',
+ 'action-items',
+ 'portals',
+ 'niches',
+ 'technologies',
+ 'content',
+ 'vortals',
+ 'supply-chains',
+ 'convergence',
+ 'relationships',
+ 'architectures',
+ 'interfaces',
+ 'e-markets',
+ 'e-commerce',
+ 'systems',
+ 'bandwidth',
+ 'info-mediaries',
+ 'models',
+ 'mindshare',
+ 'deliverables',
+ 'users',
+ 'schemas',
+ 'networks',
+ 'applications',
+ 'metrics',
+ 'e-business',
+ 'functionalities',
+ 'experiences',
+ 'web services',
+ 'methodologies'))
def company(self):
"""
diff --git a/src/libs/faker/providers/company/bg_BG/__init__.py b/src/libs/faker/providers/company/bg_BG/__init__.py
index 0105aa2..6ea9f10 100644
--- a/src/libs/faker/providers/company/bg_BG/__init__.py
+++ b/src/libs/faker/providers/company/bg_BG/__init__.py
@@ -19,5 +19,5 @@ class Provider(CompanyProvider):
'OOD', 'ООД',
'KD', 'КД',
'KDA', 'КДА',
- 'SD', 'СД'
+ 'SD', 'СД',
)
diff --git a/src/libs/faker/providers/company/es_MX/__init__.py b/src/libs/faker/providers/company/es_MX/__init__.py
index bd63d50..f5a8d2f 100644
--- a/src/libs/faker/providers/company/es_MX/__init__.py
+++ b/src/libs/faker/providers/company/es_MX/__init__.py
@@ -12,36 +12,36 @@ class Provider(CompanyProvider):
'{{company_prefix}} {{last_name}}, {{last_name}} y {{last_name}}',
'{{last_name}}-{{last_name}} {{company_suffix}}',
'{{last_name}}, {{last_name}} y {{last_name}}',
- '{{last_name}} y {{last_name}} {{company_suffix}}'
+ '{{last_name}} y {{last_name}} {{company_suffix}}',
)
catch_phrase_words = (
(
- "habilidad", "acceso", "adaptador", "algoritmo", "alianza",
- "analista", "aplicación", "enfoque", "arquitectura",
- "archivo", "inteligencia artificial", "array", "actitud",
- "medición", "gestión presupuestaria", "capacidad", "desafío",
- "circuito", "colaboración", "complejidad", "concepto",
- "conglomeración", "contingencia", "núcleo", "fidelidad",
- "base de datos", "data-warehouse", "definición", "emulación",
- "codificar", "encriptar", "extranet", "firmware",
- "flexibilidad", "focus group", "previsión", "base de trabajo",
- "función", "funcionalidad", "interfaz gráfica", "groupware",
- "interfaz gráfico de usuario", "hardware", "soporte", "jerarquía",
- "conjunto", "implementación", "infraestructura", "iniciativa",
- "instalación", "conjunto de instrucciones", "interfaz",
- "intranet", "base del conocimiento", "red de area local",
- "aprovechar", "matrices", "metodologías", "middleware",
- "migración", "modelo", "moderador", "monitorizar",
- "arquitectura abierta", "sistema abierto", "orquestar",
- "paradigma", "paralelismo", "política", "portal",
- "estructura de precios", "proceso de mejora",
- "producto", "productividad", "proyecto", "proyección",
- "protocolo", "línea segura", "software", "solución",
- "estandarización", "estrategia", "estructura", "éxito",
- "superestructura", "soporte", "sinergia", "mediante",
- "marco de tiempo", "caja de herramientas", "utilización",
- "website", "fuerza de trabajo"),
+ "habilidad", "acceso", "adaptador", "algoritmo", "alianza",
+ "analista", "aplicación", "enfoque", "arquitectura",
+ "archivo", "inteligencia artificial", "array", "actitud",
+ "medición", "gestión presupuestaria", "capacidad", "desafío",
+ "circuito", "colaboración", "complejidad", "concepto",
+ "conglomeración", "contingencia", "núcleo", "fidelidad",
+ "base de datos", "data-warehouse", "definición", "emulación",
+ "codificar", "encriptar", "extranet", "firmware",
+ "flexibilidad", "focus group", "previsión", "base de trabajo",
+ "función", "funcionalidad", "interfaz gráfica", "groupware",
+ "interfaz gráfico de usuario", "hardware", "soporte", "jerarquía",
+ "conjunto", "implementación", "infraestructura", "iniciativa",
+ "instalación", "conjunto de instrucciones", "interfaz",
+ "intranet", "base del conocimiento", "red de area local",
+ "aprovechar", "matrices", "metodologías", "middleware",
+ "migración", "modelo", "moderador", "monitorizar",
+ "arquitectura abierta", "sistema abierto", "orquestar",
+ "paradigma", "paralelismo", "política", "portal",
+ "estructura de precios", "proceso de mejora",
+ "producto", "productividad", "proyecto", "proyección",
+ "protocolo", "línea segura", "software", "solución",
+ "estandarización", "estrategia", "estructura", "éxito",
+ "superestructura", "soporte", "sinergia", "mediante",
+ "marco de tiempo", "caja de herramientas", "utilización",
+ "website", "fuerza de trabajo"),
(
"24 horas", "24/7", "3ra generación", "4ta generación",
"5ta generación", "6ta generación", "analizada",
@@ -65,7 +65,7 @@ class Provider(CompanyProvider):
"escalable", "secundaria", "orientada a soluciones",
"estable", "estática", "sistemática", "sistémica",
"tangible", "terciaria", "transicional", "uniforme",
- "valor añadido", "vía web", "defectos cero", "tolerancia cero"
+ "valor añadido", "vía web", "defectos cero", "tolerancia cero",
),
(
'adaptativo', 'avanzado', 'asimilado', 'automatizado',
@@ -91,7 +91,7 @@ class Provider(CompanyProvider):
'sincronizado', 'orientado a equipos', 'total',
'universal', 'actualizable', 'centrado en el usuario',
'versátil', 'virtual', 'visionario',
- )
+ ),
)
bsWords = (
@@ -100,7 +100,7 @@ class Provider(CompanyProvider):
'evoluciona', 'transforma', 'abraza', 'habilita',
'orquesta', 'reinventa', 'agrega', 'mejora', 'incentiva',
'modifica', 'empodera', 'monetiza', 'fortalece',
- 'facilita', 'sinergiza', 'crea marca', 'crece',
+ 'facilita', 'sinergiza', 'crea marca', 'crece',
'sintetiza', 'entrega', 'mezcla', 'incuba', 'compromete',
'maximiza', 'visualiza', 'innova',
'escala', 'libera', 'maneja', 'extiende', 'revoluciona',
@@ -117,7 +117,7 @@ class Provider(CompanyProvider):
'sistemas', 'ancho de banda', 'modelos', 'entregables',
'usuarios', 'esquemas', 'redes', 'aplicaciones', 'métricas',
'funcionalidades', 'experiencias', 'servicios web',
- 'metodologías'
+ 'metodologías',
),
(
'valor agregado', 'verticales', 'proactivas', 'robustas',
@@ -133,7 +133,7 @@ class Provider(CompanyProvider):
'integrado', 'impacto total', 'inalámbrica', 'transparentes',
'de siguiente generación', 'lo último', 'centrado al usuario',
'visionarias', 'personalizado', 'ubicuas', 'plug-and-play',
- 'colaborativas', 'holísticas', 'ricas'
+ 'colaborativas', 'holísticas', 'ricas',
),
)
@@ -141,7 +141,7 @@ class Provider(CompanyProvider):
'Industrias', 'Laboratorios', 'Proyectos')
company_suffixes = ('A.C.', 'S.A.', 'S.A. de C.V.', 'S.C.',
- 'S. R.L. de C.V.','e Hijos', 'y Asociados')
+ 'S. R.L. de C.V.', 'e Hijos', 'y Asociados')
def company_prefix(self):
"""
diff --git a/src/libs/faker/providers/company/fa_IR/__init__.py b/src/libs/faker/providers/company/fa_IR/__init__.py
index a0464d8..624de2e 100644
--- a/src/libs/faker/providers/company/fa_IR/__init__.py
+++ b/src/libs/faker/providers/company/fa_IR/__init__.py
@@ -1114,4 +1114,4 @@ class Provider(CompanyProvider):
]
def company(self):
- return self.random_element(self.company_names)
\ No newline at end of file
+ return self.random_element(self.company_names)
diff --git a/src/libs/faker/providers/company/fi_FI/__init__.py b/src/libs/faker/providers/company/fi_FI/__init__.py
index d2e3887..fb77911 100644
--- a/src/libs/faker/providers/company/fi_FI/__init__.py
+++ b/src/libs/faker/providers/company/fi_FI/__init__.py
@@ -7,11 +7,11 @@ class Provider(CompanyProvider):
'{{last_name}} {{company_suffix}}',
'{{last_name}} {{last_name}} {{company_suffix}}',
'{{last_name}} {{last_name}} {{company_suffix}}',
- '{{last_name}}'
+ '{{last_name}}',
)
company_suffixes = (
- 'As Oy', 'Tmi', 'Oy', 'Oyj', 'Ky', 'Osk', 'ry'
+ 'As Oy', 'Tmi', 'Oy', 'Oyj', 'Ky', 'Osk', 'ry',
)
def company_business_id(self):
@@ -25,18 +25,18 @@ def company_business_id(self):
def calculate_checksum(number):
"""Calculate the checksum using mod 11,2 method"""
factors = [7, 9, 10, 5, 8, 4, 2]
- sum = 0
+ sum_ = 0
for x, y in zip(number, factors):
- sum = sum + int(x) * y
- if sum % 11 == 0:
+ sum_ = sum_ + int(x) * y
+ if sum_ % 11 == 0:
return '0'
else:
- return str(11 - sum % 11)
+ return str(11 - sum_ % 11)
first_digit = str(self.random_digit_not_null())
- body = first_digit + self.bothify(self.random_element(('######',)))
+ body = first_digit + self.bothify('######')
cs = calculate_checksum(body)
- return (body + '-' + str(cs))
+ return body + '-' + str(cs)
def company_vat(self):
"""
diff --git a/src/libs/faker/providers/company/fr_CH/__init__.py b/src/libs/faker/providers/company/fr_CH/__init__.py
index 6c1cafe..a4a66c1 100644
--- a/src/libs/faker/providers/company/fr_CH/__init__.py
+++ b/src/libs/faker/providers/company/fr_CH/__init__.py
@@ -13,19 +13,19 @@ def ide(self):
"""
def _checksum(digits):
factors = (5, 4, 3, 2, 7, 6, 5, 4)
- sum = 0
+ sum_ = 0
for i in range(len(digits)):
- sum += digits[i] * factors[i]
- return sum % 11
+ sum_ += digits[i] * factors[i]
+ return sum_ % 11
while True:
# create an array of first 8 elements initialized randomly
digits = self.generator.random.sample(range(10), 8)
# sum those 8 digits according to (part of) the "modulo 11"
- sum = _checksum(digits)
+ sum_ = _checksum(digits)
# determine the last digit to make it qualify the test
- control_number = 11 - sum
- if (control_number != 10):
+ control_number = 11 - sum_
+ if control_number != 10:
digits.append(control_number)
break
diff --git a/src/libs/faker/providers/company/fr_FR/__init__.py b/src/libs/faker/providers/company/fr_FR/__init__.py
index 3a0a2f2..9d4adce 100644
--- a/src/libs/faker/providers/company/fr_FR/__init__.py
+++ b/src/libs/faker/providers/company/fr_FR/__init__.py
@@ -12,24 +12,46 @@ class Provider(CompanyProvider):
)
catch_phrase_formats = (
- '{{catch_phrase_noun}} {{catch_phrase_verb}} {{catch_phrase_attribute}}',
- )
+ '{{catch_phrase_noun}} {{catch_phrase_verb}} {{catch_phrase_attribute}}', )
nouns = (
- 'la sécurité', 'le plaisir', 'le confort', 'la simplicité', "l'assurance", "l'art", 'le pouvoir', 'le droit',
- 'la possibilité', "l'avantage", 'la liberté'
- )
+ 'la sécurité',
+ 'le plaisir',
+ 'le confort',
+ 'la simplicité',
+ "l'assurance",
+ "l'art",
+ 'le pouvoir',
+ 'le droit',
+ 'la possibilité',
+ "l'avantage",
+ 'la liberté')
verbs = (
- 'de rouler', "d'avancer", "d'évoluer", 'de changer', "d'innover", 'de louer', "d'atteindre vos buts",
- 'de concrétiser vos projets'
- )
+ 'de rouler',
+ "d'avancer",
+ "d'évoluer",
+ 'de changer',
+ "d'innover",
+ 'de louer',
+ "d'atteindre vos buts",
+ 'de concrétiser vos projets')
attributes = (
- 'de manière efficace', 'plus rapidement', 'plus facilement', 'plus simplement', 'en toute tranquilité',
- 'avant-tout', 'autrement', 'naturellement', 'à la pointe', 'sans soucis', "à l'état pur",
- 'à sa source', 'de manière sûre', 'en toute sécurité'
- )
+ 'de manière efficace',
+ 'plus rapidement',
+ 'plus facilement',
+ 'plus simplement',
+ 'en toute tranquilité',
+ 'avant-tout',
+ 'autrement',
+ 'naturellement',
+ 'à la pointe',
+ 'sans soucis',
+ "à l'état pur",
+ 'à sa source',
+ 'de manière sûre',
+ 'en toute sécurité')
company_suffixes = ('SA', 'S.A.', 'SARL', 'S.A.R.L.', 'S.A.S.', 'et Fils')
@@ -83,7 +105,8 @@ def _is_catch_phrase_valid(self, catch_phrase):
begin_pos = catch_phrase.find(word)
end_pos = catch_phrase.find(word, begin_pos + 1)
- if begin_pos != -1 and begin_pos != end_pos: return False
+ if begin_pos != -1 and begin_pos != end_pos:
+ return False
return True
@@ -104,5 +127,6 @@ def siret(self, max_sequential_digits=2):
if max_sequential_digits > 4 or max_sequential_digits <= 0:
max_sequential_digits = 2
- sequential_number = str(self.random_number(max_sequential_digits)).zfill(4)
+ sequential_number = str(self.random_number(
+ max_sequential_digits)).zfill(4)
return self.numerify(self.siren() + ' ' + sequential_number + '#')
diff --git a/src/libs/faker/providers/company/hr_HR/__init__.py b/src/libs/faker/providers/company/hr_HR/__init__.py
index 7fd2eb0..46ef249 100644
--- a/src/libs/faker/providers/company/hr_HR/__init__.py
+++ b/src/libs/faker/providers/company/hr_HR/__init__.py
@@ -10,5 +10,5 @@ class Provider(CompanyProvider):
)
company_suffixes = (
- 'd.o.o.', 'd.d.', 'j.d.o.o.'
+ 'd.o.o.', 'd.d.', 'j.d.o.o.',
)
diff --git a/src/libs/faker/providers/company/hu_HU/__init__.py b/src/libs/faker/providers/company/hu_HU/__init__.py
index 879c3f2..aadfa28 100644
--- a/src/libs/faker/providers/company/hu_HU/__init__.py
+++ b/src/libs/faker/providers/company/hu_HU/__init__.py
@@ -9,7 +9,7 @@ class Provider(CompanyProvider):
'{{last_name}} {{company_suffix}}',
'{{last_name}} {{last_name}} {{company_suffix}}',
'{{last_name}} és {{last_name}} {{company_suffix}}',
- '{{last_name}} és társa {{company_suffix}}'
+ '{{last_name}} és társa {{company_suffix}}',
)
company_suffixes = ('Kft.', 'Kht.', 'Zrt.', 'Bt.', 'Nyrt.', 'Kkt.')
diff --git a/src/libs/faker/providers/company/id_ID/__init__.py b/src/libs/faker/providers/company/id_ID/__init__.py
index ed373d7..9b5d8b3 100644
--- a/src/libs/faker/providers/company/id_ID/__init__.py
+++ b/src/libs/faker/providers/company/id_ID/__init__.py
@@ -11,13 +11,15 @@ class Provider(CompanyProvider):
)
# From http://id.wikipedia.org/wiki/Jenis_badan_usaha
- # via https://github.com/fzaninotto/faker/blob/master/src/Faker/Provider/id_ID/Company.php
+ # via
+ # https://github.com/fzaninotto/faker/blob/master/src/Faker/Provider/id_ID/Company.php
company_prefixes = (
'PT', 'CV', 'UD', 'PD', 'Perum',
)
# From http://id.wikipedia.org/wiki/Jenis_badan_usaha
- # via https://github.com/fzaninotto/faker/blob/master/src/Faker/Provider/id_ID/Company.php
+ # via
+ # https://github.com/fzaninotto/faker/blob/master/src/Faker/Provider/id_ID/Company.php
company_suffixes = (
'(Persero) Tbk', 'Tbk',
)
diff --git a/src/libs/faker/providers/company/it_IT/__init__.py b/src/libs/faker/providers/company/it_IT/__init__.py
index 5633649..51ce63d 100644
--- a/src/libs/faker/providers/company/it_IT/__init__.py
+++ b/src/libs/faker/providers/company/it_IT/__init__.py
@@ -7,71 +7,328 @@ class Provider(CompanyProvider):
formats = (
'{{last_name}} {{company_suffix}}',
'{{last_name}}-{{last_name}} {{company_suffix}}',
- '{{last_name}}, {{last_name}} e {{last_name}} {{company_suffix}}'
+ '{{last_name}}, {{last_name}} e {{last_name}} {{company_suffix}}',
)
catch_phrase_words = (
- (
- 'Abilità', 'Access', 'Adattatore', 'Algoritmo', 'Alleanza', 'Analizzatore', 'Applicazione', 'Approccio',
- 'Architettura', 'Archivio', 'Intelligenza artificiale', 'Array', 'Attitudine', 'Benchmark', 'Capacità',
- 'Sfida', 'Circuito', 'Collaborazione', 'Complessità', 'Concetto', 'Conglomerato', 'Contingenza', 'Core',
- 'Database', 'Data-warehouse', 'Definizione', 'Emulazione', 'Codifica', 'Criptazione', 'Firmware',
- 'Flessibilità', 'Previsione', 'Frame', 'framework', 'Funzione', 'Funzionalità', 'Interfaccia grafica',
- 'Hardware', 'Help-desk', 'Gerarchia', 'Hub', 'Implementazione', 'Infrastruttura', 'Iniziativa',
- 'Installazione', 'Set di istruzioni', 'Interfaccia', 'Soluzione internet', 'Intranet', 'Conoscenza base',
- 'Matrici', 'Matrice', 'Metodologia', 'Middleware', 'Migrazione', 'Modello', 'Moderazione', 'Monitoraggio',
- 'Moratoria', 'Rete', 'Architettura aperta', 'Sistema aperto', 'Orchestrazione', 'Paradigma', 'Parallelismo',
- 'Policy', 'Portale', 'Struttura di prezzo', 'Prodotto', 'Produttività', 'Progetto', 'Proiezione',
- 'Protocollo', 'Servizio clienti', 'Software', 'Soluzione', 'Standardizzazione', 'Strategia', 'Struttura',
- 'Successo', 'Sovrastruttura', 'Supporto', 'Sinergia', 'Task-force', 'Finestra temporale', 'Strumenti',
- 'Utilizzazione', 'Sito web', 'Forza lavoro'
- ),
- (
- 'adattiva', 'avanzata', 'migliorata', 'assimilata', 'automatizzata', 'bilanciata', 'centralizzata',
- 'compatibile', 'configurabile', 'cross-platform', 'decentralizzata', 'digitalizzata', 'distribuita',
- 'piccola', 'ergonomica', 'esclusiva', 'espansa', 'estesa', 'configurabile', 'fondamentale', 'orizzontale',
- 'implementata', 'innovativa', 'integrata', 'intuitiva', 'inversa', 'gestita', 'obbligatoria', 'monitorata',
- 'multi-canale', 'multi-laterale', 'open-source', 'operativa', 'ottimizzata', 'organica', 'persistente',
- 'polarizzata', 'proattiva', 'programmabile', 'progressiva', 'reattiva', 'riallineata', 'ricontestualizzata',
- 'ridotta', 'robusta', 'sicura', 'condivisibile', 'stand-alone', 'switchabile', 'sincronizzata', 'sinergica',
- 'totale', 'universale', 'user-friendly', 'versatile', 'virtuale', 'visionaria'
- ),
- (
- '24 ore', '24/7', 'terza generazione', 'quarta generazione', 'quinta generazione', 'sesta generazione',
- 'asimmetrica', 'asincrona', 'background', 'bi-direzionale', 'biforcata', 'bottom-line', 'coerente',
- 'coesiva', 'composita', 'sensibile al contesto', 'basta sul contesto', 'basata sul contenuto', 'dedicata',
- 'didattica', 'direzionale', 'discreta', 'dinamica', 'eco-centrica', 'esecutiva', 'esplicita', 'full-range',
- 'globale', 'euristica', 'alto livello', 'olistica', 'omogenea', 'ibrida', 'impattante', 'incrementale',
- 'intangibile', 'interattiva', 'intermediaria', 'locale', 'logistica', 'massimizzata', 'metodica',
- 'mission-critical', 'mobile', 'modulare', 'motivazionale', 'multimedia', 'multi-tasking', 'nazionale',
- 'neutrale', 'nextgeneration', 'non-volatile', 'object-oriented', 'ottima', 'ottimizzante', 'radicale',
- 'real-time', 'reciproca', 'regionale', 'responsiva', 'scalabile', 'secondaria', 'stabile', 'statica',
- 'sistematica', 'sistemica', 'tangibile', 'terziaria', 'uniforme', 'valore aggiunto'
- )
- )
+ ('Abilità',
+ 'Access',
+ 'Adattatore',
+ 'Algoritmo',
+ 'Alleanza',
+ 'Analizzatore',
+ 'Applicazione',
+ 'Approccio',
+ 'Architettura',
+ 'Archivio',
+ 'Intelligenza artificiale',
+ 'Array',
+ 'Attitudine',
+ 'Benchmark',
+ 'Capacità',
+ 'Sfida',
+ 'Circuito',
+ 'Collaborazione',
+ 'Complessità',
+ 'Concetto',
+ 'Conglomerato',
+ 'Contingenza',
+ 'Core',
+ 'Database',
+ 'Data-warehouse',
+ 'Definizione',
+ 'Emulazione',
+ 'Codifica',
+ 'Criptazione',
+ 'Firmware',
+ 'Flessibilità',
+ 'Previsione',
+ 'Frame',
+ 'framework',
+ 'Funzione',
+ 'Funzionalità',
+ 'Interfaccia grafica',
+ 'Hardware',
+ 'Help-desk',
+ 'Gerarchia',
+ 'Hub',
+ 'Implementazione',
+ 'Infrastruttura',
+ 'Iniziativa',
+ 'Installazione',
+ 'Set di istruzioni',
+ 'Interfaccia',
+ 'Soluzione internet',
+ 'Intranet',
+ 'Conoscenza base',
+ 'Matrici',
+ 'Matrice',
+ 'Metodologia',
+ 'Middleware',
+ 'Migrazione',
+ 'Modello',
+ 'Moderazione',
+ 'Monitoraggio',
+ 'Moratoria',
+ 'Rete',
+ 'Architettura aperta',
+ 'Sistema aperto',
+ 'Orchestrazione',
+ 'Paradigma',
+ 'Parallelismo',
+ 'Policy',
+ 'Portale',
+ 'Struttura di prezzo',
+ 'Prodotto',
+ 'Produttività',
+ 'Progetto',
+ 'Proiezione',
+ 'Protocollo',
+ 'Servizio clienti',
+ 'Software',
+ 'Soluzione',
+ 'Standardizzazione',
+ 'Strategia',
+ 'Struttura',
+ 'Successo',
+ 'Sovrastruttura',
+ 'Supporto',
+ 'Sinergia',
+ 'Task-force',
+ 'Finestra temporale',
+ 'Strumenti',
+ 'Utilizzazione',
+ 'Sito web',
+ 'Forza lavoro'),
+ ('adattiva',
+ 'avanzata',
+ 'migliorata',
+ 'assimilata',
+ 'automatizzata',
+ 'bilanciata',
+ 'centralizzata',
+ 'compatibile',
+ 'configurabile',
+ 'cross-platform',
+ 'decentralizzata',
+ 'digitalizzata',
+ 'distribuita',
+ 'piccola',
+ 'ergonomica',
+ 'esclusiva',
+ 'espansa',
+ 'estesa',
+ 'configurabile',
+ 'fondamentale',
+ 'orizzontale',
+ 'implementata',
+ 'innovativa',
+ 'integrata',
+ 'intuitiva',
+ 'inversa',
+ 'gestita',
+ 'obbligatoria',
+ 'monitorata',
+ 'multi-canale',
+ 'multi-laterale',
+ 'open-source',
+ 'operativa',
+ 'ottimizzata',
+ 'organica',
+ 'persistente',
+ 'polarizzata',
+ 'proattiva',
+ 'programmabile',
+ 'progressiva',
+ 'reattiva',
+ 'riallineata',
+ 'ricontestualizzata',
+ 'ridotta',
+ 'robusta',
+ 'sicura',
+ 'condivisibile',
+ 'stand-alone',
+ 'switchabile',
+ 'sincronizzata',
+ 'sinergica',
+ 'totale',
+ 'universale',
+ 'user-friendly',
+ 'versatile',
+ 'virtuale',
+ 'visionaria'),
+ ('24 ore',
+ '24/7',
+ 'terza generazione',
+ 'quarta generazione',
+ 'quinta generazione',
+ 'sesta generazione',
+ 'asimmetrica',
+ 'asincrona',
+ 'background',
+ 'bi-direzionale',
+ 'biforcata',
+ 'bottom-line',
+ 'coerente',
+ 'coesiva',
+ 'composita',
+ 'sensibile al contesto',
+ 'basta sul contesto',
+ 'basata sul contenuto',
+ 'dedicata',
+ 'didattica',
+ 'direzionale',
+ 'discreta',
+ 'dinamica',
+ 'eco-centrica',
+ 'esecutiva',
+ 'esplicita',
+ 'full-range',
+ 'globale',
+ 'euristica',
+ 'alto livello',
+ 'olistica',
+ 'omogenea',
+ 'ibrida',
+ 'impattante',
+ 'incrementale',
+ 'intangibile',
+ 'interattiva',
+ 'intermediaria',
+ 'locale',
+ 'logistica',
+ 'massimizzata',
+ 'metodica',
+ 'mission-critical',
+ 'mobile',
+ 'modulare',
+ 'motivazionale',
+ 'multimedia',
+ 'multi-tasking',
+ 'nazionale',
+ 'neutrale',
+ 'nextgeneration',
+ 'non-volatile',
+ 'object-oriented',
+ 'ottima',
+ 'ottimizzante',
+ 'radicale',
+ 'real-time',
+ 'reciproca',
+ 'regionale',
+ 'responsiva',
+ 'scalabile',
+ 'secondaria',
+ 'stabile',
+ 'statica',
+ 'sistematica',
+ 'sistemica',
+ 'tangibile',
+ 'terziaria',
+ 'uniforme',
+ 'valore aggiunto'))
bsWords = (
- (
- 'partnerships', 'comunità', 'ROI', 'soluzioni', 'e-services', 'nicchie', 'tecnologie', 'contenuti',
- 'supply-chains', 'convergenze', 'relazioni', 'architetture', 'interfacce', 'mercati', 'e-commerce',
- 'sistemi', 'modelli', 'schemi', 'reti', 'applicazioni', 'metriche', 'e-business', 'funzionalità',
- 'esperienze', 'webservices', 'metodologie'
- ),
- (
- 'implementate', 'utilizzo', 'integrate', 'ottimali', 'evolutive', 'abilitate', 'reinventate', 'aggregate',
- 'migliorate', 'incentivate', 'monetizzate', 'sinergizzate', 'strategiche', 'deploy', 'marchi',
- 'accrescitive', 'target', 'sintetizzate', 'spedizioni', 'massimizzate', 'innovazione', 'guida',
- 'estensioni', 'generate', 'exploit', 'transizionali', 'matrici', 'ricontestualizzate'
- ),
- (
- 'valore aggiunto', 'verticalizzate', 'proattive', 'forti', 'rivoluzionari', 'scalabili', 'innovativi',
- 'intuitivi', 'strategici', 'e-business', 'mission-critical', '24/7', 'globali', 'B2B', 'B2C', 'granulari',
- 'virtuali', 'virali', 'dinamiche', 'magnetiche', 'web', 'interattive', 'sexy', 'back-end', 'real-time',
- 'efficienti', 'front-end', 'distributivi', 'estensibili', 'mondiali', 'open-source', 'cross-platform',
- 'sinergiche', 'out-of-the-box', 'enterprise', 'integrate', 'di impatto', 'wireless', 'trasparenti',
- 'next-generation', 'cutting-edge', 'visionari', 'plug-and-play', 'collaborative', 'olistiche', 'ricche'
- )
- )
+ ('partnerships',
+ 'comunità',
+ 'ROI',
+ 'soluzioni',
+ 'e-services',
+ 'nicchie',
+ 'tecnologie',
+ 'contenuti',
+ 'supply-chains',
+ 'convergenze',
+ 'relazioni',
+ 'architetture',
+ 'interfacce',
+ 'mercati',
+ 'e-commerce',
+ 'sistemi',
+ 'modelli',
+ 'schemi',
+ 'reti',
+ 'applicazioni',
+ 'metriche',
+ 'e-business',
+ 'funzionalità',
+ 'esperienze',
+ 'webservices',
+ 'metodologie'),
+ ('implementate',
+ 'utilizzo',
+ 'integrate',
+ 'ottimali',
+ 'evolutive',
+ 'abilitate',
+ 'reinventate',
+ 'aggregate',
+ 'migliorate',
+ 'incentivate',
+ 'monetizzate',
+ 'sinergizzate',
+ 'strategiche',
+ 'deploy',
+ 'marchi',
+ 'accrescitive',
+ 'target',
+ 'sintetizzate',
+ 'spedizioni',
+ 'massimizzate',
+ 'innovazione',
+ 'guida',
+ 'estensioni',
+ 'generate',
+ 'exploit',
+ 'transizionali',
+ 'matrici',
+ 'ricontestualizzate'),
+ ('valore aggiunto',
+ 'verticalizzate',
+ 'proattive',
+ 'forti',
+ 'rivoluzionari',
+ 'scalabili',
+ 'innovativi',
+ 'intuitivi',
+ 'strategici',
+ 'e-business',
+ 'mission-critical',
+ '24/7',
+ 'globali',
+ 'B2B',
+ 'B2C',
+ 'granulari',
+ 'virtuali',
+ 'virali',
+ 'dinamiche',
+ 'magnetiche',
+ 'web',
+ 'interattive',
+ 'sexy',
+ 'back-end',
+ 'real-time',
+ 'efficienti',
+ 'front-end',
+ 'distributivi',
+ 'estensibili',
+ 'mondiali',
+ 'open-source',
+ 'cross-platform',
+ 'sinergiche',
+ 'out-of-the-box',
+ 'enterprise',
+ 'integrate',
+ 'di impatto',
+ 'wireless',
+ 'trasparenti',
+ 'next-generation',
+ 'cutting-edge',
+ 'visionari',
+ 'plug-and-play',
+ 'collaborative',
+ 'olistiche',
+ 'ricche'))
company_suffixes = ('SPA', 'e figli', 'Group', 's.r.l.')
diff --git a/src/libs/faker/providers/company/ja_JP/__init__.py b/src/libs/faker/providers/company/ja_JP/__init__.py
index 649fafa..b650fb0 100644
--- a/src/libs/faker/providers/company/ja_JP/__init__.py
+++ b/src/libs/faker/providers/company/ja_JP/__init__.py
@@ -5,10 +5,15 @@
class Provider(CompanyProvider):
formats = (
- '{{company_prefix}} {{last_name}}',
+ '{{company_prefix}}{{last_name}}{{company_category}}',
+ '{{last_name}}{{company_category}}{{company_prefix}}',
)
company_prefixes = ('株式会社', '有限会社', '合同会社')
+ company_categories = ('水産', '農林', '鉱業', '建設', '食品', '印刷', '電気', 'ガス', '情報', '通信', '運輸', '銀行', '保険')
def company_prefix(self):
return self.random_element(self.company_prefixes)
+
+ def company_category(self):
+ return self.random_element(self.company_categories)
diff --git a/src/libs/faker/providers/company/ko_KR/__init__.py b/src/libs/faker/providers/company/ko_KR/__init__.py
index cdb9555..7a279ba 100644
--- a/src/libs/faker/providers/company/ko_KR/__init__.py
+++ b/src/libs/faker/providers/company/ko_KR/__init__.py
@@ -3,75 +3,360 @@
from __future__ import unicode_literals
from .. import Provider as CompanyProvider
+
class Provider(CompanyProvider):
formats = (
'{{company_suffix}} {{last_name}}{{last_name}}{{last_name}}',
'{{company_suffix}} {{last_name}}',
'{{last_name}}{{last_name}}',
- '{{last_name}}{{last_name}}{{last_name}}'
+ '{{last_name}}{{last_name}}{{last_name}}',
)
catch_phrase_words = (
- (
- '적응된', '숙련된', '자동화된', '안정적인', '비즈니스 중점적', '중심이', '복제된', '효율적인',
- '설정 가능한', '크로스 그룹', '크로스 플랫폼', '사용자 중심의', '조절 가능한', '디지털화된', '출판된',
- '다양한', '낮은', '강화된', '인체 공학적인', '특별한', '확장된', '확대된', '1:1', '최전방',
- '완벽히 설정된', '함수 기반의', '미래가 보장된', '관리된', '모니터링되는', '멀티 채널', '다중 주파수',
- '멀티 레이어', '조직화된', '객체 기반의', '공개 아키텍쳐', '오픈소스', '최적화된', '선택적', '유기농',
- '수익에 중점을 둔', '프로그래밍 가능한', '진보적인', '공개 키', '품질 중심의', '반동적인',
- '재정렬', '줄어든', '리버스 엔지니어링된', '올바른 사이즈의', '강력한', '원활한', '안전한',
- '자가 이용 가능한', '공유 가능한', '독보적인', '무결점의', '변경 가능한', '동기화', '융합력있는',
- '융합된', '단체 기반의', '총', '트리플 버퍼', '다용도', '더 커진', '업그레이드 가능한', '더 작아진',
- '유저 친화적', '가상', '비전 있는'
- ),
- (
- '24시간', '24/7', '3세대', '4세대', '5세대', '6세대', '작동',
- '분석중인', '비대칭', '비동기', '고도 기반', '백그라운드', '주파수 탐지 가능', '요약',
- '클라이언트 단', '클라이언트-서버', '밀착', '결합된', '합성물', '상황에 맞는',
- '문맥 기반', '컨텐츠 기반', '헌신적', '교훈적', '방향', '분리된', '다이나믹', '환경 친화적',
- '실행', '취약점', '스며든', '수요 중심', '장거리', '글로벌', '그리드 가능', '휴리스틱',
- '고단계', '분리형', '인간자원', '하이브리드', '선구적', '로컬', '물류', '최대화',
- '결정', '휴대형', '모듈형', '멀티미디어', '다중 상태', '멀티 태스킹', '국가적', '범국가적',
- '중립형', '다음 세대', '객체 지향적', '필수', '최적화된', '근본적', '실시간', '역수', '지역적',
- '확장', '보조', '해답 기반', '안정적', '정적', '가치추가', '웹 사용 가능', '잘 모듈화된', '무관리',
- '무해한', '무관용'
- ),
- (
- '능력', '접근', '어댑터', '알고리즘', '연합', '분석', '어플리케이션', '접근',
- '아키텍쳐', '아카이브', '인공지능', '배열', '태도', '벤치마크', '예산 관리', '환경', '생산 능력',
- '도전', '회로', '융합', '컨셉', '축적', '우연성', '코어', '고객 만족', '데이터베이스',
- '정의', '에뮬레이션', '인코딩', '암호화', '엑스트라넷', '펌웨어', '유연성',
- '예보', '프레임', '프레임워크', '함수', '그래픽 인터페이스', '그룹웨어', 'GUI', '하드웨어',
- '안내 창구', '계층', '허브', '미디어 정보', '환경', '설치과정', '인터페이스', '인트라넷',
- '지식 기반', 'LAN', '미들웨어', '마이그레이션', '모델', '관리자', '모니터링', '공개 시스템', '패러다임',
- '정책', '포탈', '제품', '프로젝트', '프로토콜', '서비스 창구', '소프트웨어', '솔루션', '보안구역',
- '전략', '구조체', '성공', '지원', '시너지', '엔진', '표준', '시간화', '공구', '웹 사이트'
- )
- )
+ ('적응된',
+ '숙련된',
+ '자동화된',
+ '안정적인',
+ '비즈니스 중점적',
+ '중심이',
+ '복제된',
+ '효율적인',
+ '설정 가능한',
+ '크로스 그룹',
+ '크로스 플랫폼',
+ '사용자 중심의',
+ '조절 가능한',
+ '디지털화된',
+ '출판된',
+ '다양한',
+ '낮은',
+ '강화된',
+ '인체 공학적인',
+ '특별한',
+ '확장된',
+ '확대된',
+ '1:1',
+ '최전방',
+ '완벽히 설정된',
+ '함수 기반의',
+ '미래가 보장된',
+ '관리된',
+ '모니터링되는',
+ '멀티 채널',
+ '다중 주파수',
+ '멀티 레이어',
+ '조직화된',
+ '객체 기반의',
+ '공개 아키텍쳐',
+ '오픈소스',
+ '최적화된',
+ '선택적',
+ '유기농',
+ '수익에 중점을 둔',
+ '프로그래밍 가능한',
+ '진보적인',
+ '공개 키',
+ '품질 중심의',
+ '반동적인',
+ '재정렬',
+ '줄어든',
+ '리버스 엔지니어링된',
+ '올바른 사이즈의',
+ '강력한',
+ '원활한',
+ '안전한',
+ '자가 이용 가능한',
+ '공유 가능한',
+ '독보적인',
+ '무결점의',
+ '변경 가능한',
+ '동기화',
+ '융합력있는',
+ '융합된',
+ '단체 기반의',
+ '총',
+ '트리플 버퍼',
+ '다용도',
+ '더 커진',
+ '업그레이드 가능한',
+ '더 작아진',
+ '유저 친화적',
+ '가상',
+ '비전 있는'),
+ ('24시간',
+ '24/7',
+ '3세대',
+ '4세대',
+ '5세대',
+ '6세대',
+ '작동',
+ '분석중인',
+ '비대칭',
+ '비동기',
+ '고도 기반',
+ '백그라운드',
+ '주파수 탐지 가능',
+ '요약',
+ '클라이언트 단',
+ '클라이언트-서버',
+ '밀착',
+ '결합된',
+ '합성물',
+ '상황에 맞는',
+ '문맥 기반',
+ '컨텐츠 기반',
+ '헌신적',
+ '교훈적',
+ '방향',
+ '분리된',
+ '다이나믹',
+ '환경 친화적',
+ '실행',
+ '취약점',
+ '스며든',
+ '수요 중심',
+ '장거리',
+ '글로벌',
+ '그리드 가능',
+ '휴리스틱',
+ '고단계',
+ '분리형',
+ '인간자원',
+ '하이브리드',
+ '선구적',
+ '로컬',
+ '물류',
+ '최대화',
+ '결정',
+ '휴대형',
+ '모듈형',
+ '멀티미디어',
+ '다중 상태',
+ '멀티 태스킹',
+ '국가적',
+ '범국가적',
+ '중립형',
+ '다음 세대',
+ '객체 지향적',
+ '필수',
+ '최적화된',
+ '근본적',
+ '실시간',
+ '역수',
+ '지역적',
+ '확장',
+ '보조',
+ '해답 기반',
+ '안정적',
+ '정적',
+ '가치추가',
+ '웹 사용 가능',
+ '잘 모듈화된',
+ '무관리',
+ '무해한',
+ '무관용'),
+ ('능력',
+ '접근',
+ '어댑터',
+ '알고리즘',
+ '연합',
+ '분석',
+ '어플리케이션',
+ '접근',
+ '아키텍쳐',
+ '아카이브',
+ '인공지능',
+ '배열',
+ '태도',
+ '벤치마크',
+ '예산 관리',
+ '환경',
+ '생산 능력',
+ '도전',
+ '회로',
+ '융합',
+ '컨셉',
+ '축적',
+ '우연성',
+ '코어',
+ '고객 만족',
+ '데이터베이스',
+ '정의',
+ '에뮬레이션',
+ '인코딩',
+ '암호화',
+ '엑스트라넷',
+ '펌웨어',
+ '유연성',
+ '예보',
+ '프레임',
+ '프레임워크',
+ '함수',
+ '그래픽 인터페이스',
+ '그룹웨어',
+ 'GUI',
+ '하드웨어',
+ '안내 창구',
+ '계층',
+ '허브',
+ '미디어 정보',
+ '환경',
+ '설치과정',
+ '인터페이스',
+ '인트라넷',
+ '지식 기반',
+ 'LAN',
+ '미들웨어',
+ '마이그레이션',
+ '모델',
+ '관리자',
+ '모니터링',
+ '공개 시스템',
+ '패러다임',
+ '정책',
+ '포탈',
+ '제품',
+ '프로젝트',
+ '프로토콜',
+ '서비스 창구',
+ '소프트웨어',
+ '솔루션',
+ '보안구역',
+ '전략',
+ '구조체',
+ '성공',
+ '지원',
+ '시너지',
+ '엔진',
+ '표준',
+ '시간화',
+ '공구',
+ '웹 사이트'))
bsWords = (
- (
- '다용도의', '통합된', '간소화된', '최적화된', '진화된', '변화된', '포용적인', '사용 가능한',
- '웅장한', '재평가된', '재발명된', '구조적인', '강화된', '장려하는', '변화무쌍한',
- '자율적인', '선구적인', '화폐화된', '전략적인', '발전하는', '합성', '배송', '혼합된', '최대화된',
- '벤치마킹된', '신속한', '깨끗한', '시각적인', '창의적인', '큰', '폭발하는', '확장된',
- '엔지니어', '혁명적인', '제작된', '취약점의', '배열적인', '문화적인'
- ),
- (
- '온라인 쇼핑', '가치 상승', '선구적', '철벽', '혁명적', '가변', '창조적', '직감', '전략적',
- '전자 비즈니스', '끈끈한', '1:1', '24/7', '글로벌', 'B2B', 'B2C', '고운', '가상', '바이러스성',
- '다이나믹', '24/365', '고사양', '킬러', '자기장', '최첨단', '닷컴', '섹시', '백 엔드', '실시간',
- '효율적', '프론트 엔드', '무결점', '확장', '턴키', '세계급', '오픈 소스', '크로스 플랫폼',
- '크로스 미디어', '엔터프라이즈', '통합', '강렬한', '무선', '투명', '다음 세대', '날카로운',
- '창의적', '반투명', '유비쿼터스', '플러그 앤 플레이', '융합', '강력한', '강렬한', '부자'
- ),
- (
- '시너지', '패러다임', '마케팅', '파트너쉽', '인프라', '플랫폼', '채널', '커뮤니티', '솔루션',
- '전자 서비스', '포탈', '기술', '컨텐츠', '생산라인', '관계', '아키텍쳐', '인터페이스', '전자시장',
- '전자화폐', '시스템', '주파수', '모델', '어플리케이션', '사용자들', '스키마', '네트웍스', '앱',
- '매트릭스', '전자 비즈니스', '경험', '웹서비스', '방법론'
- )
- )
+ ('다용도의',
+ '통합된',
+ '간소화된',
+ '최적화된',
+ '진화된',
+ '변화된',
+ '포용적인',
+ '사용 가능한',
+ '웅장한',
+ '재평가된',
+ '재발명된',
+ '구조적인',
+ '강화된',
+ '장려하는',
+ '변화무쌍한',
+ '자율적인',
+ '선구적인',
+ '화폐화된',
+ '전략적인',
+ '발전하는',
+ '합성',
+ '배송',
+ '혼합된',
+ '최대화된',
+ '벤치마킹된',
+ '신속한',
+ '깨끗한',
+ '시각적인',
+ '창의적인',
+ '큰',
+ '폭발하는',
+ '확장된',
+ '엔지니어',
+ '혁명적인',
+ '제작된',
+ '취약점의',
+ '배열적인',
+ '문화적인'),
+ ('온라인 쇼핑',
+ '가치 상승',
+ '선구적',
+ '철벽',
+ '혁명적',
+ '가변',
+ '창조적',
+ '직감',
+ '전략적',
+ '전자 비즈니스',
+ '끈끈한',
+ '1:1',
+ '24/7',
+ '글로벌',
+ 'B2B',
+ 'B2C',
+ '고운',
+ '가상',
+ '바이러스성',
+ '다이나믹',
+ '24/365',
+ '고사양',
+ '킬러',
+ '자기장',
+ '최첨단',
+ '닷컴',
+ '섹시',
+ '백 엔드',
+ '실시간',
+ '효율적',
+ '프론트 엔드',
+ '무결점',
+ '확장',
+ '턴키',
+ '세계급',
+ '오픈 소스',
+ '크로스 플랫폼',
+ '크로스 미디어',
+ '엔터프라이즈',
+ '통합',
+ '강렬한',
+ '무선',
+ '투명',
+ '다음 세대',
+ '날카로운',
+ '창의적',
+ '반투명',
+ '유비쿼터스',
+ '플러그 앤 플레이',
+ '융합',
+ '강력한',
+ '강렬한',
+ '부자'),
+ ('시너지',
+ '패러다임',
+ '마케팅',
+ '파트너쉽',
+ '인프라',
+ '플랫폼',
+ '채널',
+ '커뮤니티',
+ '솔루션',
+ '전자 서비스',
+ '포탈',
+ '기술',
+ '컨텐츠',
+ '생산라인',
+ '관계',
+ '아키텍쳐',
+ '인터페이스',
+ '전자시장',
+ '전자화폐',
+ '시스템',
+ '주파수',
+ '모델',
+ '어플리케이션',
+ '사용자들',
+ '스키마',
+ '네트웍스',
+ '앱',
+ '매트릭스',
+ '전자 비즈니스',
+ '경험',
+ '웹서비스',
+ '방법론'))
company_suffixes = ('(주)', '주식회사', '(유)', '유한회사')
diff --git a/src/libs/faker/providers/company/no_NO/__init__.py b/src/libs/faker/providers/company/no_NO/__init__.py
index 0ce2674..29e760e 100644
--- a/src/libs/faker/providers/company/no_NO/__init__.py
+++ b/src/libs/faker/providers/company/no_NO/__init__.py
@@ -10,9 +10,9 @@ class Provider(CompanyProvider):
'{{last_name}} {{company_suffix}}',
'{{last_name}}-{{last_name}} {{company_suffix}}',
'{{last_name}}, {{last_name}} og {{last_name}}',
- '{{last_name}}-{{last_name}}'
+ '{{last_name}}-{{last_name}}',
]
company_suffixes = [
- 'Gruppen', 'AS', 'ASA', 'BA', 'RFH', 'og Sønner', '& co.'
+ 'Gruppen', 'AS', 'ASA', 'BA', 'RFH', 'og Sønner', '& co.',
]
diff --git a/src/libs/faker/providers/company/pl_PL/__init__.py b/src/libs/faker/providers/company/pl_PL/__init__.py
index 7480295..0f14dbd 100644
--- a/src/libs/faker/providers/company/pl_PL/__init__.py
+++ b/src/libs/faker/providers/company/pl_PL/__init__.py
@@ -1,4 +1,5 @@
# coding=utf-8
+from __future__ import unicode_literals
from .. import Provider as CompanyProvider
@@ -55,6 +56,24 @@ def company_vat_checksum(digits):
class Provider(CompanyProvider):
+ formats = (
+ '{{last_name}} {{company_suffix}}',
+ '{{last_name}}-{{last_name}} {{company_suffix}}',
+ '{{company_prefix}} {{last_name}}',
+ '{{company_prefix}} {{last_name}} {{company_suffix}}',
+ '{{company_prefix}} {{last_name}}-{{last_name}} {{company_suffix}}',
+ )
+
+ company_prefixes = ('Grupa', 'Spółdzielnia', 'Stowarzyszenie', 'Fundacja', 'PPUH', 'FPUH', 'Gabinety')
+
+ company_suffixes = ('Sp. z o.o.', 'S.A.', 'Sp. z o.o. Sp.k.', 'Sp.j.', 's.c.', 'Sp.k.', 'i syn s.c.')
+
+ def company_prefix(self):
+ """
+ :example 'Grupa'
+ """
+ return self.random_element(self.company_prefixes)
+
def regon(self):
"""
Returns 9 character Polish National Business Registry Number,
@@ -105,7 +124,8 @@ def company_vat(self):
check_digit = company_vat_checksum(vat_digits)
- # in this case we must generate a tax number again, because check_digit cannot be 10
+ # in this case we must generate a tax number again, because check_digit
+ # cannot be 10
if check_digit == 10:
return self.company_vat()
diff --git a/src/libs/faker/providers/company/pt_BR/__init__.py b/src/libs/faker/providers/company/pt_BR/__init__.py
index 6af6af2..b03418f 100644
--- a/src/libs/faker/providers/company/pt_BR/__init__.py
+++ b/src/libs/faker/providers/company/pt_BR/__init__.py
@@ -29,24 +29,45 @@ class Provider(CompanyProvider):
)
catch_phrase_formats = (
- '{{catch_phrase_noun}} {{catch_phrase_verb}} {{catch_phrase_attribute}}',
- )
+ '{{catch_phrase_noun}} {{catch_phrase_verb}} {{catch_phrase_attribute}}', )
nouns = (
- 'a segurança', 'o prazer', 'o conforto', 'a simplicidade', 'a certeza', 'a arte', 'o poder', 'o direito',
- 'a possibilidade', 'a vantagem', 'a liberdade'
- )
+ 'a segurança',
+ 'o prazer',
+ 'o conforto',
+ 'a simplicidade',
+ 'a certeza',
+ 'a arte',
+ 'o poder',
+ 'o direito',
+ 'a possibilidade',
+ 'a vantagem',
+ 'a liberdade')
verbs = (
- 'de conseguir', 'de avançar', 'de evoluir', 'de mudar', 'de inovar', 'de ganhar', 'de atingir seus objetivos',
- 'de concretizar seus projetos', 'de realizar seus sonhos'
- )
+ 'de conseguir',
+ 'de avançar',
+ 'de evoluir',
+ 'de mudar',
+ 'de inovar',
+ 'de ganhar',
+ 'de atingir seus objetivos',
+ 'de concretizar seus projetos',
+ 'de realizar seus sonhos')
attributes = (
- 'de maneira eficaz', 'mais rapidamente', 'mais facilmente', 'simplesmente', 'com toda a tranquilidade',
- 'antes de tudo', 'naturalmente', 'sem preocupação', 'em estado puro', 'com força total',
- 'direto da fonte', 'com confiança'
- )
+ 'de maneira eficaz',
+ 'mais rapidamente',
+ 'mais facilmente',
+ 'simplesmente',
+ 'com toda a tranquilidade',
+ 'antes de tudo',
+ 'naturalmente',
+ 'sem preocupação',
+ 'em estado puro',
+ 'com força total',
+ 'direto da fonte',
+ 'com confiança')
company_suffixes = ('S/A', 'S.A.', 'Ltda.', '- ME', '- EI', 'e Filhos')
diff --git a/src/libs/faker/providers/company/pt_PT/__init__.py b/src/libs/faker/providers/company/pt_PT/__init__.py
index c486f54..93b905d 100644
--- a/src/libs/faker/providers/company/pt_PT/__init__.py
+++ b/src/libs/faker/providers/company/pt_PT/__init__.py
@@ -12,26 +12,25 @@ class Provider(CompanyProvider):
)
catch_phrase_formats = (
- '{{catch_phrase_noun}} {{catch_phrase_verb}} {{catch_phrase_attribute}}',
- )
+ '{{catch_phrase_noun}} {{catch_phrase_verb}} {{catch_phrase_attribute}}', )
nouns = (
'a segurança', 'o prazer', 'o conforto', 'a simplicidade', 'a certeza',
'a arte', 'o poder', 'o direito', 'a possibilidade', 'a vantagem',
- 'a liberdade'
+ 'a liberdade',
)
verbs = (
'de conseguir', 'de avançar', 'de evoluir', 'de mudar', 'de inovar',
'de ganhar', 'de atingir os seus objetivos',
- 'de concretizar seus projetos', 'de realizar seus sonhos'
+ 'de concretizar seus projetos', 'de realizar seus sonhos',
)
attributes = (
'de maneira eficaz', 'mais rapidamente', 'mais facilmente',
'simplesmente', 'com toda a tranquilidade', 'antes de tudo',
'naturalmente', 'sem preocupação', 'em estado puro', 'com força total',
- 'direto da fonte', 'com confiança'
+ 'direto da fonte', 'com confiança',
)
company_suffixes = ('S/A', 'S.A.', 'Lda.', 'e Filhos')
diff --git a/src/libs/faker/providers/company/ru_RU/__init__.py b/src/libs/faker/providers/company/ru_RU/__init__.py
index 653e79e..afd895a 100644
--- a/src/libs/faker/providers/company/ru_RU/__init__.py
+++ b/src/libs/faker/providers/company/ru_RU/__init__.py
@@ -3,6 +3,7 @@
from __future__ import unicode_literals
from .. import Provider as CompanyProvider
+
class Provider(CompanyProvider):
formats = (
'{{company_prefix}} «{{last_name}}»',
diff --git a/src/libs/faker/providers/company/sv_SE/__init__.py b/src/libs/faker/providers/company/sv_SE/__init__.py
index 2230c70..513dace 100644
--- a/src/libs/faker/providers/company/sv_SE/__init__.py
+++ b/src/libs/faker/providers/company/sv_SE/__init__.py
@@ -12,5 +12,5 @@ class Provider(CompanyProvider):
)
company_suffixes = (
- 'AB', 'HB'
+ 'AB', 'HB',
)
diff --git a/src/libs/faker/providers/company/zh_CN/__init__.py b/src/libs/faker/providers/company/zh_CN/__init__.py
index fb98961..779487d 100644
--- a/src/libs/faker/providers/company/zh_CN/__init__.py
+++ b/src/libs/faker/providers/company/zh_CN/__init__.py
@@ -4,7 +4,7 @@
class Provider(CompanyProvider):
- formats = ["{{company_prefix}}{{company_suffix}}", ]
+ formats = ["{{company_prefix}}{{company_suffix}}"]
company_prefixes = ["超艺", "和泰", "九方", "鑫博腾飞", "戴硕电子", "济南亿次元",
"海创", "创联世纪", "凌云", "泰麒麟", "彩虹", "兰金电子",
diff --git a/src/libs/faker/providers/credit_card/__init__.py b/src/libs/faker/providers/credit_card/__init__.py
index a683f1c..7daab24 100644
--- a/src/libs/faker/providers/credit_card/__init__.py
+++ b/src/libs/faker/providers/credit_card/__init__.py
@@ -7,7 +7,13 @@
class CreditCard(object):
- def __init__(self, name, prefixes, length=16, security_code='CVC', security_code_length=3):
+ def __init__(
+ self,
+ name,
+ prefixes,
+ length=16,
+ security_code='CVC',
+ security_code_length=3):
self.name = name
self.prefixes = prefixes
self.length = length
@@ -17,27 +23,34 @@ def __init__(self, name, prefixes, length=16, security_code='CVC', security_code
class Provider(BaseProvider):
- prefix_maestro = ['5018', '5020', '5038', '5612', '5893', '6304', '6759', '6761', '6762', '6763', '0604', '6390']
- prefix_mastercard = ['51', '52', '53', '54', '55']
+ # Prefixes from:
+ # * https://en.wikipedia.org/wiki/Payment_card_number#Issuer_identification_number_.28IIN.29
+ # * https://www.regular-expressions.info/creditcard.html
+ # * https://creditcardjs.com/credit-card-type-detection
+ prefix_maestro = ['5018', '5020', '5038', '56##', '57##', '58##',
+ '6304', '6759', '6761', '6762', '6763', '0604', '6390']
+ prefix_mastercard = ['51', '52', '53', '54', '55', '222%']
prefix_visa = ['4']
prefix_amex = ['34', '37']
- prefix_discover = ['6011']
- prefix_diners = ['300', '301', '302', '303', '304', '305']
- prefix_jcb16 = ['3088', '3096', '3112', '3158', '3337', '3528']
- prefix_jcb15 = ['2100', '1800']
- prefix_voyager = ['8699']
+ prefix_discover = ['6011', '65']
+ prefix_diners = ['300', '301', '302', '303', '304', '305', '36', '38']
+ prefix_jcb16 = ['35']
+ prefix_jcb15 = ['2131', '1800']
credit_card_types = OrderedDict((
- ('maestro', CreditCard('Maestro', prefix_maestro, 12, security_code='CVV')),
- ('mastercard', CreditCard('Mastercard', prefix_mastercard, 16, security_code='CVV')),
- ('visa16', CreditCard('VISA 16 digit', prefix_visa)),
- ('visa13', CreditCard('VISA 13 digit', prefix_visa, 13)),
- ('amex', CreditCard('American Express', prefix_amex, 15, security_code='CID', security_code_length=4)),
- ('discover', CreditCard('Discover', prefix_discover)),
- ('diners', CreditCard('Diners Club / Carte Blanche', prefix_diners, 14)),
- ('jcb15', CreditCard('JCB 15 digit', prefix_jcb15, 15)),
- ('jcb16', CreditCard('JCB 16 digit', prefix_jcb16)),
- ('voyager', CreditCard('Voyager', prefix_voyager, 15)),
+ ('maestro', CreditCard('Maestro',
+ prefix_maestro, 12, security_code='CVV')),
+ ('mastercard', CreditCard('Mastercard',
+ prefix_mastercard, 16, security_code='CVV')),
+ ('visa16', CreditCard('VISA 16 digit', prefix_visa)),
+ ('visa13', CreditCard('VISA 13 digit', prefix_visa, 13)),
+ ('visa19', CreditCard('VISA 19 digit', prefix_visa, 19)),
+ ('amex', CreditCard('American Express', prefix_amex,
+ 15, security_code='CID', security_code_length=4)),
+ ('discover', CreditCard('Discover', prefix_discover)),
+ ('diners', CreditCard('Diners Club / Carte Blanche', prefix_diners, 14)),
+ ('jcb15', CreditCard('JCB 15 digit', prefix_jcb15, 15)),
+ ('jcb16', CreditCard('JCB 16 digit', prefix_jcb16)),
))
credit_card_types['visa'] = credit_card_types['visa16']
credit_card_types['jcb'] = credit_card_types['jcb16']
@@ -55,7 +68,7 @@ def credit_card_number(self, card_type=None):
""" Returns a valid credit card number. """
card = self._credit_card_type(card_type)
prefix = self.random_element(card.prefixes)
- number = self._generate_number(prefix, card.length)
+ number = self._generate_number(self.numerify(prefix), card.length)
return number
def credit_card_expire(self, start='now', end='+10y', date_format='%m/%y'):
@@ -70,12 +83,13 @@ def credit_card_full(self, card_type=None):
'{number} {expire_date}\n'
'{security}: {security_nb}\n')
- tpl = tpl.format(provider = card.name,
- owner = self.generator.parse("{{first_name}} {{last_name}}"),
- number = self.credit_card_number(card),
- expire_date = self.credit_card_expire(),
- security = card.security_code,
- security_nb = self.credit_card_security_code(card))
+ tpl = tpl.format(provider=card.name,
+ owner=self.generator.parse(
+ "{{first_name}} {{last_name}}"),
+ number=self.credit_card_number(card),
+ expire_date=self.credit_card_expire(),
+ security=card.security_code,
+ security_nb=self.credit_card_security_code(card))
return self.generator.parse(tpl)
diff --git a/src/libs/faker/providers/currency/__init__.py b/src/libs/faker/providers/currency/__init__.py
index 28f8f42..9edd187 100644
--- a/src/libs/faker/providers/currency/__init__.py
+++ b/src/libs/faker/providers/currency/__init__.py
@@ -4,182 +4,235 @@
class Provider(BaseProvider):
+ # Format: (code, name)
currencies = (
- "AED",
- "AFN",
- "ALL",
- "AMD",
- "ANG",
- "AOA",
- "ARS",
- "AUD",
- "AWG",
- "AZN",
- "BAM",
- "BBD",
- "BDT",
- "BGN",
- "BHD",
- "BIF",
- "BMD",
- "BND",
- "BOB",
- "BRL",
- "BSD",
- "BTN",
- "BWP",
- "BYR",
- "BZD",
- "CAD",
- "CDF",
- "CHF",
- "CLP",
- "CNY",
- "COP",
- "CRC",
- "CUC",
- "CUP",
- "CVE",
- "CZK",
- "DJF",
- "DKK",
- "DOP",
- "DZD",
- "EGP",
- "ERN",
- "ETB",
- "EUR",
- "FJD",
- "FKP",
- "GBP",
- "GEL",
- "GGP",
- "GHS",
- "GIP",
- "GMD",
- "GNF",
- "GTQ",
- "GYD",
- "HKD",
- "HNL",
- "HRK",
- "HTG",
- "HUF",
- "IDR",
- "ILS",
- "IMP",
- "INR",
- "IQD",
- "IRR",
- "ISK",
- "JEP",
- "JMD",
- "JOD",
- "JPY",
- "KES",
- "KGS",
- "KHR",
- "KMF",
- "KPW",
- "KRW",
- "KWD",
- "KYD",
- "KZT",
- "LAK",
- "LBP",
- "LKR",
- "LRD",
- "LSL",
- "LTL",
- "LYD",
- "MAD",
- "MDL",
- "MGA",
- "MKD",
- "MMK",
- "MNT",
- "MOP",
- "MRO",
- "MUR",
- "MVR",
- "MWK",
- "MXN",
- "MYR",
- "MZN",
- "NAD",
- "NGN",
- "NIO",
- "NIS",
- "NOK",
- "NPR",
- "NZD",
- "OMR",
- "PAB",
- "PEN",
- "PGK",
- "PHP",
- "PKR",
- "PLN",
- "PYG",
- "QAR",
- "RON",
- "RSD",
- "RUB",
- "RWF",
- "SAR",
- "SBD",
- "SCR",
- "SDG",
- "SEK",
- "SGD",
- "SHP",
- "SLL",
- "SOS",
- "SPL",
- "SRD",
- "STD",
- "SVC",
- "SYP",
- "SZL",
- "THB",
- "TJS",
- "TMT",
- "TND",
- "TOP",
- "TRY",
- "TTD",
- "TVD",
- "TWD",
- "TZS",
- "UAH",
- "UGX",
- "USD",
- "UYU",
- "UZS",
- "VEF",
- "VND",
- "VUV",
- "WST",
- "XAF",
- "XCD",
- "XDR",
- "XOF",
- "XPF",
- "YER",
- "ZAR",
- "ZMW",
- "ZWD"
+ ("AED", "United Arab Emirates dirham"),
+ ("AFN", "Afghan afghani"),
+ ("ALL", "Albanian lek"),
+ ("AMD", "Armenian dram"),
+ ("ANG", "Netherlands Antillean guilder"),
+ ("AOA", "Angolan kwanza"),
+ ("ARS", "Argentine peso"),
+ ("AUD", "Australian dollar"),
+ ("AWG", "Aruban florin"),
+ ("AZN", "Azerbaijani manat"),
+ ("BAM", "Bosnia and Herzegovina convertible mark"),
+ ("BBD", "Barbadian dollar"),
+ ("BDT", "Bangladeshi taka"),
+ ("BGN", "Bulgarian lev"),
+ ("BHD", "Bahraini dinar"),
+ ("BIF", "Burundian franc"),
+ ("BMD", "Bermudian dollar"),
+ ("BND", "Brunei dollar"),
+ ("BOB", "Bolivian boliviano"),
+ ("BRL", "Brazilian real"),
+ ("BSD", "Bahamian dollar"),
+ ("BTN", "Bhutanese ngultrum"),
+ ("BWP", "Botswana pula"),
+ ("BYR", "Belarusian ruble"),
+ ("BZD", "Belize dollar"),
+ ("CAD", "Canadian dollar"),
+ ("CDF", "Congolese franc"),
+ ("CHF", "Swiss franc"),
+ ("CLP", "Chilean peso"),
+ ("CNY", "Renminbi"),
+ ("COP", "Colombian peso"),
+ ("CRC", "Costa Rican colón"),
+ ("CUC", "Cuban convertible peso"),
+ ("CUP", "Cuban peso"),
+ ("CVE", "Cape Verdean escudo"),
+ ("CZK", "Czech koruna"),
+ ("DJF", "Djiboutian franc"),
+ ("DKK", "Danish krone"),
+ ("DOP", "Dominican peso"),
+ ("DZD", "Algerian dinar"),
+ ("EGP", "Egyptian pound"),
+ ("ERN", "Eritrean nakfa"),
+ ("ETB", "Ethiopian birr"),
+ ("EUR", "Euro"),
+ ("FJD", "Fijian dollar"),
+ ("FKP", "Falkland Islands pound"),
+ ("GBP", "Pound sterling"),
+ ("GEL", "Georgian lari"),
+ ("GGP", "Guernsey pound"),
+ ("GHS", "Ghanaian cedi"),
+ ("GIP", "Gibraltar pound"),
+ ("GMD", "Gambian dalasi"),
+ ("GNF", "Guinean franc"),
+ ("GTQ", "Guatemalan quetzal"),
+ ("GYD", "Guyanese dollar"),
+ ("HKD", "Hong Kong dollar"),
+ ("HNL", "Honduran lempira"),
+ ("HRK", "Croatian kuna"),
+ ("HTG", "Haitian gourde"),
+ ("HUF", "Hungarian forint"),
+ ("IDR", "Indonesian rupiah"),
+ ("ILS", "Israeli new shekel"),
+ ("NIS", "Israeli new shekel"),
+ ("IMP", "Manx pound"),
+ ("INR", "Indian rupee"),
+ ("IQD", "Iraqi dinar"),
+ ("IRR", "Iranian rial"),
+ ("ISK", "Icelandic króna"),
+ ("JEP", "Jersey pound"),
+ ("JMD", "Jamaican dollar"),
+ ("JOD", "Jordanian dinar"),
+ ("JPY", "Japanese yen"),
+ ("KES", "Kenyan shilling"),
+ ("KGS", "Kyrgyzstani som"),
+ ("KHR", "Cambodian riel"),
+ ("KMF", "Comorian franc"),
+ ("KPW", "North Korean won"),
+ ("KRW", "Western Krahn language"),
+ ("KWD", "Kuwaiti dinar"),
+ ("KYD", "Cayman Islands dollar"),
+ ("KZT", "Kazakhstani tenge"),
+ ("LAK", "Lao kip"),
+ ("LBP", "Lebanese pound"),
+ ("LKR", "Sri Lankan rupee"),
+ ("LRD", "Liberian dollar"),
+ ("LSL", "Lesotho loti"),
+ ("LTL", "Lithuanian litas"),
+ ("LYD", "Libyan dinar"),
+ ("MAD", "Moroccan dirham"),
+ ("MDL", "Moldovan leu"),
+ ("MGA", "Malagasy ariar"),
+ ("MKD", "Macedonian denar"),
+ ("MMK", "Burmese kyat"),
+ ("MNT", "Mongolian tugrik"),
+ ("MOP", "Macanese pataca"),
+ ("MRO", "Mauritanian ouguiya"),
+ ("MUR", "Mauritian rupee"),
+ ("MVR", "Maldivian rufiyaa"),
+ ("MWK", "Malawian kwacha"),
+ ("MXN", "Mexican peso"),
+ ("MYR", "Malaysian ringgit"),
+ ("MZN", "Mozambican metical"),
+ ("NAD", "Namibian dollar"),
+ ("NGN", "Nigerian naira"),
+ ("NIO", "Nicaraguan córdoba"),
+ ("NOK", "Norwegian krone"),
+ ("NPR", "Nepalese rupee"),
+ ("NZD", "New Zealand dollar"),
+ ("OMR", "Omani rial"),
+ ("PAB", "Panamanian balboa"),
+ ("PEN", "Peruvian sol"),
+ ("PGK", "Papua New Guinean kina"),
+ ("PHP", "Philippine peso"),
+ ("PKR", "Pakistani rupee"),
+ ("PLN", "Polish zloty"),
+ ("PYG", "Paraguayan guarani"),
+ ("QAR", "Qatari riyal"),
+ ("RON", "Romanian leu"),
+ ("RSD", "Serbian dinar"),
+ ("RUB", "Russian ruble"),
+ ("RWF", "Rwandan franc"),
+ ("SAR", "Saudi riyal"),
+ ("SBD", "Solomon Islands dollar"),
+ ("SCR", "Seychellois rupee"),
+ ("SDG", "Sudanese pound"),
+ ("SEK", "Swedish krona"),
+ ("SGD", "Singapore dollar"),
+ ("SHP", "Saint Helena pound"),
+ ("SLL", "Sierra Leonean leone"),
+ ("SOS", "Somali shilling"),
+ ("SPL", "Seborga luigino"),
+ ("SRD", "Surinamese dollar"),
+ ("STD", "São Tomé and Príncipe dobra"),
+ ("SVC", "Salvadoran colón"),
+ ("SYP", "Syrian pound"),
+ ("SZL", "Swazi lilangeni"),
+ ("THB", "Thai baht"),
+ ("TJS", "Tajikistani somoni"),
+ ("TMT", "Turkmenistan manat"),
+ ("TND", "Tunisian dinar"),
+ ("TOP", "Tongan paʻanga"),
+ ("TRY", "Turkish lira"),
+ ("TTD", "Trinidad and Tobago dollar"),
+ ("TVD", "Tuvaluan dollar"),
+ ("TWD", "New Taiwan dollar"),
+ ("TZS", "Tanzanian shilling"),
+ ("UAH", "Ukrainian hryvnia"),
+ ("UGX", "Ugandan shilling"),
+ ("USD", "United States dollar"),
+ ("UYU", "Uruguayan peso"),
+ ("UZS", "Uzbekistani soʻm"),
+ ("VEF", "Venezuelan bolívar"),
+ ("VND", "Vietnamese đồng"),
+ ("VUV", "Vanuatu vatu"),
+ ("WST", "Samoan tālā"),
+ ("XAF", "Central African CFA franc"),
+ ("XCD", "Eastern Caribbean dollar"),
+ ("XDR", "Special drawing rights"),
+ ("XOF", "West African CFA franc"),
+ ("XPF", "CFP franc"),
+ ("YER", "Yemeni rial"),
+ ("ZAR", "South African rand"),
+ ("ZMW", "Zambian kwacha"),
+ ("ZWD", "Zimbabwean dollar"),
)
# Source: https://en.wikipedia.org/wiki/List_of_cryptocurrencies
cryptocurrencies = (
- 'AMP', 'AUR', 'BC', 'BTC', 'BURST', 'DASH', 'DOGE', 'EMC', 'ETH',
- 'GRC', 'KOI', 'LTC', 'MSC', 'MZC', 'NMC', 'NXT', 'POT', 'PPC', 'SIL',
- 'TIT', 'VTC', 'XDN', 'XMR', 'XPM', 'XRP', 'ZEC',
+ ('AMP', "AMP"),
+ ('AUR', "Auroracoin"),
+ ('BC', "BlackCoin"),
+ ('BTC', "Bitcoin"),
+ ('BURST', "Burstcoin"),
+ ('DASH', "Dash"),
+ ('DOGE', "Dogecoin"),
+ ('EMC', "Emercoin"),
+ ('ETH', "Ethereum"),
+ ('ETC', "Ethereum Classic"),
+ ('GRC', "Gridcoin"),
+ ('KOI', "Coinye"),
+ ('LTC', "Litecoin"),
+ ('MSC', "Omni"),
+ ('MZC', "MazaCoin"),
+ ('NMC', "Namecoin"),
+ ('NXT', "Nxt"),
+ ('POT', "PotCoin"),
+ ('PPC', "Peercoin"),
+ ('TIT', "Titcoin"),
+ ('VTC', "Vertcoin"),
+ ('XDN', "DigitalNote"),
+ ('XMR', "Monero"),
+ ('XPM', "Primecoin"),
+ ('XRP', "Ripple"),
+ ('ZEC', "Zcash"),
+ ('STC', "SwiftCoin"),
+ ('BCN', "Bytecoin"),
+ ('FTH', "Feathercoin"),
+ ('NEO', "NEO"),
+ ('NEM', "XEM"),
+ ('USDT', "Tether"),
+ ('IOTA', "IOTA"),
+ ('DRC', "Decred"),
+ ('WAVES', "Waves Platform"),
+ ('LSK', "Lisk"),
+ ('ZCL', "Zclassic"),
+ ('BCH', "Bitcoin Cash"),
+ ('UBQ', "Ubiq"),
+ ('EOS', "EOS.IO"),
+ ('SRN', "Sirin Labs"),
+ ('TRX', "TRON"),
+ ('ADA', "Cardano"),
)
- def currency_code(self):
+ def currency(self):
return self.random_element(self.currencies)
- def cryptocurrency_code(self):
+ def currency_code(self):
+ return self.currency()[0]
+
+ def currency_name(self):
+ return self.currency()[1]
+
+ def cryptocurrency(self):
return self.random_element(self.cryptocurrencies)
+
+ def cryptocurrency_code(self):
+ return self.cryptocurrency()[0]
+
+ def cryptocurrency_name(self):
+ return self.cryptocurrency()[1]
diff --git a/src/libs/faker/providers/date_time/__init__.py b/src/libs/faker/providers/date_time/__init__.py
index af49923..f2048fa 100644
--- a/src/libs/faker/providers/date_time/__init__.py
+++ b/src/libs/faker/providers/date_time/__init__.py
@@ -5,7 +5,7 @@
import re
from calendar import timegm
-from datetime import timedelta
+from datetime import timedelta, MAXYEAR
from time import time
from dateutil import relativedelta
@@ -40,219 +40,1340 @@ class ParseError(ValueError):
timedelta_pattern = r''
-for name, sym in [('years', 'y'), ('weeks', 'w'), ('days', 'd'), ('hours', 'h'), ('minutes', 'm'), ('seconds', 's')]:
+for name, sym in [('years', 'y'), ('weeks', 'w'), ('days', 'd'),
+ ('hours', 'h'), ('minutes', 'm'), ('seconds', 's')]:
timedelta_pattern += r'((?P<{0}>(?:\+|-)\d+?){1})?'.format(name, sym)
class Provider(BaseProvider):
- centuries = ['I', 'II', 'III', 'IV', 'V', 'VI', 'VII', 'VIII', 'IX', 'X', 'XI', 'XII', 'XIII', 'XIV', 'XV', 'XVI',
- 'XVII', 'XVIII', 'XIX', 'XX', 'XXI']
-
- countries = [
- {'timezones': ['Europe/Andorra'], 'code': 'AD', 'continent': 'Europe', 'name': 'Andorra', 'capital': 'Andorra la Vella'},
- {'timezones': ['Asia/Kabul'], 'code': 'AF', 'continent': 'Asia', 'name': 'Afghanistan', 'capital': 'Kabul'},
- {'timezones': ['America/Antigua'], 'code': 'AG', 'continent': 'North America', 'name': 'Antigua and Barbuda', 'capital': "St. John's"},
- {'timezones': ['Europe/Tirane'], 'code': 'AL', 'continent': 'Europe', 'name': 'Albania', 'capital': 'Tirana'},
- {'timezones': ['Asia/Yerevan'], 'code': 'AM', 'continent': 'Asia', 'name': 'Armenia', 'capital': 'Yerevan'},
- {'timezones': ['Africa/Luanda'], 'code': 'AO', 'continent': 'Africa', 'name': 'Angola', 'capital': 'Luanda'},
- {'timezones': ['America/Argentina/Buenos_Aires', 'America/Argentina/Cordoba', 'America/Argentina/Jujuy', 'America/Argentina/Tucuman', 'America/Argentina/Catamarca', 'America/Argentina/La_Rioja', 'America/Argentina/San_Juan', 'America/Argentina/Mendoza', 'America/Argentina/Rio_Gallegos', 'America/Argentina/Ushuaia'], 'code': 'AR', 'continent': 'South America', 'name': 'Argentina', 'capital': 'Buenos Aires'},
- {'timezones': ['Europe/Vienna'], 'code': 'AT', 'continent': 'Europe', 'name': 'Austria', 'capital': 'Vienna'},
- {'timezones': ['Australia/Lord_Howe', 'Australia/Hobart', 'Australia/Currie', 'Australia/Melbourne', 'Australia/Sydney', 'Australia/Broken_Hill', 'Australia/Brisbane', 'Australia/Lindeman', 'Australia/Adelaide', 'Australia/Darwin', 'Australia/Perth'], 'code': 'AU', 'continent': 'Oceania', 'name': 'Australia', 'capital': 'Canberra'},
- {'timezones': ['Asia/Baku'], 'code': 'AZ', 'continent': 'Asia', 'name': 'Azerbaijan', 'capital': 'Baku'},
- {'timezones': ['America/Barbados'], 'code': 'BB', 'continent': 'North America', 'name': 'Barbados', 'capital': 'Bridgetown'},
- {'timezones': ['Asia/Dhaka'], 'code': 'BD', 'continent': 'Asia', 'name': 'Bangladesh', 'capital': 'Dhaka'},
- {'timezones': ['Europe/Brussels'], 'code': 'BE', 'continent': 'Europe', 'name': 'Belgium', 'capital': 'Brussels'},
- {'timezones': ['Africa/Ouagadougou'], 'code': 'BF', 'continent': 'Africa', 'name': 'Burkina Faso', 'capital': 'Ouagadougou'},
- {'timezones': ['Europe/Sofia'], 'code': 'BG', 'continent': 'Europe', 'name': 'Bulgaria', 'capital': 'Sofia'},
- {'timezones': ['Asia/Bahrain'], 'code': 'BH', 'continent': 'Asia', 'name': 'Bahrain', 'capital': 'Manama'},
- {'timezones': ['Africa/Bujumbura'], 'code': 'BI', 'continent': 'Africa', 'name': 'Burundi', 'capital': 'Bujumbura'},
- {'timezones': ['Africa/Porto-Novo'], 'code': 'BJ', 'continent': 'Africa', 'name': 'Benin', 'capital': 'Porto-Novo'},
- {'timezones': ['Asia/Brunei'], 'code': 'BN', 'continent': 'Asia', 'name': 'Brunei Darussalam', 'capital': 'Bandar Seri Begawan'},
- {'timezones': ['America/La_Paz'], 'code': 'BO', 'continent': 'South America', 'name': 'Bolivia', 'capital': 'Sucre'},
- {'timezones': ['America/Noronha', 'America/Belem', 'America/Fortaleza', 'America/Recife', 'America/Araguaina', 'America/Maceio', 'America/Bahia', 'America/Sao_Paulo', 'America/Campo_Grande', 'America/Cuiaba', 'America/Porto_Velho', 'America/Boa_Vista', 'America/Manaus', 'America/Eirunepe', 'America/Rio_Branco'], 'code': 'BR', 'continent': 'South America', 'name': 'Brazil', 'capital': 'Bras\xc3\xadlia'},
- {'timezones': ['America/Nassau'], 'code': 'BS', 'continent': 'North America', 'name': 'Bahamas', 'capital': 'Nassau'},
- {'timezones': ['Asia/Thimphu'], 'code': 'BT', 'continent': 'Asia', 'name': 'Bhutan', 'capital': 'Thimphu'},
- {'timezones': ['Africa/Gaborone'], 'code': 'BW', 'continent': 'Africa', 'name': 'Botswana', 'capital': 'Gaborone'},
- {'timezones': ['Europe/Minsk'], 'code': 'BY', 'continent': 'Europe', 'name': 'Belarus', 'capital': 'Minsk'},
- {'timezones': ['America/Belize'], 'code': 'BZ', 'continent': 'North America', 'name': 'Belize', 'capital': 'Belmopan'},
- {'timezones': ['America/St_Johns', 'America/Halifax', 'America/Glace_Bay', 'America/Moncton', 'America/Goose_Bay', 'America/Blanc-Sablon', 'America/Montreal', 'America/Toronto', 'America/Nipigon', 'America/Thunder_Bay', 'America/Pangnirtung', 'America/Iqaluit', 'America/Atikokan', 'America/Rankin_Inlet', 'America/Winnipeg', 'America/Rainy_River', 'America/Cambridge_Bay', 'America/Regina', 'America/Swift_Current', 'America/Edmonton', 'America/Yellowknife', 'America/Inuvik', 'America/Dawson_Creek', 'America/Vancouver', 'America/Whitehorse', 'America/Dawson'], 'code': 'CA', 'continent': 'North America', 'name': 'Canada', 'capital': 'Ottawa'},
- {'timezones': ['Africa/Kinshasa', 'Africa/Lubumbashi'], 'code': 'CD', 'continent': 'Africa', 'name': 'Democratic Republic of the Congo', 'capital': 'Kinshasa'},
- {'timezones': ['Africa/Brazzaville'], 'code': 'CG', 'continent': 'Africa', 'name': 'Republic of the Congo', 'capital': 'Brazzaville'},
- {'timezones': ['Africa/Abidjan'], 'code': 'CI', 'continent': 'Africa', 'name': "C\xc3\xb4te d'Ivoire", 'capital': 'Yamoussoukro'},
- {'timezones': ['America/Santiago', 'Pacific/Easter'], 'code': 'CL', 'continent': 'South America', 'name': 'Chile', 'capital': 'Santiago'},
- {'timezones': ['Africa/Douala'], 'code': 'CM', 'continent': 'Africa', 'name': 'Cameroon', 'capital': 'Yaound\xc3\xa9'},
- {'timezones': ['Asia/Shanghai', 'Asia/Harbin', 'Asia/Chongqing', 'Asia/Urumqi', 'Asia/Kashgar'], 'code': 'CN', 'continent': 'Asia', 'name': "People's Republic of China", 'capital': 'Beijing'},
- {'timezones': ['America/Bogota'], 'code': 'CO', 'continent': 'South America', 'name': 'Colombia', 'capital': 'Bogot\xc3\xa1'},
- {'timezones': ['America/Costa_Rica'], 'code': 'CR', 'continent': 'North America', 'name': 'Costa Rica', 'capital': 'San Jos\xc3\xa9'},
- {'timezones': ['America/Havana'], 'code': 'CU', 'continent': 'North America', 'name': 'Cuba', 'capital': 'Havana'},
- {'timezones': ['Atlantic/Cape_Verde'], 'code': 'CV', 'continent': 'Africa', 'name': 'Cape Verde', 'capital': 'Praia'},
- {'timezones': ['Asia/Nicosia'], 'code': 'CY', 'continent': 'Asia', 'name': 'Cyprus', 'capital': 'Nicosia'},
- {'timezones': ['Europe/Prague'], 'code': 'CZ', 'continent': 'Europe', 'name': 'Czech Republic', 'capital': 'Prague'},
- {'timezones': ['Europe/Berlin'], 'code': 'DE', 'continent': 'Europe', 'name': 'Germany', 'capital': 'Berlin'},
- {'timezones': ['Africa/Djibouti'], 'code': 'DJ', 'continent': 'Africa', 'name': 'Djibouti', 'capital': 'Djibouti City'},
- {'timezones': ['Europe/Copenhagen'], 'code': 'DK', 'continent': 'Europe', 'name': 'Denmark', 'capital': 'Copenhagen'},
- {'timezones': ['America/Dominica'], 'code': 'DM', 'continent': 'North America', 'name': 'Dominica', 'capital': 'Roseau'},
- {'timezones': ['America/Santo_Domingo'], 'code': 'DO', 'continent': 'North America', 'name': 'Dominican Republic', 'capital': 'Santo Domingo'},
- {'timezones': ['America/Guayaquil', 'Pacific/Galapagos'], 'code': 'EC', 'continent': 'South America', 'name': 'Ecuador', 'capital': 'Quito'},
- {'timezones': ['Europe/Tallinn'], 'code': 'EE', 'continent': 'Europe', 'name': 'Estonia', 'capital': 'Tallinn'},
- {'timezones': ['Africa/Cairo'], 'code': 'EG', 'continent': 'Africa', 'name': 'Egypt', 'capital': 'Cairo'},
- {'timezones': ['Africa/Asmera'], 'code': 'ER', 'continent': 'Africa', 'name': 'Eritrea', 'capital': 'Asmara'},
- {'timezones': ['Africa/Addis_Ababa'], 'code': 'ET', 'continent': 'Africa', 'name': 'Ethiopia', 'capital': 'Addis Ababa'},
- {'timezones': ['Europe/Helsinki'], 'code': 'FI', 'continent': 'Europe', 'name': 'Finland', 'capital': 'Helsinki'},
- {'timezones': ['Pacific/Fiji'], 'code': 'FJ', 'continent': 'Oceania', 'name': 'Fiji', 'capital': 'Suva'},
- {'timezones': ['Europe/Paris'], 'code': 'FR', 'continent': 'Europe', 'name': 'France', 'capital': 'Paris'},
- {'timezones': ['Africa/Libreville'], 'code': 'GA', 'continent': 'Africa', 'name': 'Gabon', 'capital': 'Libreville'},
- {'timezones': ['Asia/Tbilisi'], 'code': 'GE', 'continent': 'Asia', 'name': 'Georgia', 'capital': 'Tbilisi'},
- {'timezones': ['Africa/Accra'], 'code': 'GH', 'continent': 'Africa', 'name': 'Ghana', 'capital': 'Accra'},
- {'timezones': ['Africa/Banjul'], 'code': 'GM', 'continent': 'Africa', 'name': 'The Gambia', 'capital': 'Banjul'},
- {'timezones': ['Africa/Conakry'], 'code': 'GN', 'continent': 'Africa', 'name': 'Guinea', 'capital': 'Conakry'},
- {'timezones': ['Europe/Athens'], 'code': 'GR', 'continent': 'Europe', 'name': 'Greece', 'capital': 'Athens'},
- {'timezones': ['America/Guatemala'], 'code': 'GT', 'continent': 'North America', 'name': 'Guatemala', 'capital': 'Guatemala City'},
- {'timezones': ['America/Guatemala'], 'code': 'GT', 'continent': 'North America', 'name': 'Haiti', 'capital': 'Port-au-Prince'},
- {'timezones': ['Africa/Bissau'], 'code': 'GW', 'continent': 'Africa', 'name': 'Guinea-Bissau', 'capital': 'Bissau'},
- {'timezones': ['America/Guyana'], 'code': 'GY', 'continent': 'South America', 'name': 'Guyana', 'capital': 'Georgetown'},
- {'timezones': ['America/Tegucigalpa'], 'code': 'HN', 'continent': 'North America', 'name': 'Honduras', 'capital': 'Tegucigalpa'},
- {'timezones': ['Europe/Budapest'], 'code': 'HU', 'continent': 'Europe', 'name': 'Hungary', 'capital': 'Budapest'},
- {'timezones': ['Asia/Jakarta', 'Asia/Pontianak', 'Asia/Makassar', 'Asia/Jayapura'], 'code': 'ID', 'continent': 'Asia', 'name': 'Indonesia', 'capital': 'Jakarta'},
- {'timezones': ['Europe/Dublin'], 'code': 'IE', 'continent': 'Europe', 'name': 'Republic of Ireland', 'capital': 'Dublin'},
- {'timezones': ['Asia/Jerusalem'], 'code': 'IL', 'continent': 'Asia', 'name': 'Israel', 'capital': 'Jerusalem'},
- {'timezones': ['Asia/Calcutta'], 'code': 'IN', 'continent': 'Asia', 'name': 'India', 'capital': 'New Delhi'},
- {'timezones': ['Asia/Baghdad'], 'code': 'IQ', 'continent': 'Asia', 'name': 'Iraq', 'capital': 'Baghdad'},
- {'timezones': ['Asia/Tehran'], 'code': 'IR', 'continent': 'Asia', 'name': 'Iran', 'capital': 'Tehran'},
- {'timezones': ['Atlantic/Reykjavik'], 'code': 'IS', 'continent': 'Europe', 'name': 'Iceland', 'capital': 'Reykjav\xc3\xadk'},
- {'timezones': ['Europe/Rome'], 'code': 'IT', 'continent': 'Europe', 'name': 'Italy', 'capital': 'Rome'},
- {'timezones': ['America/Jamaica'], 'code': 'JM', 'continent': 'North America', 'name': 'Jamaica', 'capital': 'Kingston'},
- {'timezones': ['Asia/Amman'], 'code': 'JO', 'continent': 'Asia', 'name': 'Jordan', 'capital': 'Amman'},
- {'timezones': ['Asia/Tokyo'], 'code': 'JP', 'continent': 'Asia', 'name': 'Japan', 'capital': 'Tokyo'},
- {'timezones': ['Africa/Nairobi'], 'code': 'KE', 'continent': 'Africa', 'name': 'Kenya', 'capital': 'Nairobi'},
- {'timezones': ['Asia/Bishkek'], 'code': 'KG', 'continent': 'Asia', 'name': 'Kyrgyzstan', 'capital': 'Bishkek'},
- {'timezones': ['Pacific/Tarawa', 'Pacific/Enderbury', 'Pacific/Kiritimati'], 'code': 'KI', 'continent': 'Oceania', 'name': 'Kiribati', 'capital': 'Tarawa'},
- {'timezones': ['Asia/Pyongyang'], 'code': 'KP', 'continent': 'Asia', 'name': 'North Korea', 'capital': 'Pyongyang'},
- {'timezones': ['Asia/Seoul'], 'code': 'KR', 'continent': 'Asia', 'name': 'South Korea', 'capital': 'Seoul'},
- {'timezones': ['Asia/Kuwait'], 'code': 'KW', 'continent': 'Asia', 'name': 'Kuwait', 'capital': 'Kuwait City'},
- {'timezones': ['Asia/Beirut'], 'code': 'LB', 'continent': 'Asia', 'name': 'Lebanon', 'capital': 'Beirut'},
- {'timezones': ['Europe/Vaduz'], 'code': 'LI', 'continent': 'Europe', 'name': 'Liechtenstein', 'capital': 'Vaduz'},
- {'timezones': ['Africa/Monrovia'], 'code': 'LR', 'continent': 'Africa', 'name': 'Liberia', 'capital': 'Monrovia'},
- {'timezones': ['Africa/Maseru'], 'code': 'LS', 'continent': 'Africa', 'name': 'Lesotho', 'capital': 'Maseru'},
- {'timezones': ['Europe/Vilnius'], 'code': 'LT', 'continent': 'Europe', 'name': 'Lithuania', 'capital': 'Vilnius'},
- {'timezones': ['Europe/Luxembourg'], 'code': 'LU', 'continent': 'Europe', 'name': 'Luxembourg', 'capital': 'Luxembourg City'},
- {'timezones': ['Europe/Riga'], 'code': 'LV', 'continent': 'Europe', 'name': 'Latvia', 'capital': 'Riga'},
- {'timezones': ['Africa/Tripoli'], 'code': 'LY', 'continent': 'Africa', 'name': 'Libya', 'capital': 'Tripoli'},
- {'timezones': ['Indian/Antananarivo'], 'code': 'MG', 'continent': 'Africa', 'name': 'Madagascar', 'capital': 'Antananarivo'},
- {'timezones': ['Pacific/Majuro', 'Pacific/Kwajalein'], 'code': 'MH', 'continent': 'Oceania', 'name': 'Marshall Islands', 'capital': 'Majuro'},
- {'timezones': ['Europe/Skopje'], 'code': 'MK', 'continent': 'Europe', 'name': 'Macedonia', 'capital': 'Skopje'},
- {'timezones': ['Africa/Bamako'], 'code': 'ML', 'continent': 'Africa', 'name': 'Mali', 'capital': 'Bamako'},
- {'timezones': ['Asia/Rangoon'], 'code': 'MM', 'continent': 'Asia', 'name': 'Myanmar', 'capital': 'Naypyidaw'},
- {'timezones': ['Asia/Ulaanbaatar', 'Asia/Hovd', 'Asia/Choibalsan'], 'code': 'MN', 'continent': 'Asia', 'name': 'Mongolia', 'capital': 'Ulaanbaatar'},
- {'timezones': ['Africa/Nouakchott'], 'code': 'MR', 'continent': 'Africa', 'name': 'Mauritania', 'capital': 'Nouakchott'},
- {'timezones': ['Europe/Malta'], 'code': 'MT', 'continent': 'Europe', 'name': 'Malta', 'capital': 'Valletta'},
- {'timezones': ['Indian/Mauritius'], 'code': 'MU', 'continent': 'Africa', 'name': 'Mauritius', 'capital': 'Port Louis'},
- {'timezones': ['Indian/Maldives'], 'code': 'MV', 'continent': 'Asia', 'name': 'Maldives', 'capital': 'Mal\xc3\xa9'},
- {'timezones': ['Africa/Blantyre'], 'code': 'MW', 'continent': 'Africa', 'name': 'Malawi', 'capital': 'Lilongwe'},
- {'timezones': ['America/Mexico_City', 'America/Cancun', 'America/Merida', 'America/Monterrey', 'America/Mazatlan', 'America/Chihuahua', 'America/Hermosillo', 'America/Tijuana'], 'code': 'MX', 'continent': 'North America', 'name': 'Mexico', 'capital': 'Mexico City'},
- {'timezones': ['Asia/Kuala_Lumpur', 'Asia/Kuching'], 'code': 'MY', 'continent': 'Asia', 'name': 'Malaysia', 'capital': 'Kuala Lumpur'},
- {'timezones': ['Africa/Maputo'], 'code': 'MZ', 'continent': 'Africa', 'name': 'Mozambique', 'capital': 'Maputo'},
- {'timezones': ['Africa/Windhoek'], 'code': 'NA', 'continent': 'Africa', 'name': 'Namibia', 'capital': 'Windhoek'},
- {'timezones': ['Africa/Niamey'], 'code': 'NE', 'continent': 'Africa', 'name': 'Niger', 'capital': 'Niamey'},
- {'timezones': ['Africa/Lagos'], 'code': 'NG', 'continent': 'Africa', 'name': 'Nigeria', 'capital': 'Abuja'},
- {'timezones': ['America/Managua'], 'code': 'NI', 'continent': 'North America', 'name': 'Nicaragua', 'capital': 'Managua'},
- {'timezones': ['Europe/Amsterdam'], 'code': 'NL', 'continent': 'Europe', 'name': 'Kingdom of the Netherlands', 'capital': 'Amsterdam'},
- {'timezones': ['Europe/Oslo'], 'code': 'NO', 'continent': 'Europe', 'name': 'Norway', 'capital': 'Oslo'},
- {'timezones': ['Asia/Katmandu'], 'code': 'NP', 'continent': 'Asia', 'name': 'Nepal', 'capital': 'Kathmandu'},
- {'timezones': ['Pacific/Nauru'], 'code': 'NR', 'continent': 'Oceania', 'name': 'Nauru', 'capital': 'Yaren'},
- {'timezones': ['Pacific/Auckland', 'Pacific/Chatham'], 'code': 'NZ', 'continent': 'Oceania', 'name': 'New Zealand', 'capital': 'Wellington'},
- {'timezones': ['Asia/Muscat'], 'code': 'OM', 'continent': 'Asia', 'name': 'Oman', 'capital': 'Muscat'},
- {'timezones': ['America/Panama'], 'code': 'PA', 'continent': 'North America', 'name': 'Panama', 'capital': 'Panama City'},
- {'timezones': ['America/Lima'], 'code': 'PE', 'continent': 'South America', 'name': 'Peru', 'capital': 'Lima'},
- {'timezones': ['Pacific/Port_Moresby'], 'code': 'PG', 'continent': 'Oceania', 'name': 'Papua New Guinea', 'capital': 'Port Moresby'},
- {'timezones': ['Asia/Manila'], 'code': 'PH', 'continent': 'Asia', 'name': 'Philippines', 'capital': 'Manila'},
- {'timezones': ['Asia/Karachi'], 'code': 'PK', 'continent': 'Asia', 'name': 'Pakistan', 'capital': 'Islamabad'},
- {'timezones': ['Europe/Warsaw'], 'code': 'PL', 'continent': 'Europe', 'name': 'Poland', 'capital': 'Warsaw'},
- {'timezones': ['Europe/Lisbon', 'Atlantic/Madeira', 'Atlantic/Azores'], 'code': 'PT', 'continent': 'Europe', 'name': 'Portugal', 'capital': 'Lisbon'},
- {'timezones': ['Pacific/Palau'], 'code': 'PW', 'continent': 'Oceania', 'name': 'Palau', 'capital': 'Ngerulmud'},
- {'timezones': ['America/Asuncion'], 'code': 'PY', 'continent': 'South America', 'name': 'Paraguay', 'capital': 'Asunci\xc3\xb3n'},
- {'timezones': ['Asia/Qatar'], 'code': 'QA', 'continent': 'Asia', 'name': 'Qatar', 'capital': 'Doha'},
- {'timezones': ['Europe/Bucharest'], 'code': 'RO', 'continent': 'Europe', 'name': 'Romania', 'capital': 'Bucharest'},
- {'timezones': ['Europe/Kaliningrad', 'Europe/Moscow', 'Europe/Volgograd', 'Europe/Samara', 'Asia/Yekaterinburg', 'Asia/Omsk', 'Asia/Novosibirsk', 'Asia/Krasnoyarsk', 'Asia/Irkutsk', 'Asia/Yakutsk', 'Asia/Vladivostok', 'Asia/Sakhalin', 'Asia/Magadan', 'Asia/Kamchatka', 'Asia/Anadyr'], 'code': 'RU', 'continent': 'Europe', 'name': 'Russia', 'capital': 'Moscow'},
- {'timezones': ['Africa/Kigali'], 'code': 'RW', 'continent': 'Africa', 'name': 'Rwanda', 'capital': 'Kigali'},
- {'timezones': ['Asia/Riyadh'], 'code': 'SA', 'continent': 'Asia', 'name': 'Saudi Arabia', 'capital': 'Riyadh'},
- {'timezones': ['Pacific/Guadalcanal'], 'code': 'SB', 'continent': 'Oceania', 'name': 'Solomon Islands', 'capital': 'Honiara'},
- {'timezones': ['Indian/Mahe'], 'code': 'SC', 'continent': 'Africa', 'name': 'Seychelles', 'capital': 'Victoria'},
- {'timezones': ['Africa/Khartoum'], 'code': 'SD', 'continent': 'Africa', 'name': 'Sudan', 'capital': 'Khartoum'},
- {'timezones': ['Europe/Stockholm'], 'code': 'SE', 'continent': 'Europe', 'name': 'Sweden', 'capital': 'Stockholm'},
- {'timezones': ['Asia/Singapore'], 'code': 'SG', 'continent': 'Asia', 'name': 'Singapore', 'capital': 'Singapore'},
- {'timezones': ['Europe/Ljubljana'], 'code': 'SI', 'continent': 'Europe', 'name': 'Slovenia', 'capital': 'Ljubljana'},
- {'timezones': ['Europe/Bratislava'], 'code': 'SK', 'continent': 'Europe', 'name': 'Slovakia', 'capital': 'Bratislava'},
- {'timezones': ['Africa/Freetown'], 'code': 'SL', 'continent': 'Africa', 'name': 'Sierra Leone', 'capital': 'Freetown'},
- {'timezones': ['Europe/San_Marino'], 'code': 'SM', 'continent': 'Europe', 'name': 'San Marino', 'capital': 'San Marino'},
- {'timezones': ['Africa/Dakar'], 'code': 'SN', 'continent': 'Africa', 'name': 'Senegal', 'capital': 'Dakar'},
- {'timezones': ['Africa/Mogadishu'], 'code': 'SO', 'continent': 'Africa', 'name': 'Somalia', 'capital': 'Mogadishu'},
- {'timezones': ['America/Paramaribo'], 'code': 'SR', 'continent': 'South America', 'name': 'Suriname', 'capital': 'Paramaribo'},
- {'timezones': ['Africa/Sao_Tome'], 'code': 'ST', 'continent': 'Africa', 'name': 'S\xc3\xa3o Tom\xc3\xa9 and Pr\xc3\xadncipe', 'capital': 'S\xc3\xa3o Tom\xc3\xa9'},
- {'timezones': ['Asia/Damascus'], 'code': 'SY', 'continent': 'Asia', 'name': 'Syria', 'capital': 'Damascus'},
- {'timezones': ['Africa/Lome'], 'code': 'TG', 'continent': 'Africa', 'name': 'Togo', 'capital': 'Lom\xc3\xa9'},
- {'timezones': ['Asia/Bangkok'], 'code': 'TH', 'continent': 'Asia', 'name': 'Thailand', 'capital': 'Bangkok'},
- {'timezones': ['Asia/Dushanbe'], 'code': 'TJ', 'continent': 'Asia', 'name': 'Tajikistan', 'capital': 'Dushanbe'},
- {'timezones': ['Asia/Ashgabat'], 'code': 'TM', 'continent': 'Asia', 'name': 'Turkmenistan', 'capital': 'Ashgabat'},
- {'timezones': ['Africa/Tunis'], 'code': 'TN', 'continent': 'Africa', 'name': 'Tunisia', 'capital': 'Tunis'},
- {'timezones': ['Pacific/Tongatapu'], 'code': 'TO', 'continent': 'Oceania', 'name': 'Tonga', 'capital': 'Nuku\xca\xbbalofa'},
- {'timezones': ['Europe/Istanbul'], 'code': 'TR', 'continent': 'Asia', 'name': 'Turkey', 'capital': 'Ankara'},
- {'timezones': ['America/Port_of_Spain'], 'code': 'TT', 'continent': 'North America', 'name': 'Trinidad and Tobago', 'capital': 'Port of Spain'},
- {'timezones': ['Pacific/Funafuti'], 'code': 'TV', 'continent': 'Oceania', 'name': 'Tuvalu', 'capital': 'Funafuti'},
- {'timezones': ['Africa/Dar_es_Salaam'], 'code': 'TZ', 'continent': 'Africa', 'name': 'Tanzania', 'capital': 'Dodoma'},
- {'timezones': ['Europe/Kiev', 'Europe/Uzhgorod', 'Europe/Zaporozhye', 'Europe/Simferopol'], 'code': 'UA', 'continent': 'Europe', 'name': 'Ukraine', 'capital': 'Kiev'},
- {'timezones': ['Africa/Kampala'], 'code': 'UG', 'continent': 'Africa', 'name': 'Uganda', 'capital': 'Kampala'},
- {'timezones': ['America/New_York', 'America/Detroit', 'America/Kentucky/Louisville', 'America/Kentucky/Monticello', 'America/Indiana/Indianapolis', 'America/Indiana/Marengo', 'America/Indiana/Knox', 'America/Indiana/Vevay', 'America/Chicago', 'America/Indiana/Vincennes', 'America/Indiana/Petersburg', 'America/Menominee', 'America/North_Dakota/Center', 'America/North_Dakota/New_Salem', 'America/Denver', 'America/Boise', 'America/Shiprock', 'America/Phoenix', 'America/Los_Angeles', 'America/Anchorage', 'America/Juneau', 'America/Yakutat', 'America/Nome', 'America/Adak', 'Pacific/Honolulu'], 'code': 'US', 'continent': 'North America', 'name': 'United States', 'capital': 'Washington, D.C.'},
- {'timezones': ['America/Montevideo'], 'code': 'UY', 'continent': 'South America', 'name': 'Uruguay', 'capital': 'Montevideo'},
- {'timezones': ['Asia/Samarkand', 'Asia/Tashkent'], 'code': 'UZ', 'continent': 'Asia', 'name': 'Uzbekistan', 'capital': 'Tashkent'},
- {'timezones': ['Europe/Vatican'], 'code': 'VA', 'continent': 'Europe', 'name': 'Vatican City', 'capital': 'Vatican City'},
- {'timezones': ['America/Caracas'], 'code': 'VE', 'continent': 'South America', 'name': 'Venezuela', 'capital': 'Caracas'},
- {'timezones': ['Asia/Saigon'], 'code': 'VN', 'continent': 'Asia', 'name': 'Vietnam', 'capital': 'Hanoi'},
- {'timezones': ['Pacific/Efate'], 'code': 'VU', 'continent': 'Oceania', 'name': 'Vanuatu', 'capital': 'Port Vila'},
- {'timezones': ['Asia/Aden'], 'code': 'YE', 'continent': 'Asia', 'name': 'Yemen', 'capital': "Sana'a"},
- {'timezones': ['Africa/Lusaka'], 'code': 'ZM', 'continent': 'Africa', 'name': 'Zambia', 'capital': 'Lusaka'},
- {'timezones': ['Africa/Harare'], 'code': 'ZW', 'continent': 'Africa', 'name': 'Zimbabwe', 'capital': 'Harare'},
- {'timezones': ['Africa/Algiers'], 'code': 'DZ', 'continent': 'Africa', 'name': 'Algeria', 'capital': 'Algiers'},
- {'timezones': ['Europe/Sarajevo'], 'code': 'BA', 'continent': 'Europe', 'name': 'Bosnia and Herzegovina', 'capital': 'Sarajevo'},
- {'timezones': ['Asia/Phnom_Penh'], 'code': 'KH', 'continent': 'Asia', 'name': 'Cambodia', 'capital': 'Phnom Penh'},
- {'timezones': ['Africa/Bangui'], 'code': 'CF', 'continent': 'Africa', 'name': 'Central African Republic', 'capital': 'Bangui'},
- {'timezones': ['Africa/Ndjamena'], 'code': 'TD', 'continent': 'Africa', 'name': 'Chad', 'capital': "N'Djamena"},
- {'timezones': ['Indian/Comoro'], 'code': 'KM', 'continent': 'Africa', 'name': 'Comoros', 'capital': 'Moroni'},
- {'timezones': ['Europe/Zagreb'], 'code': 'HR', 'continent': 'Europe', 'name': 'Croatia', 'capital': 'Zagreb'},
- {'timezones': ['Asia/Dili'], 'code': 'TL', 'continent': 'Asia', 'name': 'East Timor', 'capital': 'Dili'},
- {'timezones': ['America/El_Salvador'], 'code': 'SV', 'continent': 'North America', 'name': 'El Salvador', 'capital': 'San Salvador'},
- {'timezones': ['Africa/Malabo'], 'code': 'GQ', 'continent': 'Africa', 'name': 'Equatorial Guinea', 'capital': 'Malabo'},
- {'timezones': ['America/Grenada'], 'code': 'GD', 'continent': 'North America', 'name': 'Grenada', 'capital': "St. George's"},
- {'timezones': ['Asia/Almaty', 'Asia/Qyzylorda', 'Asia/Aqtobe', 'Asia/Aqtau', 'Asia/Oral'], 'code': 'KZ', 'continent': 'Asia', 'name': 'Kazakhstan', 'capital': 'Astana'},
- {'timezones': ['Asia/Vientiane'], 'code': 'LA', 'continent': 'Asia', 'name': 'Laos', 'capital': 'Vientiane'},
- {'timezones': ['Pacific/Truk', 'Pacific/Ponape', 'Pacific/Kosrae'], 'code': 'FM', 'continent': 'Oceania', 'name': 'Federated States of Micronesia', 'capital': 'Palikir'},
- {'timezones': ['Europe/Chisinau'], 'code': 'MD', 'continent': 'Europe', 'name': 'Moldova', 'capital': 'Chi\xc5\x9fin\xc4\x83u'},
- {'timezones': ['Europe/Monaco'], 'code': 'MC', 'continent': 'Europe', 'name': 'Monaco', 'capital': 'Monaco'},
- {'timezones': ['Europe/Podgorica'], 'code': 'ME', 'continent': 'Europe', 'name': 'Montenegro', 'capital': 'Podgorica'},
- {'timezones': ['Africa/Casablanca'], 'code': 'MA', 'continent': 'Africa', 'name': 'Morocco', 'capital': 'Rabat'},
- {'timezones': ['America/St_Kitts'], 'code': 'KN', 'continent': 'North America', 'name': 'Saint Kitts and Nevis', 'capital': 'Basseterre'},
- {'timezones': ['America/St_Lucia'], 'code': 'LC', 'continent': 'North America', 'name': 'Saint Lucia', 'capital': 'Castries'},
- {'timezones': ['America/St_Vincent'], 'code': 'VC', 'continent': 'North America', 'name': 'Saint Vincent and the Grenadines', 'capital': 'Kingstown'},
- {'timezones': ['Pacific/Apia'], 'code': 'WS', 'continent': 'Oceania', 'name': 'Samoa', 'capital': 'Apia'},
- {'timezones': ['Europe/Belgrade'], 'code': 'RS', 'continent': 'Europe', 'name': 'Serbia', 'capital': 'Belgrade'},
- {'timezones': ['Africa/Johannesburg'], 'code': 'ZA', 'continent': 'Africa', 'name': 'South Africa', 'capital': 'Pretoria'},
- {'timezones': ['Europe/Madrid', 'Africa/Ceuta', 'Atlantic/Canary'], 'code': 'ES', 'continent': 'Europe', 'name': 'Spain', 'capital': 'Madrid'},
- {'timezones': ['Asia/Colombo'], 'code': 'LK', 'continent': 'Asia', 'name': 'Sri Lanka', 'capital': 'Sri Jayewardenepura Kotte'},
- {'timezones': ['Africa/Mbabane'], 'code': 'SZ', 'continent': 'Africa', 'name': 'Swaziland', 'capital': 'Mbabane'},
- {'timezones': ['Europe/Zurich'], 'code': 'CH', 'continent': 'Europe', 'name': 'Switzerland', 'capital': 'Bern'},
- {'timezones': ['Asia/Dubai'], 'code': 'AE', 'continent': 'Asia', 'name': 'United Arab Emirates', 'capital': 'Abu Dhabi'},
- {'timezones': ['Europe/London'], 'code': 'GB', 'continent': 'Europe', 'name': 'United Kingdom', 'capital': 'London'},
- ]
+ centuries = [
+ 'I',
+ 'II',
+ 'III',
+ 'IV',
+ 'V',
+ 'VI',
+ 'VII',
+ 'VIII',
+ 'IX',
+ 'X',
+ 'XI',
+ 'XII',
+ 'XIII',
+ 'XIV',
+ 'XV',
+ 'XVI',
+ 'XVII',
+ 'XVIII',
+ 'XIX',
+ 'XX',
+ 'XXI']
+
+ countries = [{'timezones': ['Europe/Andorra'],
+ 'alpha-2-code': 'AD',
+ 'alpha-3-code': 'AND',
+ 'continent': 'Europe',
+ 'name': 'Andorra',
+ 'capital': 'Andorra la Vella'},
+ {'timezones': ['Asia/Kabul'],
+ 'alpha-2-code': 'AF',
+ 'alpha-3-code': 'AFG',
+ 'continent': 'Asia',
+ 'name': 'Afghanistan',
+ 'capital': 'Kabul'},
+ {'timezones': ['America/Antigua'],
+ 'alpha-2-code': 'AG',
+ 'alpha-3-code': 'ATG',
+ 'continent': 'North America',
+ 'name': 'Antigua and Barbuda',
+ 'capital': "St. John's"},
+ {'timezones': ['Europe/Tirane'],
+ 'alpha-2-code': 'AL',
+ 'alpha-3-code': 'ALB',
+ 'continent': 'Europe',
+ 'name': 'Albania',
+ 'capital': 'Tirana'},
+ {'timezones': ['Asia/Yerevan'],
+ 'alpha-2-code': 'AM',
+ 'alpha-3-code': 'ARM',
+ 'continent': 'Asia',
+ 'name': 'Armenia',
+ 'capital': 'Yerevan'},
+ {'timezones': ['Africa/Luanda'],
+ 'alpha-2-code': 'AO',
+ 'alpha-3-code': 'AGO',
+ 'continent': 'Africa',
+ 'name': 'Angola',
+ 'capital': 'Luanda'},
+ {'timezones': ['America/Argentina/Buenos_Aires',
+ 'America/Argentina/Cordoba',
+ 'America/Argentina/Jujuy',
+ 'America/Argentina/Tucuman',
+ 'America/Argentina/Catamarca',
+ 'America/Argentina/La_Rioja',
+ 'America/Argentina/San_Juan',
+ 'America/Argentina/Mendoza',
+ 'America/Argentina/Rio_Gallegos',
+ 'America/Argentina/Ushuaia'],
+ 'alpha-2-code': 'AR',
+ 'alpha-3-code': 'ARG',
+ 'continent': 'South America',
+ 'name': 'Argentina',
+ 'capital': 'Buenos Aires'},
+ {'timezones': ['Europe/Vienna'],
+ 'alpha-2-code': 'AT',
+ 'alpha-3-code': 'AUT',
+ 'continent': 'Europe',
+ 'name': 'Austria',
+ 'capital': 'Vienna'},
+ {'timezones': ['Australia/Lord_Howe',
+ 'Australia/Hobart',
+ 'Australia/Currie',
+ 'Australia/Melbourne',
+ 'Australia/Sydney',
+ 'Australia/Broken_Hill',
+ 'Australia/Brisbane',
+ 'Australia/Lindeman',
+ 'Australia/Adelaide',
+ 'Australia/Darwin',
+ 'Australia/Perth'],
+ 'alpha-2-code': 'AU',
+ 'alpha-3-code': 'AUS',
+ 'continent': 'Oceania',
+ 'name': 'Australia',
+ 'capital': 'Canberra'},
+ {'timezones': ['Asia/Baku'],
+ 'alpha-2-code': 'AZ',
+ 'alpha-3-code': 'AZE',
+ 'continent': 'Asia',
+ 'name': 'Azerbaijan',
+ 'capital': 'Baku'},
+ {'timezones': ['America/Barbados'],
+ 'alpha-2-code': 'BB',
+ 'alpha-3-code': 'BRB',
+ 'continent': 'North America',
+ 'name': 'Barbados',
+ 'capital': 'Bridgetown'},
+ {'timezones': ['Asia/Dhaka'],
+ 'alpha-2-code': 'BD',
+ 'alpha-3-code': 'BGD',
+ 'continent': 'Asia',
+ 'name': 'Bangladesh',
+ 'capital': 'Dhaka'},
+ {'timezones': ['Europe/Brussels'],
+ 'alpha-2-code': 'BE',
+ 'alpha-3-code': 'BEL',
+ 'continent': 'Europe',
+ 'name': 'Belgium',
+ 'capital': 'Brussels'},
+ {'timezones': ['Africa/Ouagadougou'],
+ 'alpha-2-code': 'BF',
+ 'alpha-3-code': 'BFA',
+ 'continent': 'Africa',
+ 'name': 'Burkina Faso',
+ 'capital': 'Ouagadougou'},
+ {'timezones': ['Europe/Sofia'],
+ 'alpha-2-code': 'BG',
+ 'alpha-3-code': 'BGR',
+ 'continent': 'Europe',
+ 'name': 'Bulgaria',
+ 'capital': 'Sofia'},
+ {'timezones': ['Asia/Bahrain'],
+ 'alpha-2-code': 'BH',
+ 'alpha-3-code': 'BHR',
+ 'continent': 'Asia',
+ 'name': 'Bahrain',
+ 'capital': 'Manama'},
+ {'timezones': ['Africa/Bujumbura'],
+ 'alpha-2-code': 'BI',
+ 'alpha-3-code': 'BDI',
+ 'continent': 'Africa',
+ 'name': 'Burundi',
+ 'capital': 'Bujumbura'},
+ {'timezones': ['Africa/Porto-Novo'],
+ 'alpha-2-code': 'BJ',
+ 'alpha-3-code': 'BEN',
+ 'continent': 'Africa',
+ 'name': 'Benin',
+ 'capital': 'Porto-Novo'},
+ {'timezones': ['Asia/Brunei'],
+ 'alpha-2-code': 'BN',
+ 'alpha-3-code': 'BRN',
+ 'continent': 'Asia',
+ 'name': 'Brunei Darussalam',
+ 'capital': 'Bandar Seri Begawan'},
+ {'timezones': ['America/La_Paz'],
+ 'alpha-2-code': 'BO',
+ 'alpha-3-code': 'BOL',
+ 'continent': 'South America',
+ 'name': 'Bolivia',
+ 'capital': 'Sucre'},
+ {'timezones': ['America/Noronha',
+ 'America/Belem',
+ 'America/Fortaleza',
+ 'America/Recife',
+ 'America/Araguaina',
+ 'America/Maceio',
+ 'America/Bahia',
+ 'America/Sao_Paulo',
+ 'America/Campo_Grande',
+ 'America/Cuiaba',
+ 'America/Porto_Velho',
+ 'America/Boa_Vista',
+ 'America/Manaus',
+ 'America/Eirunepe',
+ 'America/Rio_Branco'],
+ 'alpha-2-code': 'BR',
+ 'alpha-3-code': 'BRA',
+ 'continent': 'South America',
+ 'name': 'Brazil',
+ 'capital': 'Bras\xc3\xadlia'},
+ {'timezones': ['America/Nassau'],
+ 'alpha-2-code': 'BS',
+ 'alpha-3-code': 'BHS',
+ 'continent': 'North America',
+ 'name': 'Bahamas',
+ 'capital': 'Nassau'},
+ {'timezones': ['Asia/Thimphu'],
+ 'alpha-2-code': 'BT',
+ 'alpha-3-code': 'BTN',
+ 'continent': 'Asia',
+ 'name': 'Bhutan',
+ 'capital': 'Thimphu'},
+ {'timezones': ['Africa/Gaborone'],
+ 'alpha-2-code': 'BW',
+ 'alpha-3-code': 'BWA',
+ 'continent': 'Africa',
+ 'name': 'Botswana',
+ 'capital': 'Gaborone'},
+ {'timezones': ['Europe/Minsk'],
+ 'alpha-2-code': 'BY',
+ 'alpha-3-code': 'BLR',
+ 'continent': 'Europe',
+ 'name': 'Belarus',
+ 'capital': 'Minsk'},
+ {'timezones': ['America/Belize'],
+ 'alpha-2-code': 'BZ',
+ 'alpha-3-code': 'BLZ',
+ 'continent': 'North America',
+ 'name': 'Belize',
+ 'capital': 'Belmopan'},
+ {'timezones': ['America/St_Johns',
+ 'America/Halifax',
+ 'America/Glace_Bay',
+ 'America/Moncton',
+ 'America/Goose_Bay',
+ 'America/Blanc-Sablon',
+ 'America/Montreal',
+ 'America/Toronto',
+ 'America/Nipigon',
+ 'America/Thunder_Bay',
+ 'America/Pangnirtung',
+ 'America/Iqaluit',
+ 'America/Atikokan',
+ 'America/Rankin_Inlet',
+ 'America/Winnipeg',
+ 'America/Rainy_River',
+ 'America/Cambridge_Bay',
+ 'America/Regina',
+ 'America/Swift_Current',
+ 'America/Edmonton',
+ 'America/Yellowknife',
+ 'America/Inuvik',
+ 'America/Dawson_Creek',
+ 'America/Vancouver',
+ 'America/Whitehorse',
+ 'America/Dawson'],
+ 'alpha-2-code': 'CA',
+ 'alpha-3-code': 'CAN',
+ 'continent': 'North America',
+ 'name': 'Canada',
+ 'capital': 'Ottawa'},
+ {'timezones': ['Africa/Kinshasa',
+ 'Africa/Lubumbashi'],
+ 'alpha-2-code': 'CD',
+ 'alpha-3-code': 'COD',
+ 'continent': 'Africa',
+ 'name': 'Democratic Republic of the Congo',
+ 'capital': 'Kinshasa'},
+ {'timezones': ['Africa/Brazzaville'],
+ 'alpha-2-code': 'CG',
+ 'alpha-3-code': 'COG',
+ 'continent': 'Africa',
+ 'name': 'Republic of the Congo',
+ 'capital': 'Brazzaville'},
+ {'timezones': ['Africa/Abidjan'],
+ 'alpha-2-code': 'CI',
+ 'alpha-3-code': 'CIV',
+ 'continent': 'Africa',
+ 'name': "C\xc3\xb4te d'Ivoire",
+ 'capital': 'Yamoussoukro'},
+ {'timezones': ['America/Santiago',
+ 'Pacific/Easter'],
+ 'alpha-2-code': 'CL',
+ 'alpha-3-code': 'CHL',
+ 'continent': 'South America',
+ 'name': 'Chile',
+ 'capital': 'Santiago'},
+ {'timezones': ['Africa/Douala'],
+ 'alpha-2-code': 'CM',
+ 'alpha-3-code': 'CMR',
+ 'continent': 'Africa',
+ 'name': 'Cameroon',
+ 'capital': 'Yaound\xc3\xa9'},
+ {'timezones': ['Asia/Shanghai',
+ 'Asia/Harbin',
+ 'Asia/Chongqing',
+ 'Asia/Urumqi',
+ 'Asia/Kashgar'],
+ 'alpha-2-code': 'CN',
+ 'alpha-3-code': 'CHN',
+ 'continent': 'Asia',
+ 'name': "People's Republic of China",
+ 'capital': 'Beijing'},
+ {'timezones': ['America/Bogota'],
+ 'alpha-2-code': 'CO',
+ 'alpha-3-code': 'COL',
+ 'continent': 'South America',
+ 'name': 'Colombia',
+ 'capital': 'Bogot\xc3\xa1'},
+ {'timezones': ['America/Costa_Rica'],
+ 'alpha-2-code': 'CR',
+ 'alpha-3-code': 'CRI',
+ 'continent': 'North America',
+ 'name': 'Costa Rica',
+ 'capital': 'San Jos\xc3\xa9'},
+ {'timezones': ['America/Havana'],
+ 'alpha-2-code': 'CU',
+ 'alpha-3-code': 'CUB',
+ 'continent': 'North America',
+ 'name': 'Cuba',
+ 'capital': 'Havana'},
+ {'timezones': ['Atlantic/Cape_Verde'],
+ 'alpha-2-code': 'CV',
+ 'alpha-3-code': 'CPV',
+ 'continent': 'Africa',
+ 'name': 'Cape Verde',
+ 'capital': 'Praia'},
+ {'timezones': ['Asia/Nicosia'],
+ 'alpha-2-code': 'CY',
+ 'alpha-3-code': 'CYP',
+ 'continent': 'Asia',
+ 'name': 'Cyprus',
+ 'capital': 'Nicosia'},
+ {'timezones': ['Europe/Prague'],
+ 'alpha-2-code': 'CZ',
+ 'alpha-3-code': 'CZE',
+ 'continent': 'Europe',
+ 'name': 'Czech Republic',
+ 'capital': 'Prague'},
+ {'timezones': ['Europe/Berlin'],
+ 'alpha-2-code': 'DE',
+ 'alpha-3-code': 'DEU',
+ 'continent': 'Europe',
+ 'name': 'Germany',
+ 'capital': 'Berlin'},
+ {'timezones': ['Africa/Djibouti'],
+ 'alpha-2-code': 'DJ',
+ 'alpha-3-code': 'DJI',
+ 'continent': 'Africa',
+ 'name': 'Djibouti',
+ 'capital': 'Djibouti City'},
+ {'timezones': ['Europe/Copenhagen'],
+ 'alpha-2-code': 'DK',
+ 'alpha-3-code': 'DNK',
+ 'continent': 'Europe',
+ 'name': 'Denmark',
+ 'capital': 'Copenhagen'},
+ {'timezones': ['America/Dominica'],
+ 'alpha-2-code': 'DM',
+ 'alpha-3-code': 'DMA',
+ 'continent': 'North America',
+ 'name': 'Dominica',
+ 'capital': 'Roseau'},
+ {'timezones': ['America/Santo_Domingo'],
+ 'alpha-2-code': 'DO',
+ 'alpha-3-code': 'DOM',
+ 'continent': 'North America',
+ 'name': 'Dominican Republic',
+ 'capital': 'Santo Domingo'},
+ {'timezones': ['America/Guayaquil',
+ 'Pacific/Galapagos'],
+ 'alpha-2-code': 'EC',
+ 'alpha-3-code': 'ECU',
+ 'continent': 'South America',
+ 'name': 'Ecuador',
+ 'capital': 'Quito'},
+ {'timezones': ['Europe/Tallinn'],
+ 'alpha-2-code': 'EE',
+ 'alpha-3-code': 'EST',
+ 'continent': 'Europe',
+ 'name': 'Estonia',
+ 'capital': 'Tallinn'},
+ {'timezones': ['Africa/Cairo'],
+ 'alpha-2-code': 'EG',
+ 'alpha-3-code': 'EGY',
+ 'continent': 'Africa',
+ 'name': 'Egypt',
+ 'capital': 'Cairo'},
+ {'timezones': ['Africa/Asmera'],
+ 'alpha-2-code': 'ER',
+ 'alpha-3-code': 'ERI',
+ 'continent': 'Africa',
+ 'name': 'Eritrea',
+ 'capital': 'Asmara'},
+ {'timezones': ['Africa/Addis_Ababa'],
+ 'alpha-2-code': 'ET',
+ 'alpha-3-code': 'ETH',
+ 'continent': 'Africa',
+ 'name': 'Ethiopia',
+ 'capital': 'Addis Ababa'},
+ {'timezones': ['Europe/Helsinki'],
+ 'alpha-2-code': 'FI',
+ 'alpha-3-code': 'FIN',
+ 'continent': 'Europe',
+ 'name': 'Finland',
+ 'capital': 'Helsinki'},
+ {'timezones': ['Pacific/Fiji'],
+ 'alpha-2-code': 'FJ',
+ 'alpha-3-code': 'FJI',
+ 'continent': 'Oceania',
+ 'name': 'Fiji',
+ 'capital': 'Suva'},
+ {'timezones': ['Europe/Paris'],
+ 'alpha-2-code': 'FR',
+ 'alpha-3-code': 'FRA',
+ 'continent': 'Europe',
+ 'name': 'France',
+ 'capital': 'Paris'},
+ {'timezones': ['Africa/Libreville'],
+ 'alpha-2-code': 'GA',
+ 'alpha-3-code': 'GAB',
+ 'continent': 'Africa',
+ 'name': 'Gabon',
+ 'capital': 'Libreville'},
+ {'timezones': ['Asia/Tbilisi'],
+ 'alpha-2-code': 'GE',
+ 'alpha-3-code': 'GEO',
+ 'continent': 'Asia',
+ 'name': 'Georgia',
+ 'capital': 'Tbilisi'},
+ {'timezones': ['Africa/Accra'],
+ 'alpha-2-code': 'GH',
+ 'alpha-3-code': 'GHA',
+ 'continent': 'Africa',
+ 'name': 'Ghana',
+ 'capital': 'Accra'},
+ {'timezones': ['Africa/Banjul'],
+ 'alpha-2-code': 'GM',
+ 'alpha-3-code': 'GMB',
+ 'continent': 'Africa',
+ 'name': 'The Gambia',
+ 'capital': 'Banjul'},
+ {'timezones': ['Africa/Conakry'],
+ 'alpha-2-code': 'GN',
+ 'alpha-3-code': 'GIN',
+ 'continent': 'Africa',
+ 'name': 'Guinea',
+ 'capital': 'Conakry'},
+ {'timezones': ['Europe/Athens'],
+ 'alpha-2-code': 'GR',
+ 'alpha-3-code': 'GRC',
+ 'continent': 'Europe',
+ 'name': 'Greece',
+ 'capital': 'Athens'},
+ {'timezones': ['America/Guatemala'],
+ 'alpha-2-code': 'GT',
+ 'alpha-3-code': 'GTM',
+ 'continent': 'North America',
+ 'name': 'Guatemala',
+ 'capital': 'Guatemala City'},
+ {'timezones': ['America/Guatemala'],
+ 'alpha-2-code': 'HT',
+ 'alpha-3-code': 'HTI',
+ 'continent': 'North America',
+ 'name': 'Haiti',
+ 'capital': 'Port-au-Prince'},
+ {'timezones': ['Africa/Bissau'],
+ 'alpha-2-code': 'GW',
+ 'alpha-3-code': 'GNB',
+ 'continent': 'Africa',
+ 'name': 'Guinea-Bissau',
+ 'capital': 'Bissau'},
+ {'timezones': ['America/Guyana'],
+ 'alpha-2-code': 'GY',
+ 'alpha-3-code': 'GUY',
+ 'continent': 'South America',
+ 'name': 'Guyana',
+ 'capital': 'Georgetown'},
+ {'timezones': ['America/Tegucigalpa'],
+ 'alpha-2-code': 'HN',
+ 'alpha-3-code': 'HND',
+ 'continent': 'North America',
+ 'name': 'Honduras',
+ 'capital': 'Tegucigalpa'},
+ {'timezones': ['Europe/Budapest'],
+ 'alpha-2-code': 'HU',
+ 'alpha-3-code': 'HUN',
+ 'continent': 'Europe',
+ 'name': 'Hungary',
+ 'capital': 'Budapest'},
+ {'timezones': ['Asia/Jakarta',
+ 'Asia/Pontianak',
+ 'Asia/Makassar',
+ 'Asia/Jayapura'],
+ 'alpha-2-code': 'ID',
+ 'alpha-3-code': 'IDN',
+ 'continent': 'Asia',
+ 'name': 'Indonesia',
+ 'capital': 'Jakarta'},
+ {'timezones': ['Europe/Dublin'],
+ 'alpha-2-code': 'IE',
+ 'alpha-3-code': 'IRL',
+ 'continent': 'Europe',
+ 'name': 'Republic of Ireland',
+ 'capital': 'Dublin'},
+ {'timezones': ['Asia/Jerusalem'],
+ 'alpha-2-code': 'IL',
+ 'alpha-3-code': 'ISR',
+ 'continent': 'Asia',
+ 'name': 'Israel',
+ 'capital': 'Jerusalem'},
+ {'timezones': ['Asia/Calcutta'],
+ 'alpha-2-code': 'IN',
+ 'alpha-3-code': 'IND',
+ 'continent': 'Asia',
+ 'name': 'India',
+ 'capital': 'New Delhi'},
+ {'timezones': ['Asia/Baghdad'],
+ 'alpha-2-code': 'IQ',
+ 'alpha-3-code': 'IRQ',
+ 'continent': 'Asia',
+ 'name': 'Iraq',
+ 'capital': 'Baghdad'},
+ {'timezones': ['Asia/Tehran'],
+ 'alpha-2-code': 'IR',
+ 'alpha-3-code': 'IRN',
+ 'continent': 'Asia',
+ 'name': 'Iran',
+ 'capital': 'Tehran'},
+ {'timezones': ['Atlantic/Reykjavik'],
+ 'alpha-2-code': 'IS',
+ 'alpha-3-code': 'ISL',
+ 'continent': 'Europe',
+ 'name': 'Iceland',
+ 'capital': 'Reykjav\xc3\xadk'},
+ {'timezones': ['Europe/Rome'],
+ 'alpha-2-code': 'IT',
+ 'alpha-3-code': 'ITA',
+ 'continent': 'Europe',
+ 'name': 'Italy',
+ 'capital': 'Rome'},
+ {'timezones': ['America/Jamaica'],
+ 'alpha-2-code': 'JM',
+ 'alpha-3-code': 'JAM',
+ 'continent': 'North America',
+ 'name': 'Jamaica',
+ 'capital': 'Kingston'},
+ {'timezones': ['Asia/Amman'],
+ 'alpha-2-code': 'JO',
+ 'alpha-3-code': 'JOR',
+ 'continent': 'Asia',
+ 'name': 'Jordan',
+ 'capital': 'Amman'},
+ {'timezones': ['Asia/Tokyo'],
+ 'alpha-2-code': 'JP',
+ 'alpha-3-code': 'JPN',
+ 'continent': 'Asia',
+ 'name': 'Japan',
+ 'capital': 'Tokyo'},
+ {'timezones': ['Africa/Nairobi'],
+ 'alpha-2-code': 'KE',
+ 'alpha-3-code': 'KEN',
+ 'continent': 'Africa',
+ 'name': 'Kenya',
+ 'capital': 'Nairobi'},
+ {'timezones': ['Asia/Bishkek'],
+ 'alpha-2-code': 'KG',
+ 'alpha-3-code': 'KGZ',
+ 'continent': 'Asia',
+ 'name': 'Kyrgyzstan',
+ 'capital': 'Bishkek'},
+ {'timezones': ['Pacific/Tarawa',
+ 'Pacific/Enderbury',
+ 'Pacific/Kiritimati'],
+ 'alpha-2-code': 'KI',
+ 'alpha-3-code': 'KIR',
+ 'continent': 'Oceania',
+ 'name': 'Kiribati',
+ 'capital': 'Tarawa'},
+ {'timezones': ['Asia/Pyongyang'],
+ 'alpha-2-code': 'KP',
+ 'alpha-3-code': 'PRK',
+ 'continent': 'Asia',
+ 'name': 'North Korea',
+ 'capital': 'Pyongyang'},
+ {'timezones': ['Asia/Seoul'],
+ 'alpha-2-code': 'KR',
+ 'alpha-3-code': 'KOR',
+ 'continent': 'Asia',
+ 'name': 'South Korea',
+ 'capital': 'Seoul'},
+ {'timezones': ['Asia/Kuwait'],
+ 'alpha-2-code': 'KW',
+ 'alpha-3-code': 'KWT',
+ 'continent': 'Asia',
+ 'name': 'Kuwait',
+ 'capital': 'Kuwait City'},
+ {'timezones': ['Asia/Beirut'],
+ 'alpha-2-code': 'LB',
+ 'alpha-3-code': 'LBN',
+ 'continent': 'Asia',
+ 'name': 'Lebanon',
+ 'capital': 'Beirut'},
+ {'timezones': ['Europe/Vaduz'],
+ 'alpha-2-code': 'LI',
+ 'alpha-3-code': 'LIE',
+ 'continent': 'Europe',
+ 'name': 'Liechtenstein',
+ 'capital': 'Vaduz'},
+ {'timezones': ['Africa/Monrovia'],
+ 'alpha-2-code': 'LR',
+ 'alpha-3-code': 'LBR',
+ 'continent': 'Africa',
+ 'name': 'Liberia',
+ 'capital': 'Monrovia'},
+ {'timezones': ['Africa/Maseru'],
+ 'alpha-2-code': 'LS',
+ 'alpha-3-code': 'LSO',
+ 'continent': 'Africa',
+ 'name': 'Lesotho',
+ 'capital': 'Maseru'},
+ {'timezones': ['Europe/Vilnius'],
+ 'alpha-2-code': 'LT',
+ 'alpha-3-code': 'LTU',
+ 'continent': 'Europe',
+ 'name': 'Lithuania',
+ 'capital': 'Vilnius'},
+ {'timezones': ['Europe/Luxembourg'],
+ 'alpha-2-code': 'LU',
+ 'alpha-3-code': 'LUX',
+ 'continent': 'Europe',
+ 'name': 'Luxembourg',
+ 'capital': 'Luxembourg City'},
+ {'timezones': ['Europe/Riga'],
+ 'alpha-2-code': 'LV',
+ 'alpha-3-code': 'LVA',
+ 'continent': 'Europe',
+ 'name': 'Latvia',
+ 'capital': 'Riga'},
+ {'timezones': ['Africa/Tripoli'],
+ 'alpha-2-code': 'LY',
+ 'alpha-3-code': 'LBY',
+ 'continent': 'Africa',
+ 'name': 'Libya',
+ 'capital': 'Tripoli'},
+ {'timezones': ['Indian/Antananarivo'],
+ 'alpha-2-code': 'MG',
+ 'alpha-3-code': 'MDG',
+ 'continent': 'Africa',
+ 'name': 'Madagascar',
+ 'capital': 'Antananarivo'},
+ {'timezones': ['Pacific/Majuro',
+ 'Pacific/Kwajalein'],
+ 'alpha-2-code': 'MH',
+ 'alpha-3-code': 'MHL',
+ 'continent': 'Oceania',
+ 'name': 'Marshall Islands',
+ 'capital': 'Majuro'},
+ {'timezones': ['Europe/Skopje'],
+ 'alpha-2-code': 'MK',
+ 'alpha-3-code': 'MKD',
+ 'continent': 'Europe',
+ 'name': 'Macedonia',
+ 'capital': 'Skopje'},
+ {'timezones': ['Africa/Bamako'],
+ 'alpha-2-code': 'ML',
+ 'alpha-3-code': 'MLI',
+ 'continent': 'Africa',
+ 'name': 'Mali',
+ 'capital': 'Bamako'},
+ {'timezones': ['Asia/Rangoon'],
+ 'alpha-2-code': 'MM',
+ 'alpha-3-code': 'MMR',
+ 'continent': 'Asia',
+ 'name': 'Myanmar',
+ 'capital': 'Naypyidaw'},
+ {'timezones': ['Asia/Ulaanbaatar',
+ 'Asia/Hovd',
+ 'Asia/Choibalsan'],
+ 'alpha-2-code': 'MN',
+ 'alpha-3-code': 'MNG',
+ 'continent': 'Asia',
+ 'name': 'Mongolia',
+ 'capital': 'Ulaanbaatar'},
+ {'timezones': ['Africa/Nouakchott'],
+ 'alpha-2-code': 'MR',
+ 'alpha-3-code': 'MRT',
+ 'continent': 'Africa',
+ 'name': 'Mauritania',
+ 'capital': 'Nouakchott'},
+ {'timezones': ['Europe/Malta'],
+ 'alpha-2-code': 'MT',
+ 'alpha-3-code': 'MLT',
+ 'continent': 'Europe',
+ 'name': 'Malta',
+ 'capital': 'Valletta'},
+ {'timezones': ['Indian/Mauritius'],
+ 'alpha-2-code': 'MU',
+ 'alpha-3-code': 'MUS',
+ 'continent': 'Africa',
+ 'name': 'Mauritius',
+ 'capital': 'Port Louis'},
+ {'timezones': ['Indian/Maldives'],
+ 'alpha-2-code': 'MV',
+ 'alpha-3-code': 'MDV',
+ 'continent': 'Asia',
+ 'name': 'Maldives',
+ 'capital': 'Mal\xc3\xa9'},
+ {'timezones': ['Africa/Blantyre'],
+ 'alpha-2-code': 'MW',
+ 'alpha-3-code': 'MWI',
+ 'continent': 'Africa',
+ 'name': 'Malawi',
+ 'capital': 'Lilongwe'},
+ {'timezones': ['America/Mexico_City',
+ 'America/Cancun',
+ 'America/Merida',
+ 'America/Monterrey',
+ 'America/Mazatlan',
+ 'America/Chihuahua',
+ 'America/Hermosillo',
+ 'America/Tijuana'],
+ 'alpha-2-code': 'MX',
+ 'alpha-3-code': 'MEX',
+ 'continent': 'North America',
+ 'name': 'Mexico',
+ 'capital': 'Mexico City'},
+ {'timezones': ['Asia/Kuala_Lumpur',
+ 'Asia/Kuching'],
+ 'alpha-2-code': 'MY',
+ 'alpha-3-code': 'MYS',
+ 'continent': 'Asia',
+ 'name': 'Malaysia',
+ 'capital': 'Kuala Lumpur'},
+ {'timezones': ['Africa/Maputo'],
+ 'alpha-2-code': 'MZ',
+ 'alpha-3-code': 'MOZ',
+ 'continent': 'Africa',
+ 'name': 'Mozambique',
+ 'capital': 'Maputo'},
+ {'timezones': ['Africa/Windhoek'],
+ 'alpha-2-code': 'NA',
+ 'alpha-3-code': 'NAM',
+ 'continent': 'Africa',
+ 'name': 'Namibia',
+ 'capital': 'Windhoek'},
+ {'timezones': ['Africa/Niamey'],
+ 'alpha-2-code': 'NE',
+ 'alpha-3-code': 'NER',
+ 'continent': 'Africa',
+ 'name': 'Niger',
+ 'capital': 'Niamey'},
+ {'timezones': ['Africa/Lagos'],
+ 'alpha-2-code': 'NG',
+ 'alpha-3-code': 'NGA',
+ 'continent': 'Africa',
+ 'name': 'Nigeria',
+ 'capital': 'Abuja'},
+ {'timezones': ['America/Managua'],
+ 'alpha-2-code': 'NI',
+ 'alpha-3-code': 'NIC',
+ 'continent': 'North America',
+ 'name': 'Nicaragua',
+ 'capital': 'Managua'},
+ {'timezones': ['Europe/Amsterdam'],
+ 'alpha-2-code': 'NL',
+ 'alpha-3-code': 'NLD',
+ 'continent': 'Europe',
+ 'name': 'Kingdom of the Netherlands',
+ 'capital': 'Amsterdam'},
+ {'timezones': ['Europe/Oslo'],
+ 'alpha-2-code': 'NO',
+ 'alpha-3-code': 'NOR',
+ 'continent': 'Europe',
+ 'name': 'Norway',
+ 'capital': 'Oslo'},
+ {'timezones': ['Asia/Katmandu'],
+ 'alpha-2-code': 'NP',
+ 'alpha-3-code': 'NPL',
+ 'continent': 'Asia',
+ 'name': 'Nepal',
+ 'capital': 'Kathmandu'},
+ {'timezones': ['Pacific/Nauru'],
+ 'alpha-2-code': 'NR',
+ 'alpha-3-code': 'NRU',
+ 'continent': 'Oceania',
+ 'name': 'Nauru',
+ 'capital': 'Yaren'},
+ {'timezones': ['Pacific/Auckland',
+ 'Pacific/Chatham'],
+ 'alpha-2-code': 'NZ',
+ 'alpha-3-code': 'NZL',
+ 'continent': 'Oceania',
+ 'name': 'New Zealand',
+ 'capital': 'Wellington'},
+ {'timezones': ['Asia/Muscat'],
+ 'alpha-2-code': 'OM',
+ 'alpha-3-code': 'OMN',
+ 'continent': 'Asia',
+ 'name': 'Oman',
+ 'capital': 'Muscat'},
+ {'timezones': ['America/Panama'],
+ 'alpha-2-code': 'PA',
+ 'alpha-3-code': 'PAN',
+ 'continent': 'North America',
+ 'name': 'Panama',
+ 'capital': 'Panama City'},
+ {'timezones': ['America/Lima'],
+ 'alpha-2-code': 'PE',
+ 'alpha-3-code': 'PER',
+ 'continent': 'South America',
+ 'name': 'Peru',
+ 'capital': 'Lima'},
+ {'timezones': ['Pacific/Port_Moresby'],
+ 'alpha-2-code': 'PG',
+ 'alpha-3-code': 'PNG',
+ 'continent': 'Oceania',
+ 'name': 'Papua New Guinea',
+ 'capital': 'Port Moresby'},
+ {'timezones': ['Asia/Manila'],
+ 'alpha-2-code': 'PH',
+ 'alpha-3-code': 'PHL',
+ 'continent': 'Asia',
+ 'name': 'Philippines',
+ 'capital': 'Manila'},
+ {'timezones': ['Asia/Karachi'],
+ 'alpha-2-code': 'PK',
+ 'alpha-3-code': 'PAK',
+ 'continent': 'Asia',
+ 'name': 'Pakistan',
+ 'capital': 'Islamabad'},
+ {'timezones': ['Europe/Warsaw'],
+ 'alpha-2-code': 'PL',
+ 'alpha-3-code': 'POL',
+ 'continent': 'Europe',
+ 'name': 'Poland',
+ 'capital': 'Warsaw'},
+ {'timezones': ['Europe/Lisbon',
+ 'Atlantic/Madeira',
+ 'Atlantic/Azores'],
+ 'alpha-2-code': 'PT',
+ 'alpha-3-code': 'PRT',
+ 'continent': 'Europe',
+ 'name': 'Portugal',
+ 'capital': 'Lisbon'},
+ {'timezones': ['Pacific/Palau'],
+ 'alpha-2-code': 'PW',
+ 'alpha-3-code': 'PLW',
+ 'continent': 'Oceania',
+ 'name': 'Palau',
+ 'capital': 'Ngerulmud'},
+ {'timezones': ['America/Asuncion'],
+ 'alpha-2-code': 'PY',
+ 'alpha-3-code': 'PRY',
+ 'continent': 'South America',
+ 'name': 'Paraguay',
+ 'capital': 'Asunci\xc3\xb3n'},
+ {'timezones': ['Asia/Qatar'],
+ 'alpha-2-code': 'QA',
+ 'alpha-3-code': 'QAT',
+ 'continent': 'Asia',
+ 'name': 'Qatar',
+ 'capital': 'Doha'},
+ {'timezones': ['Europe/Bucharest'],
+ 'alpha-2-code': 'RO',
+ 'alpha-3-code': 'ROU',
+ 'continent': 'Europe',
+ 'name': 'Romania',
+ 'capital': 'Bucharest'},
+ {'timezones': ['Europe/Kaliningrad',
+ 'Europe/Moscow',
+ 'Europe/Volgograd',
+ 'Europe/Samara',
+ 'Asia/Yekaterinburg',
+ 'Asia/Omsk',
+ 'Asia/Novosibirsk',
+ 'Asia/Krasnoyarsk',
+ 'Asia/Irkutsk',
+ 'Asia/Yakutsk',
+ 'Asia/Vladivostok',
+ 'Asia/Sakhalin',
+ 'Asia/Magadan',
+ 'Asia/Kamchatka',
+ 'Asia/Anadyr'],
+ 'alpha-2-code': 'RU',
+ 'alpha-3-code': 'RUS',
+ 'continent': 'Europe',
+ 'name': 'Russia',
+ 'capital': 'Moscow'},
+ {'timezones': ['Africa/Kigali'],
+ 'alpha-2-code': 'RW',
+ 'alpha-3-code': 'RWA',
+ 'continent': 'Africa',
+ 'name': 'Rwanda',
+ 'capital': 'Kigali'},
+ {'timezones': ['Asia/Riyadh'],
+ 'alpha-2-code': 'SA',
+ 'alpha-3-code': 'SAU',
+ 'continent': 'Asia',
+ 'name': 'Saudi Arabia',
+ 'capital': 'Riyadh'},
+ {'timezones': ['Pacific/Guadalcanal'],
+ 'alpha-2-code': 'SB',
+ 'alpha-3-code': 'SLB',
+ 'continent': 'Oceania',
+ 'name': 'Solomon Islands',
+ 'capital': 'Honiara'},
+ {'timezones': ['Indian/Mahe'],
+ 'alpha-2-code': 'SC',
+ 'alpha-3-code': 'SYC',
+ 'continent': 'Africa',
+ 'name': 'Seychelles',
+ 'capital': 'Victoria'},
+ {'timezones': ['Africa/Khartoum'],
+ 'alpha-2-code': 'SD',
+ 'alpha-3-code': 'SDN',
+ 'continent': 'Africa',
+ 'name': 'Sudan',
+ 'capital': 'Khartoum'},
+ {'timezones': ['Europe/Stockholm'],
+ 'alpha-2-code': 'SE',
+ 'alpha-3-code': 'SWE',
+ 'continent': 'Europe',
+ 'name': 'Sweden',
+ 'capital': 'Stockholm'},
+ {'timezones': ['Asia/Singapore'],
+ 'alpha-2-code': 'SG',
+ 'alpha-3-code': 'SGP',
+ 'continent': 'Asia',
+ 'name': 'Singapore',
+ 'capital': 'Singapore'},
+ {'timezones': ['Europe/Ljubljana'],
+ 'alpha-2-code': 'SI',
+ 'alpha-3-code': 'SVN',
+ 'continent': 'Europe',
+ 'name': 'Slovenia',
+ 'capital': 'Ljubljana'},
+ {'timezones': ['Europe/Bratislava'],
+ 'alpha-2-code': 'SK',
+ 'alpha-3-code': 'SVK',
+ 'continent': 'Europe',
+ 'name': 'Slovakia',
+ 'capital': 'Bratislava'},
+ {'timezones': ['Africa/Freetown'],
+ 'alpha-2-code': 'SL',
+ 'alpha-3-code': 'SLE',
+ 'continent': 'Africa',
+ 'name': 'Sierra Leone',
+ 'capital': 'Freetown'},
+ {'timezones': ['Europe/San_Marino'],
+ 'alpha-2-code': 'SM',
+ 'alpha-3-code': 'SMR',
+ 'continent': 'Europe',
+ 'name': 'San Marino',
+ 'capital': 'San Marino'},
+ {'timezones': ['Africa/Dakar'],
+ 'alpha-2-code': 'SN',
+ 'alpha-3-code': 'SEN',
+ 'continent': 'Africa',
+ 'name': 'Senegal',
+ 'capital': 'Dakar'},
+ {'timezones': ['Africa/Mogadishu'],
+ 'alpha-2-code': 'SO',
+ 'alpha-3-code': 'SOM',
+ 'continent': 'Africa',
+ 'name': 'Somalia',
+ 'capital': 'Mogadishu'},
+ {'timezones': ['America/Paramaribo'],
+ 'alpha-2-code': 'SR',
+ 'alpha-3-code': 'SUR',
+ 'continent': 'South America',
+ 'name': 'Suriname',
+ 'capital': 'Paramaribo'},
+ {'timezones': ['Africa/Sao_Tome'],
+ 'alpha-2-code': 'ST',
+ 'alpha-3-code': 'STP',
+ 'continent': 'Africa',
+ 'name': 'S\xc3\xa3o Tom\xc3\xa9 and Pr\xc3\xadncipe',
+ 'capital': 'S\xc3\xa3o Tom\xc3\xa9'},
+ {'timezones': ['Asia/Damascus'],
+ 'alpha-2-code': 'SY',
+ 'alpha-3-code': 'SYR',
+ 'continent': 'Asia',
+ 'name': 'Syria',
+ 'capital': 'Damascus'},
+ {'timezones': ['Africa/Lome'],
+ 'alpha-2-code': 'TG',
+ 'alpha-3-code': 'TGO',
+ 'continent': 'Africa',
+ 'name': 'Togo',
+ 'capital': 'Lom\xc3\xa9'},
+ {'timezones': ['Asia/Bangkok'],
+ 'alpha-2-code': 'TH',
+ 'alpha-3-code': 'THA',
+ 'continent': 'Asia',
+ 'name': 'Thailand',
+ 'capital': 'Bangkok'},
+ {'timezones': ['Asia/Dushanbe'],
+ 'alpha-2-code': 'TJ',
+ 'alpha-3-code': 'TJK',
+ 'continent': 'Asia',
+ 'name': 'Tajikistan',
+ 'capital': 'Dushanbe'},
+ {'timezones': ['Asia/Ashgabat'],
+ 'alpha-2-code': 'TM',
+ 'alpha-3-code': 'TKM',
+ 'continent': 'Asia',
+ 'name': 'Turkmenistan',
+ 'capital': 'Ashgabat'},
+ {'timezones': ['Africa/Tunis'],
+ 'alpha-2-code': 'TN',
+ 'alpha-3-code': 'TUN',
+ 'continent': 'Africa',
+ 'name': 'Tunisia',
+ 'capital': 'Tunis'},
+ {'timezones': ['Pacific/Tongatapu'],
+ 'alpha-2-code': 'TO',
+ 'alpha-3-code': 'TON',
+ 'continent': 'Oceania',
+ 'name': 'Tonga',
+ 'capital': 'Nuku\xca\xbbalofa'},
+ {'timezones': ['Europe/Istanbul'],
+ 'alpha-2-code': 'TR',
+ 'alpha-3-code': 'TUR',
+ 'continent': 'Asia',
+ 'name': 'Turkey',
+ 'capital': 'Ankara'},
+ {'timezones': ['America/Port_of_Spain'],
+ 'alpha-2-code': 'TT',
+ 'alpha-3-code': 'TTO',
+ 'continent': 'North America',
+ 'name': 'Trinidad and Tobago',
+ 'capital': 'Port of Spain'},
+ {'timezones': ['Pacific/Funafuti'],
+ 'alpha-2-code': 'TV',
+ 'alpha-3-code': 'TUV',
+ 'continent': 'Oceania',
+ 'name': 'Tuvalu',
+ 'capital': 'Funafuti'},
+ {'timezones': ['Africa/Dar_es_Salaam'],
+ 'alpha-2-code': 'TZ',
+ 'alpha-3-code': 'TZA',
+ 'continent': 'Africa',
+ 'name': 'Tanzania',
+ 'capital': 'Dodoma'},
+ {'timezones': ['Europe/Kiev',
+ 'Europe/Uzhgorod',
+ 'Europe/Zaporozhye',
+ 'Europe/Simferopol'],
+ 'alpha-2-code': 'UA',
+ 'alpha-3-code': 'UKR',
+ 'continent': 'Europe',
+ 'name': 'Ukraine',
+ 'capital': 'Kiev'},
+ {'timezones': ['Africa/Kampala'],
+ 'alpha-2-code': 'UG',
+ 'alpha-3-code': 'UGA',
+ 'continent': 'Africa',
+ 'name': 'Uganda',
+ 'capital': 'Kampala'},
+ {'timezones': ['America/New_York',
+ 'America/Detroit',
+ 'America/Kentucky/Louisville',
+ 'America/Kentucky/Monticello',
+ 'America/Indiana/Indianapolis',
+ 'America/Indiana/Marengo',
+ 'America/Indiana/Knox',
+ 'America/Indiana/Vevay',
+ 'America/Chicago',
+ 'America/Indiana/Vincennes',
+ 'America/Indiana/Petersburg',
+ 'America/Menominee',
+ 'America/North_Dakota/Center',
+ 'America/North_Dakota/New_Salem',
+ 'America/Denver',
+ 'America/Boise',
+ 'America/Shiprock',
+ 'America/Phoenix',
+ 'America/Los_Angeles',
+ 'America/Anchorage',
+ 'America/Juneau',
+ 'America/Yakutat',
+ 'America/Nome',
+ 'America/Adak',
+ 'Pacific/Honolulu'],
+ 'alpha-2-code': 'US',
+ 'alpha-3-code': 'USA',
+ 'continent': 'North America',
+ 'name': 'United States',
+ 'capital': 'Washington, D.C.'},
+ {'timezones': ['America/Montevideo'],
+ 'alpha-2-code': 'UY',
+ 'alpha-3-code': 'URY',
+ 'continent': 'South America',
+ 'name': 'Uruguay',
+ 'capital': 'Montevideo'},
+ {'timezones': ['Asia/Samarkand',
+ 'Asia/Tashkent'],
+ 'alpha-2-code': 'UZ',
+ 'alpha-3-code': 'UZB',
+ 'continent': 'Asia',
+ 'name': 'Uzbekistan',
+ 'capital': 'Tashkent'},
+ {'timezones': ['Europe/Vatican'],
+ 'alpha-2-code': 'VA',
+ 'alpha-3-code': 'VAT',
+ 'continent': 'Europe',
+ 'name': 'Vatican City',
+ 'capital': 'Vatican City'},
+ {'timezones': ['America/Caracas'],
+ 'alpha-2-code': 'VE',
+ 'alpha-3-code': 'VEN',
+ 'continent': 'South America',
+ 'name': 'Venezuela',
+ 'capital': 'Caracas'},
+ {'timezones': ['Asia/Saigon'],
+ 'alpha-2-code': 'VN',
+ 'alpha-3-code': 'VNM',
+ 'continent': 'Asia',
+ 'name': 'Vietnam',
+ 'capital': 'Hanoi'},
+ {'timezones': ['Pacific/Efate'],
+ 'alpha-2-code': 'VU',
+ 'alpha-3-code': 'VUT',
+ 'continent': 'Oceania',
+ 'name': 'Vanuatu',
+ 'capital': 'Port Vila'},
+ {'timezones': ['Asia/Aden'],
+ 'alpha-2-code': 'YE',
+ 'alpha-3-code': 'YEM',
+ 'continent': 'Asia',
+ 'name': 'Yemen',
+ 'capital': "Sana'a"},
+ {'timezones': ['Africa/Lusaka'],
+ 'alpha-2-code': 'ZM',
+ 'alpha-3-code': 'ZMB',
+ 'continent': 'Africa',
+ 'name': 'Zambia',
+ 'capital': 'Lusaka'},
+ {'timezones': ['Africa/Harare'],
+ 'alpha-2-code': 'ZW',
+ 'alpha-3-code': 'ZWE',
+ 'continent': 'Africa',
+ 'name': 'Zimbabwe',
+ 'capital': 'Harare'},
+ {'timezones': ['Africa/Algiers'],
+ 'alpha-2-code': 'DZ',
+ 'alpha-3-code': 'DZA',
+ 'continent': 'Africa',
+ 'name': 'Algeria',
+ 'capital': 'Algiers'},
+ {'timezones': ['Europe/Sarajevo'],
+ 'alpha-2-code': 'BA',
+ 'alpha-3-code': 'BIH',
+ 'continent': 'Europe',
+ 'name': 'Bosnia and Herzegovina',
+ 'capital': 'Sarajevo'},
+ {'timezones': ['Asia/Phnom_Penh'],
+ 'alpha-2-code': 'KH',
+ 'alpha-3-code': 'KHM',
+ 'continent': 'Asia',
+ 'name': 'Cambodia',
+ 'capital': 'Phnom Penh'},
+ {'timezones': ['Africa/Bangui'],
+ 'alpha-2-code': 'CF',
+ 'alpha-3-code': 'CAF',
+ 'continent': 'Africa',
+ 'name': 'Central African Republic',
+ 'capital': 'Bangui'},
+ {'timezones': ['Africa/Ndjamena'],
+ 'alpha-2-code': 'TD',
+ 'alpha-3-code': 'TCD',
+ 'continent': 'Africa',
+ 'name': 'Chad',
+ 'capital': "N'Djamena"},
+ {'timezones': ['Indian/Comoro'],
+ 'alpha-2-code': 'KM',
+ 'alpha-3-code': 'COM',
+ 'continent': 'Africa',
+ 'name': 'Comoros',
+ 'capital': 'Moroni'},
+ {'timezones': ['Europe/Zagreb'],
+ 'alpha-2-code': 'HR',
+ 'alpha-3-code': 'HRV',
+ 'continent': 'Europe',
+ 'name': 'Croatia',
+ 'capital': 'Zagreb'},
+ {'timezones': ['Asia/Dili'],
+ 'alpha-2-code': 'TL',
+ 'alpha-3-code': 'TLS',
+ 'continent': 'Asia',
+ 'name': 'East Timor',
+ 'capital': 'Dili'},
+ {'timezones': ['America/El_Salvador'],
+ 'alpha-2-code': 'SV',
+ 'alpha-3-code': 'SLV',
+ 'continent': 'North America',
+ 'name': 'El Salvador',
+ 'capital': 'San Salvador'},
+ {'timezones': ['Africa/Malabo'],
+ 'alpha-2-code': 'GQ',
+ 'alpha-3-code': 'GNQ',
+ 'continent': 'Africa',
+ 'name': 'Equatorial Guinea',
+ 'capital': 'Malabo'},
+ {'timezones': ['America/Grenada'],
+ 'alpha-2-code': 'GD',
+ 'alpha-3-code': 'GRD',
+ 'continent': 'North America',
+ 'name': 'Grenada',
+ 'capital': "St. George's"},
+ {'timezones': ['Asia/Almaty',
+ 'Asia/Qyzylorda',
+ 'Asia/Aqtobe',
+ 'Asia/Aqtau',
+ 'Asia/Oral'],
+ 'alpha-2-code': 'KZ',
+ 'alpha-3-code': 'KAZ',
+ 'continent': 'Asia',
+ 'name': 'Kazakhstan',
+ 'capital': 'Astana'},
+ {'timezones': ['Asia/Vientiane'],
+ 'alpha-2-code': 'LA',
+ 'alpha-3-code': 'LAO',
+ 'continent': 'Asia',
+ 'name': 'Laos',
+ 'capital': 'Vientiane'},
+ {'timezones': ['Pacific/Truk',
+ 'Pacific/Ponape',
+ 'Pacific/Kosrae'],
+ 'alpha-2-code': 'FM',
+ 'alpha-3-code': 'FSM',
+ 'continent': 'Oceania',
+ 'name': 'Federated States of Micronesia',
+ 'capital': 'Palikir'},
+ {'timezones': ['Europe/Chisinau'],
+ 'alpha-2-code': 'MD',
+ 'alpha-3-code': 'MDA',
+ 'continent': 'Europe',
+ 'name': 'Moldova',
+ 'capital': 'Chi\xc5\x9fin\xc4\x83u'},
+ {'timezones': ['Europe/Monaco'],
+ 'alpha-2-code': 'MC',
+ 'alpha-3-code': 'MCO',
+ 'continent': 'Europe',
+ 'name': 'Monaco',
+ 'capital': 'Monaco'},
+ {'timezones': ['Europe/Podgorica'],
+ 'alpha-2-code': 'ME',
+ 'alpha-3-code': 'MNE',
+ 'continent': 'Europe',
+ 'name': 'Montenegro',
+ 'capital': 'Podgorica'},
+ {'timezones': ['Africa/Casablanca'],
+ 'alpha-2-code': 'MA',
+ 'alpha-3-code': 'MAR',
+ 'continent': 'Africa',
+ 'name': 'Morocco',
+ 'capital': 'Rabat'},
+ {'timezones': ['America/St_Kitts'],
+ 'alpha-2-code': 'KN',
+ 'alpha-3-code': 'KNA',
+ 'continent': 'North America',
+ 'name': 'Saint Kitts and Nevis',
+ 'capital': 'Basseterre'},
+ {'timezones': ['America/St_Lucia'],
+ 'alpha-2-code': 'LC',
+ 'alpha-3-code': 'LCA',
+ 'continent': 'North America',
+ 'name': 'Saint Lucia',
+ 'capital': 'Castries'},
+ {'timezones': ['America/St_Vincent'],
+ 'alpha-2-code': 'VC',
+ 'alpha-3-code': 'VCT',
+ 'continent': 'North America',
+ 'name': 'Saint Vincent and the Grenadines',
+ 'capital': 'Kingstown'},
+ {'timezones': ['Pacific/Apia'],
+ 'alpha-2-code': 'WS',
+ 'alpha-3-code': 'WSM',
+ 'continent': 'Oceania',
+ 'name': 'Samoa',
+ 'capital': 'Apia'},
+ {'timezones': ['Europe/Belgrade'],
+ 'alpha-2-code': 'RS',
+ 'alpha-3-code': 'SRB',
+ 'continent': 'Europe',
+ 'name': 'Serbia',
+ 'capital': 'Belgrade'},
+ {'timezones': ['Africa/Johannesburg'],
+ 'alpha-2-code': 'ZA',
+ 'alpha-3-code': 'ZAF',
+ 'continent': 'Africa',
+ 'name': 'South Africa',
+ 'capital': 'Pretoria'},
+ {'timezones': ['Europe/Madrid',
+ 'Africa/Ceuta',
+ 'Atlantic/Canary'],
+ 'alpha-2-code': 'ES',
+ 'alpha-3-code': 'ESP',
+ 'continent': 'Europe',
+ 'name': 'Spain',
+ 'capital': 'Madrid'},
+ {'timezones': ['Asia/Colombo'],
+ 'alpha-2-code': 'LK',
+ 'alpha-3-code': 'LKA',
+ 'continent': 'Asia',
+ 'name': 'Sri Lanka',
+ 'capital': 'Sri Jayewardenepura Kotte'},
+ {'timezones': ['Africa/Mbabane'],
+ 'alpha-2-code': 'SZ',
+ 'alpha-3-code': 'SWZ',
+ 'continent': 'Africa',
+ 'name': 'Swaziland',
+ 'capital': 'Mbabane'},
+ {'timezones': ['Europe/Zurich'],
+ 'alpha-2-code': 'CH',
+ 'alpha-3-code': 'CHE',
+ 'continent': 'Europe',
+ 'name': 'Switzerland',
+ 'capital': 'Bern'},
+ {'timezones': ['Asia/Dubai'],
+ 'alpha-2-code': 'AE',
+ 'alpha-3-code': 'ARE',
+ 'continent': 'Asia',
+ 'name': 'United Arab Emirates',
+ 'capital': 'Abu Dhabi'},
+ {'timezones': ['Europe/London'],
+ 'alpha-2-code': 'GB',
+ 'alpha-3-code': 'GBR',
+ 'continent': 'Europe',
+ 'name': 'United Kingdom',
+ 'capital': 'London'},
+ ]
regex = re.compile(timedelta_pattern)
- def unix_time(self, end_datetime=None):
+ def unix_time(self, end_datetime=None, start_datetime=None):
"""
- Get a timestamp between January 1, 1970 and now
+ Get a timestamp between January 1, 1970 and now, unless passed
+ explicit start_datetime or end_datetime values.
:example 1061306726
"""
+ start_datetime = self._parse_start_datetime(start_datetime)
end_datetime = self._parse_end_datetime(end_datetime)
- return self.generator.random.randint(0, end_datetime)
+ return self.generator.random.randint(start_datetime, end_datetime)
def time_delta(self, end_datetime=None):
"""
@@ -270,34 +1391,44 @@ def date_time(self, tzinfo=None, end_datetime=None):
:return datetime
"""
# NOTE: On windows, the lowest value you can get from windows is 86400
- # on the first day. Known python issue:
+ # on the first day. Known python issue:
# https://bugs.python.org/issue30684
- return datetime(1970, 1, 1,tzinfo=tzinfo) + timedelta(seconds=self.unix_time(end_datetime=end_datetime))
+ return datetime(1970, 1, 1, tzinfo=tzinfo) + \
+ timedelta(seconds=self.unix_time(end_datetime=end_datetime))
- def date_time_ad(self, tzinfo=None, end_datetime=None):
+ def date_time_ad(self, tzinfo=None, end_datetime=None, start_datetime=None):
"""
Get a datetime object for a date between January 1, 001 and now
:param tzinfo: timezone, instance of datetime.tzinfo subclass
:example DateTime('1265-03-22 21:15:52')
:return datetime
"""
+
+ # 1970-01-01 00:00:00 UTC minus 62135596800 seconds is
+ # 0001-01-01 00:00:00 UTC. Since _parse_end_datetime() is used
+ # elsewhere where a default value of 0 is expected, we can't
+ # simply change that class method to use this magic number as a
+ # default value when None is provided.
+
+ start_time = -62135596800 if start_datetime is None else self._parse_start_datetime(start_datetime)
end_datetime = self._parse_end_datetime(end_datetime)
- ts = self.generator.random.randint(-62135600400, end_datetime)
+
+ ts = self.generator.random.randint(start_time, end_datetime)
# NOTE: using datetime.fromtimestamp(ts) directly will raise
# a "ValueError: timestamp out of range for platform time_t"
# on some platforms due to system C functions;
# see http://stackoverflow.com/a/10588133/2315612
# NOTE: On windows, the lowest value you can get from windows is 86400
- # on the first day. Known python issue:
+ # on the first day. Known python issue:
# https://bugs.python.org/issue30684
- return datetime(1970, 1, 1,tzinfo=tzinfo) + timedelta(seconds=ts)
+ return datetime(1970, 1, 1, tzinfo=tzinfo) + timedelta(seconds=ts)
def iso8601(self, tzinfo=None, end_datetime=None):
"""
:param tzinfo: timezone, instance of datetime.tzinfo subclass
:example '2003-10-21T16:05:52+0000'
"""
- return self.date_time(tzinfo,end_datetime=end_datetime).isoformat()
+ return self.date_time(tzinfo, end_datetime=end_datetime).isoformat()
def date(self, pattern='%Y-%m-%d', end_datetime=None):
"""
@@ -314,21 +1445,29 @@ def date_object(self, end_datetime=None):
"""
return self.date_time(end_datetime=end_datetime).date()
- def time(self, pattern='%H:%M:%S', end_datetime = None):
+ def time(self, pattern='%H:%M:%S', end_datetime=None):
"""
Get a time string (24h format by default)
:param pattern format
:example '15:02:34'
"""
- return self.date_time(end_datetime=end_datetime).time().strftime(pattern)
+ return self.date_time(
+ end_datetime=end_datetime).time().strftime(pattern)
- def time_object(self, end_datetime = None):
+ def time_object(self, end_datetime=None):
"""
Get a time object
:example datetime.time(15, 56, 56, 772876)
"""
return self.date_time(end_datetime=end_datetime).time()
-
+
+ @classmethod
+ def _parse_start_datetime(cls, value):
+ if value is None:
+ return 0
+
+ return cls._parse_date_time(value)
+
@classmethod
def _parse_end_datetime(cls, value):
if value is None:
@@ -343,9 +1482,9 @@ def _parse_date_string(cls, value):
raise ParseError("Can't parse date string `{}`.".format(value))
parts = parts.groupdict()
time_params = {}
- for (name, param) in parts.items():
- if param:
- time_params[name] = int(param)
+ for (name_, param_) in parts.items():
+ if param_:
+ time_params[name_] = int(param_)
if 'years' in time_params:
if 'days' not in time_params:
@@ -414,8 +1553,16 @@ def date_time_between(self, start_date='-30y', end_date='now', tzinfo=None):
"""
start_date = self._parse_date_time(start_date, tzinfo=tzinfo)
end_date = self._parse_date_time(end_date, tzinfo=tzinfo)
- ts = self.generator.random.randint(start_date, end_date)
- return datetime(1970, 1, 1,tzinfo=tzinfo) + timedelta(seconds=ts)
+ if end_date - start_date <= 1:
+ ts = start_date + self.generator.random.random()
+ else:
+ ts = self.generator.random.randint(start_date, end_date)
+ if tzinfo is None:
+ return datetime(1970, 1, 1, tzinfo=tzinfo) + timedelta(seconds=ts)
+ else:
+ return (
+ datetime(1970, 1, 1, tzinfo=tzutc()) + timedelta(seconds=ts)
+ ).astimezone(tzinfo)
def date_between(self, start_date='-30y', end_date='today'):
"""
@@ -488,7 +1635,11 @@ def past_date(self, start_date='-30d', tzinfo=None):
"""
return self.date_between(start_date=start_date, end_date='-1d')
- def date_time_between_dates(self, datetime_start=None, datetime_end=None, tzinfo=None):
+ def date_time_between_dates(
+ self,
+ datetime_start=None,
+ datetime_end=None,
+ tzinfo=None):
"""
Takes two DateTime objects and returns a random datetime between the two
given datetimes.
@@ -528,7 +1679,11 @@ def date_between_dates(self, date_start=None, date_end=None):
"""
return self.date_time_between_dates(date_start, date_end).date()
- def date_time_this_century(self, before_now=True, after_now=False, tzinfo=None):
+ def date_time_this_century(
+ self,
+ before_now=True,
+ after_now=False,
+ tzinfo=None):
"""
Gets a DateTime object for the current century.
@@ -539,11 +1694,14 @@ def date_time_this_century(self, before_now=True, after_now=False, tzinfo=None):
:return DateTime
"""
now = datetime.now(tzinfo)
- this_century_start = datetime(now.year - (now.year % 100), 1, 1, tzinfo=tzinfo)
- next_century_start = datetime(this_century_start.year + 100, 1, 1, tzinfo=tzinfo)
+ this_century_start = datetime(
+ now.year - (now.year % 100), 1, 1, tzinfo=tzinfo)
+ next_century_start = datetime(
+ min(this_century_start.year + 100, MAXYEAR), 1, 1, tzinfo=tzinfo)
if before_now and after_now:
- return self.date_time_between_dates(this_century_start, next_century_start, tzinfo)
+ return self.date_time_between_dates(
+ this_century_start, next_century_start, tzinfo)
elif not before_now and after_now:
return self.date_time_between_dates(now, next_century_start, tzinfo)
elif not after_now and before_now:
@@ -551,7 +1709,11 @@ def date_time_this_century(self, before_now=True, after_now=False, tzinfo=None):
else:
return now
- def date_time_this_decade(self, before_now=True, after_now=False, tzinfo=None):
+ def date_time_this_decade(
+ self,
+ before_now=True,
+ after_now=False,
+ tzinfo=None):
"""
Gets a DateTime object for the decade year.
@@ -562,11 +1724,14 @@ def date_time_this_decade(self, before_now=True, after_now=False, tzinfo=None):
:return DateTime
"""
now = datetime.now(tzinfo)
- this_decade_start = datetime(now.year - (now.year % 10), 1, 1, tzinfo=tzinfo)
- next_decade_start = datetime(this_decade_start.year + 10, 1, 1, tzinfo=tzinfo)
+ this_decade_start = datetime(
+ now.year - (now.year % 10), 1, 1, tzinfo=tzinfo)
+ next_decade_start = datetime(
+ min(this_decade_start.year + 10, MAXYEAR), 1, 1, tzinfo=tzinfo)
if before_now and after_now:
- return self.date_time_between_dates(this_decade_start, next_decade_start, tzinfo)
+ return self.date_time_between_dates(
+ this_decade_start, next_decade_start, tzinfo)
elif not before_now and after_now:
return self.date_time_between_dates(now, next_decade_start, tzinfo)
elif not after_now and before_now:
@@ -574,7 +1739,11 @@ def date_time_this_decade(self, before_now=True, after_now=False, tzinfo=None):
else:
return now
- def date_time_this_year(self, before_now=True, after_now=False, tzinfo=None):
+ def date_time_this_year(
+ self,
+ before_now=True,
+ after_now=False,
+ tzinfo=None):
"""
Gets a DateTime object for the current year.
@@ -585,11 +1754,13 @@ def date_time_this_year(self, before_now=True, after_now=False, tzinfo=None):
:return DateTime
"""
now = datetime.now(tzinfo)
- this_year_start = now.replace(month=1, day=1, hour=0, minute=0, second=0, microsecond=0)
+ this_year_start = now.replace(
+ month=1, day=1, hour=0, minute=0, second=0, microsecond=0)
next_year_start = datetime(now.year + 1, 1, 1, tzinfo=tzinfo)
if before_now and after_now:
- return self.date_time_between_dates(this_year_start, next_year_start, tzinfo)
+ return self.date_time_between_dates(
+ this_year_start, next_year_start, tzinfo)
elif not before_now and after_now:
return self.date_time_between_dates(now, next_year_start, tzinfo)
elif not after_now and before_now:
@@ -597,7 +1768,11 @@ def date_time_this_year(self, before_now=True, after_now=False, tzinfo=None):
else:
return now
- def date_time_this_month(self, before_now=True, after_now=False, tzinfo=None):
+ def date_time_this_month(
+ self,
+ before_now=True,
+ after_now=False,
+ tzinfo=None):
"""
Gets a DateTime object for the current month.
@@ -608,11 +1783,14 @@ def date_time_this_month(self, before_now=True, after_now=False, tzinfo=None):
:return DateTime
"""
now = datetime.now(tzinfo)
- this_month_start = now.replace(day=1, hour=0, minute=0, second=0, microsecond=0)
+ this_month_start = now.replace(
+ day=1, hour=0, minute=0, second=0, microsecond=0)
- next_month_start = this_month_start + relativedelta.relativedelta(months=1)
+ next_month_start = this_month_start + \
+ relativedelta.relativedelta(months=1)
if before_now and after_now:
- return self.date_time_between_dates(this_month_start, next_month_start, tzinfo)
+ return self.date_time_between_dates(
+ this_month_start, next_month_start, tzinfo)
elif not before_now and after_now:
return self.date_time_between_dates(now, next_month_start, tzinfo)
elif not after_now and before_now:
@@ -634,7 +1812,8 @@ def date_this_century(self, before_today=True, after_today=False):
next_century_start = date(this_century_start.year + 100, 1, 1)
if before_today and after_today:
- return self.date_between_dates(this_century_start, next_century_start)
+ return self.date_between_dates(
+ this_century_start, next_century_start)
elif not before_today and after_today:
return self.date_between_dates(today, next_century_start)
elif not after_today and before_today:
@@ -699,7 +1878,8 @@ def date_this_month(self, before_today=True, after_today=False):
today = date.today()
this_month_start = today.replace(day=1)
- next_month_start = this_month_start + relativedelta.relativedelta(months=1)
+ next_month_start = this_month_start + \
+ relativedelta.relativedelta(months=1)
if before_today and after_today:
return self.date_between_dates(this_month_start, next_month_start)
elif not before_today and after_today:
@@ -709,7 +1889,13 @@ def date_this_month(self, before_today=True, after_today=False):
else:
return today
- def time_series(self, start_date='-30d', end_date='now', precision=None, distrib=None, tzinfo=None):
+ def time_series(
+ self,
+ start_date='-30d',
+ end_date='now',
+ precision=None,
+ distrib=None,
+ tzinfo=None):
"""
Returns a generator yielding tuples of ``(, )``.
@@ -729,10 +1915,11 @@ def time_series(self, start_date='-30d', end_date='now', precision=None, distrib
precision = self._parse_timedelta(precision)
if distrib is None:
- distrib = lambda dt: self.generator.random.uniform(0, precision) # noqa
+ def distrib(dt): return self.generator.random.uniform(0, precision) # noqa
if not callable(distrib):
- raise ValueError("`distrib` must be a callable. Got {} instead.".format(distrib))
+ raise ValueError(
+ "`distrib` must be a callable. Got {} instead.".format(distrib))
datapoint = start_date
while datapoint < end_date:
@@ -765,4 +1952,46 @@ def century(self):
return self.random_element(self.centuries)
def timezone(self):
- return self.generator.random.choice(self.random_element(self.countries)['timezones'])
+ return self.generator.random.choice(
+ self.random_element(self.countries)['timezones'])
+
+ def date_of_birth(self, tzinfo=None, minimum_age=0, maximum_age=115):
+ """
+ Generate a random date of birth represented as a Date object,
+ constrained by optional miminimum_age and maximum_age
+ parameters.
+
+ :param tzinfo Defaults to None.
+ :param minimum_age Defaults to 0.
+ :param maximum_age Defaults to 115.
+
+ :example Date('1979-02-02')
+ :return Date
+ """
+
+ if not isinstance(minimum_age, int):
+ raise TypeError("minimum_age must be an integer.")
+
+ if not isinstance(maximum_age, int):
+ raise TypeError("maximum_age must be an integer.")
+
+ if (maximum_age < 0):
+ raise ValueError("maximum_age must be greater than or equal to zero.")
+
+ if (minimum_age < 0):
+ raise ValueError("minimum_age must be greater than or equal to zero.")
+
+ if (minimum_age > maximum_age):
+ raise ValueError("minimum_age must be less than or equal to maximum_age.")
+
+ # In order to return the full range of possible dates of birth, add one
+ # year to the potential age cap and subtract one day if we land on the
+ # boundary.
+
+ now = datetime.now(tzinfo).date()
+ start_date = now.replace(year=now.year - (maximum_age+1))
+ end_date = now.replace(year=now.year - minimum_age)
+
+ dob = self.date_time_ad(tzinfo=tzinfo, start_datetime=start_date, end_datetime=end_date).date()
+
+ return dob if dob != start_date else dob + timedelta(days=1)
diff --git a/src/libs/faker/providers/date_time/ar_AA/__init__.py b/src/libs/faker/providers/date_time/ar_AA/__init__.py
index 5634fc2..40a6978 100644
--- a/src/libs/faker/providers/date_time/ar_AA/__init__.py
+++ b/src/libs/faker/providers/date_time/ar_AA/__init__.py
@@ -28,7 +28,7 @@ class Provider(DateTimeProvider):
'09': 'أيلول',
'10': 'تشرين الأول',
'11': 'تشرين الثاني',
- '12': 'كانون الأول'
+ '12': 'كانون الأول',
}
centuries = [
@@ -39,201 +39,1106 @@ class Provider(DateTimeProvider):
'الحادي والعشرين', 'الثاني والعشرين',
]
- countries = [
- {'timezones': ['أوروب/أندورا'], 'code': 'AD', 'continent': 'أوروبا', 'name': 'أندورا', 'capital': 'أندورا لا فيلا'},
- {'timezones': ['آسيا/كابل'], 'code': 'AF', 'continent': 'آسيا', 'name': 'أفغانستان', 'capital': 'كابل'},
- {'timezones': ['أمريكا/أنتيغوا'], 'code': 'AG', 'continent': 'أمريكا الشمالية', 'name': 'أنتيغوا وباربودا', 'capital': "سانت جونز"},
- {'timezones': ['أوروبا/تيرانا'], 'code': 'AL', 'continent': 'أوروبا', 'name': 'ألبانيا', 'capital': 'تيرانا'},
- {'timezones': ['آسيا/يريفان'], 'code': 'AM', 'continent': 'آسيا', 'name': 'أرمينيا', 'capital': 'يريفان'},
- {'timezones': ['إفريقيا/لواندا'], 'code': 'AO', 'continent': 'إفريقيا', 'name': 'أنغولا', 'capital': 'لواندا'},
- {'timezones': ['أمريكا/الأرجنتين/بوينس_آيرس', 'أمريكا/الأرجنتين/Cordoba', 'أمريكا/الأرجنتين/خوخوي', 'أمريكا/الأرجنتين/توكومان', 'أمريكا/الأرجنتين/كاتاماركا', 'أمريكا/الأرجنتين/لا_ريوخا', 'أمريكا/الأرجنتين/سان_خوان', 'أمريكا/الأرجنتين/مندوزا', 'أمريكا/الأرجنتين/ريو_غاليغوس', 'أمريكا/الأرجنتين/أوشوايا'], 'code': 'AR', 'continent': 'أمريكا الجنوبية', 'name': 'الأرجنتين', 'capital': 'بوينس آيرس'},
- {'timezones': ['أوروبا/النمسا'], 'code': 'AT', 'continent': 'أوروبا', 'name': 'النمسا', 'capital': 'فيينا'},
- {'timezones': ['أستراليا/لورد_هاو', 'أستراليا/هوبارت', 'أستراليا/كري', 'أستراليا/ملبورن', 'أستراليا/سدني', 'أستراليا/بروكن_هل', 'أستراليا/بريزبن', 'أستراليا/ليندمان', 'أستراليا/أديلايد', 'أستراليا/داروين', 'أستراليا/برث'], 'code': 'AU', 'continent': 'أوقيانوسيا', 'name': 'أستراليا', 'capital': 'كانبرا'},
- {'timezones': ['آسيا/باكو'], 'code': 'AZ', 'continent': 'آسيا', 'name': 'أذربيجان', 'capital': 'باكو'},
- {'timezones': ['أمريكا/باربادوس'], 'code': 'BB', 'continent': 'أمريكا الشمالية', 'name': 'باربادوس', 'capital': 'بريدج تاون'},
- {'timezones': ['آسيا/دكا'], 'code': 'BD', 'continent': 'آسيا', 'name': 'بنغلادش', 'capital': 'دكا'},
- {'timezones': ['أوروبا/بروكسل'], 'code': 'BE', 'continent': 'أوروبا', 'name': 'بلجيكا', 'capital': 'بروكسل'},
- {'timezones': ['إفريقيا/واغادوغو'], 'code': 'BF', 'continent': 'إفريقيا', 'name': 'بوركينا فاسو', 'capital': 'واغادوغو'},
- {'timezones': ['أوروبا/صوفيا'], 'code': 'BG', 'continent': 'أوروبا', 'name': 'بلغاريا', 'capital': 'صوفيا'},
- {'timezones': ['آسيا/البحرين'], 'code': 'BH', 'continent': 'آسيا', 'name': 'البحرين', 'capital': 'المنامة'},
- {'timezones': ['إفريقيا/بوجمبورا'], 'code': 'BI', 'continent': 'إفريقيا', 'name': 'بوروندي', 'capital': 'بوجمبورا'},
- {'timezones': ['إفريقيا/بورتو نوفو'], 'code': 'BJ', 'continent': 'إفريقيا', 'name': 'بنين', 'capital': 'بورتو نوفو'},
- {'timezones': ['آسيا/بروناي'], 'code': 'BN', 'continent': 'آسيا', 'name': 'اتحاد بروناي (دار السلام)', 'capital': 'بندر سري بكاوان'},
- {'timezones': ['أمريكا/لاباز'], 'code': 'BO', 'continent': 'أمريكا الجنوبية', 'name': 'بوليفيا', 'capital': 'سوكري'},
- {'timezones': ['أمريكا/نورونها', 'أمريكا/بليم','أمريكا/فورتاليزا', 'أمريكا/ريسيفي', 'أمريكا/أراغوينا', 'أمريكا/ماسايو', 'أمريكا/باهيا', 'أمريكا/ساو_باولو', 'أمريكا/كامبو_غراندي', 'أمريكا/كويابا', 'أمريكا/بورتو_فاليو', 'أمريكا/بوا_فيستا', 'أمريكا/ماناوس', 'أمريكا/إيرونيبي', 'أمريكا/ريو_برانكو'], 'code': 'BR', 'continent': 'أمريكا الجنوبية', 'name': 'البرازيل', 'capital': 'برازيليا'},
- {'timezones': ['أمريكا/ناساو'], 'code': 'BS', 'continent': 'أمريكا الشمالية', 'name': 'باهاماس', 'capital': 'ناساو'},
- {'timezones': ['آسيا/تيمفو'], 'code': 'BT', 'continent': 'آسيا', 'name': 'بوتان', 'capital': 'تيمفو'},
- {'timezones': ['إفريقيا/غابورون'], 'code': 'BW', 'continent': 'إفريقيا', 'name': 'بوتسوانا', 'capital': 'غابورون'},
- {'timezones': ['أوروبا/مينسك'], 'code': 'BY', 'continent': 'أوروبا', 'name': 'روسيا البيضاء', 'capital': 'مينسك'},
- {'timezones': ['أمريكا/بليز'], 'code': 'BZ', 'continent': 'أمريكا الشمالية', 'name': 'بليز', 'capital': 'بلموبان'},
- {'timezones': ['أمريكا/سينت_جونز', 'أمريكا/هاليفاكس', 'أمريكا/جليس_باي', 'أمريكا/مونكتون', 'أمريكا/جووس_باي', 'أمريكا/بلانك_سابلون', 'أمريكا/مونتريال', 'أمريكا/تورونتو', 'أمريكا/نيبيغون', 'أمريكا/ثاندر_باي', 'أمريكا/بانغيرتانغ', 'أمريكا/إيكواليوت', 'أمريكا/أتيكوكان', 'أمريكا/رانكن_إنلت', 'أمريكا/وينيبيغ', 'أمريكا/رايني_ريفر', 'أمريكا/كامبريدج_باي', 'أمريكا/ريجينا', 'أمريكا/سويفت_كارنت', 'أمريكا/إدمونتون', 'أمريكا/يلو_نايف', 'أمريكا/إنوفك', 'أمريكا/دوسن_كريك', 'أمريكا/فانكوفر', 'أمريكا/وايت_هورس', 'أمريكا/داوسون'], 'code': 'CA', 'continent': 'أمريكا الشمالية', 'name': 'كندا', 'capital': 'أوتاوا'},
- {'timezones': ['إفريقيا/كينشاسا', 'إفريقيا/لوبومباشي'], 'code': 'CD', 'continent': 'إفريقيا', 'name': 'جمهورية الكونغو الديمقراطية', 'capital': 'كينشاسا'},
- {'timezones': ['إفريقيا/برازافيل'], 'code': 'CG', 'continent': 'إفريقيا', 'name': 'جمهورية الكونغو', 'capital': 'برازافيل'},
- {'timezones': ['إفريقيا/أبيدجان'], 'code': 'CI', 'continent': 'إفريقيا', 'name': "ساحل العاج", 'capital': 'ياموسوكرو'},
- {'timezones': ['أمريكا/سانتياغو', 'المحيط_الهاديء/جزيرة_القيامة'], 'code': 'CL', 'continent': 'أمريكا الجنوبية', 'name': 'تشيلي', 'capital': 'سانتياغو'},
- {'timezones': ['إفريقيا/دوالا'], 'code': 'CM', 'continent': 'إفريقيا', 'name': 'الكاميرون', 'capital': 'ياوندي'},
- {'timezones': ['آسيا/شانغهاي', 'آسيا/هاربن', 'آسيا/تشونغتشينغ', 'آسيا/أورومتشي', 'آسيا/كاشغر'], 'code': 'CN', 'continent': 'آسيا', 'name': "جمهورية الصين الشعبية", 'capital': 'بكين'},
- {'timezones': ['أمريكا/بوغوتا'], 'code': 'CO', 'continent': 'أمريكا الجنوبية', 'name': 'كولومبيا', 'capital': 'بوغوتا'},
- {'timezones': ['أمريكا/كوستاريكا'], 'code': 'CR', 'continent': 'أمريكا الشمالية', 'name': 'كوستاريكا', 'capital': 'سان خوسيه'},
- {'timezones': ['أمريكا/هافانا'], 'code': 'CU', 'continent': 'أمريكا الشمالية', 'name': 'كوبا', 'capital': 'هافانا'},
- {'timezones': ['الأطلنطي/الرأس_الأخضر'], 'code': 'CV', 'continent': 'إفريقيا', 'name': 'جمهورية الرأس الأخضر', 'capital': 'برايا'},
- {'timezones': ['آسيا/نيقوسيا'], 'code': 'CY', 'continent': 'آسيا', 'name': 'قبرص', 'capital': 'نيقوسيا'},
- {'timezones': ['أوروبا/براغ'], 'code': 'CZ', 'continent': 'أوروبا', 'name': 'جمهورية التشيك', 'capital': 'براغ'},
- {'timezones': ['أوروبا/برلين'], 'code': 'DE', 'continent': 'أوروبا', 'name': 'ألمانيا', 'capital': 'برلين'},
- {'timezones': ['إفريقيا/جيبوتي'], 'code': 'DJ', 'continent': 'إفريقيا', 'name': 'جيبوتي', 'capital': 'جيبوتي'},
- {'timezones': ['أوروبا/كوبنهاغن'], 'code': 'DK', 'continent': 'أوروبا', 'name': 'الدنمارك', 'capital': 'كوبنهاغن'},
- {'timezones': ['أمريكا/دومينيكا'], 'code': 'DM', 'continent': 'أمريكا الشمالية', 'name': 'دومينيكا', 'capital': 'روسياو'},
- {'timezones': ['أمريكا/سانتو_دومينغو'], 'code': 'DO', 'continent': 'أمريكا الشمالية', 'name': 'جمهورية الدومينيكان', 'capital': 'سانتو دومينغو'},
- {'timezones': ['أمريكا/غواياكيل', 'المحيط_الهاديء/أرخبيل_غالاباغوس'], 'code': 'EC', 'continent': 'أمريكا الجنوبية', 'name': 'الإكوادور', 'capital': 'كيتو'},
- {'timezones': ['أوروبا/تالين'], 'code': 'EE', 'continent': 'أوروبا', 'name': 'إستونيا', 'capital': 'تالين'},
- {'timezones': ['إفريقيا/القاهرة'], 'code': 'EG', 'continent': 'إفريقيا', 'name': 'مصر', 'capital': 'القاهرة'},
- {'timezones': ['إفريقيا/أسمرة'], 'code': 'ER', 'continent': 'إفريقيا', 'name': 'إرتيريا', 'capital': 'أسمرة'},
- {'timezones': ['إفريقيا/أديس أبابا'], 'code': 'ET', 'continent': 'إفريقيا', 'name': 'إثيوبيا', 'capital': 'أديس أبابا'},
- {'timezones': ['أوروبا/هلسنكي'], 'code': 'FI', 'continent': 'أوروبا', 'name': 'فنلندا', 'capital': 'هلسنكي'},
- {'timezones': ['المحيط_الهاديء/فيجي'], 'code': 'FJ', 'continent': 'أوقيانوسيا', 'name': 'فيجي', 'capital': 'سوفا'},
- {'timezones': ['أوروبا/باريس'], 'code': 'FR', 'continent': 'أوروبا', 'name': 'فرنسا', 'capital': 'باريس'},
- {'timezones': ['إفريقيا/ليبرفيل'], 'code': 'GA', 'continent': 'إفريقيا', 'name': 'الغابون', 'capital': 'ليبرفيل'},
- {'timezones': ['آسيا/تبليسي'], 'code': 'GE', 'continent': 'آسيا', 'name': 'جورجيا', 'capital': 'تبليسي'},
- {'timezones': ['إفريقيا/أكرا'], 'code': 'GH', 'continent': 'إفريقيا', 'name': 'غانا', 'capital': 'أكرا'},
- {'timezones': ['إفريقيا/بانجول'], 'code': 'GM', 'continent': 'إفريقيا', 'name': 'غامبيا', 'capital': 'بانجول'},
- {'timezones': ['إفريقيا/كوناكري'], 'code': 'GN', 'continent': 'إفريقيا', 'name': 'غينيا', 'capital': 'كوناكري'},
- {'timezones': ['أوروبا/أثينا'], 'code': 'GR', 'continent': 'أوروبا', 'name': 'اليونان', 'capital': 'أثينا'},
- {'timezones': ['أمريكا/غواتيمالا'], 'code': 'GT', 'continent': 'أمريكا الشمالية', 'name': 'غواتيمالا', 'capital': 'غواتيمالا سيتي'},
- {'timezones': ['أمريكا/غواتيمالا'], 'code': 'GT', 'continent': 'أمريكا الشمالية', 'name': 'هايتي', 'capital': 'بورت أو برانس'},
- {'timezones': ['إفريقيا/بيساو'], 'code': 'GW', 'continent': 'إفريقيا', 'name': 'غينيا بيساو', 'capital': 'بيساو'},
- {'timezones': ['أمريكا/غيانا'], 'code': 'GY', 'continent': 'أمريكا الجنوبية', 'name': 'غيانا', 'capital': 'جورج تاون'},
- {'timezones': ['أمريكا/تيجوسيجالبا'], 'code': 'HN', 'continent': 'أمريكا الشمالية', 'name': 'هندوراس', 'capital': 'تيجوسيجالبا'},
- {'timezones': ['أوروبا/بودابست'], 'code': 'HU', 'continent': 'أوروبا', 'name': 'هنغاريا', 'capital': 'بودابست'},
- {'timezones': ['آسيا/جاكرتا', 'آسيا/بونتياناك', 'آسيا/ماكاسار', 'آسيا/جايابورا'], 'code': 'ID', 'continent': 'آسيا', 'name': 'إندونسيا', 'capital': 'جاكرتا'},
- {'timezones': ['أوروبا/دبلن'], 'code': 'IE', 'continent': 'أوروبا', 'name': 'إيرلندا', 'capital': 'دبلن'},
- {'timezones': ['آسيا/القدس'], 'code': 'IL', 'continent': 'آسيا', 'name': 'فلسطين', 'capital': 'القدس'},
- {'timezones': ['آسيا/كالكتا'], 'code': 'IN', 'continent': 'آسيا', 'name': 'الهند', 'capital': 'نيو دلهي'},
- {'timezones': ['آسيا/بغداد'], 'code': 'IQ', 'continent': 'آسيا', 'name': 'العراق', 'capital': 'بغداد'},
- {'timezones': ['آسيا/طهران'], 'code': 'IR', 'continent': 'آسيا', 'name': 'إيران', 'capital': 'طهران'},
- {'timezones': ['الأطلنطي/ريكيافيك'], 'code': 'IS', 'continent': 'أوروبا', 'name': 'آيسلندا', 'capital': 'ريكيافيك'},
- {'timezones': ['أوروبا/روما'], 'code': 'IT', 'continent': 'أوروبا', 'name': 'إيطاليا', 'capital': 'روما'},
- {'timezones': ['أمريكا/جامايكا'], 'code': 'JM', 'continent': 'أمريكا الشمالية', 'name': 'جامايكا', 'capital': 'كينغستون'},
- {'timezones': ['آسيا/عمّان'], 'code': 'JO', 'continent': 'آسيا', 'name': 'الأردن', 'capital': 'عمّان'},
- {'timezones': ['آسيا/طوكيو'], 'code': 'JP', 'continent': 'آسيا', 'name': 'اليابان', 'capital': 'طوكيو'},
- {'timezones': ['إفريقيا/نيروبي'], 'code': 'KE', 'continent': 'إفريقيا', 'name': 'كينيا', 'capital': 'نيروبي'},
- {'timezones': ['آسيا/بشكيك'], 'code': 'KG', 'continent': 'آسيا', 'name': 'قيرغيزستان', 'capital': 'بشكيك'},
- {'timezones': ['المحيط_الهاديء/تاراوا', 'المحيط_الهاديء/إيديربيري', 'المحيط_الهاديء/كريتيماتي'], 'code': 'KI', 'continent': 'أوقيانوسيا', 'name': 'كيريباتي', 'capital': 'جنوب تاراوا'},
- {'timezones': ['آسيا/بيونغ_يانغ'], 'code': 'KP', 'continent': 'آسيا', 'name': 'كوريا الشمالية', 'capital': 'بيونغ يانغ'},
- {'timezones': ['آسيا/سيؤول'], 'code': 'KR', 'continent': 'آسيا', 'name': '؛كوريا الجنوبية', 'capital': 'سيؤول'},
- {'timezones': ['آسيا/الكويت'], 'code': 'KW', 'continent': 'آسيا', 'name': 'الكويت', 'capital': 'الكويت'},
- {'timezones': ['آسيا/بيروت'], 'code': 'LB', 'continent': 'آسيا', 'name': 'لبنان', 'capital': 'بيروت'},
- {'timezones': ['أوروبا/فادوز'], 'code': 'LI', 'continent': 'أوروبا', 'name': 'ليختنشتاين', 'capital': 'فادوز'},
- {'timezones': ['إفريقيا/مونروفيا'], 'code': 'LR', 'continent': 'إفريقيا', 'name': 'ليبيريا', 'capital': 'مونروفيا'},
- {'timezones': ['إفريقيا/ماسيرو'], 'code': 'LS', 'continent': 'إفريقيا', 'name': 'ليسوتو', 'capital': 'ماسيرو'},
- {'timezones': ['أوروبا/فيلنيوس'], 'code': 'LT', 'continent': 'أوروبا', 'name': 'ليتوانيا', 'capital': 'فيلنيوس'},
- {'timezones': ['أوروبا/لوكسمبرغ'], 'code': 'LU', 'continent': 'أوروبا', 'name': 'لوكسمبرغ', 'capital': 'لوكسمبرغ سيتي'},
- {'timezones': ['أوروبا/ربيغ'], 'code': 'LV', 'continent': 'أوروبا', 'name': 'لاتفيا', 'capital': 'ربيغ'},
- {'timezones': ['إفريقيا/طرابلس'], 'code': 'LY', 'continent': 'إفريقيا', 'name': 'ليبيا', 'capital': 'طرابلس'},
- {'timezones': ['الهندي/أنتاناناريفو'], 'code': 'MG', 'continent': 'إفريقيا', 'name': 'مدغشقر', 'capital': 'أنتاناناريفو'},
- {'timezones': ['المحيط_الهاديء/ماجورو', 'المحيط_الهاديء/كواجلين_أتول'], 'code': 'MH', 'continent': 'أوقيانوسيا', 'name': 'جزر مارشال', 'capital': 'ماجورو'},
- {'timezones': ['أوروبا/سكوبيه'], 'code': 'MK', 'continent': 'أوروبا', 'name': 'جمهورية مقدونيا', 'capital': 'سكوبيه'},
- {'timezones': ['إفريقيا/باماكو'], 'code': 'ML', 'continent': 'إفريقيا', 'name': 'مالي', 'capital': 'باماكو'},
- {'timezones': ['آسيا/رانغون'], 'code': 'MM', 'continent': 'آسيا', 'name': 'ميانمار', 'capital': 'نايبيداو'},
- {'timezones': ['آسيا/أولان_باتور', 'آسيا/Hovd', 'آسيا/تشويبالسان'], 'code': 'MN', 'continent': 'آسيا', 'name': 'مانغوليا', 'capital': 'أولان باتور'},
- {'timezones': ['إفريقيا/نواكشط'], 'code': 'MR', 'continent': 'إفريقيا', 'name': 'موريتانيا', 'capital': 'نواكشط'},
- {'timezones': ['أوروبا/مالطا'], 'code': 'MT', 'continent': 'أوروبا', 'name': 'مالطا', 'capital': 'فاليتا'},
- {'timezones': ['الهندي/موريشيوس'], 'code': 'MU', 'continent': 'إفريقيا', 'name': 'موريشيوس', 'capital': 'بور لويس'},
- {'timezones': ['الهندي/جزر_المالديف'], 'code': 'MV', 'continent': 'آسيا', 'name': 'جمهورية المالديف', 'capital': 'ماليه'},
- {'timezones': ['إفريقيا/بلانتاير'], 'code': 'MW', 'continent': 'إفريقيا', 'name': 'ملاوي', 'capital': 'ليلونغوي'},
- {'timezones': ['أمريكا/ميكسيكو_سيتي', 'أمريكا/كانكون', 'أمريكا/ميرديا', 'أمريكا/مونتيري', 'أمريكا/مازاتلان', 'أمريكا/شيواوا', 'أمريكا/ارموسييو_سونورا', 'أمريكا/تيخوانا'], 'code': 'MX', 'continent': 'أمريكا الشمالية', 'name': 'المكسيك', 'capital': 'ميكسيكو سيتي§'},
- {'timezones': ['آسيا/كوالا_لامبور', 'آسيا/Kuching'], 'code': 'MY', 'continent': 'آسيا', 'name': 'ماليزيا', 'capital': 'كوالا لامبور'},
- {'timezones': ['إفريقيا/مابوتو'], 'code': 'MZ', 'continent': 'إفريقيا', 'name': 'موزمبيق', 'capital': 'مابوتو'},
- {'timezones': ['إفريقيا/ويندهوك'], 'code': 'NA', 'continent': 'إفريقيا', 'name': 'ناميبيا', 'capital': 'ويندهوك'},
- {'timezones': ['إفريقيا/نيامي'], 'code': 'NE', 'continent': 'إفريقيا', 'name': 'النيجر', 'capital': 'نيامي'},
- {'timezones': ['إفريقيا/لاغوس'], 'code': 'NG', 'continent': 'إفريقيا', 'name': 'نيجيريا', 'capital': 'أبوجا'},
- {'timezones': ['أمريكا/ماناغوا'], 'code': 'NI', 'continent': 'أمريكا الشمالية', 'name': 'نيكاراغوا', 'capital': 'ماناغوا'},
- {'timezones': ['أوروبا/أمستردام'], 'code': 'NL', 'continent': 'أوروبا', 'name': 'هولندا', 'capital': 'أمستردام'},
- {'timezones': ['أوروبا/أوسلو'], 'code': 'NO', 'continent': 'أوروبا', 'name': 'النرويج', 'capital': 'أوسلو'},
- {'timezones': ['آسيا/كاتماندو'], 'code': 'NP', 'continent': 'آسيا', 'name': 'النيبال', 'capital': 'كاتماندو'},
- {'timezones': ['المحيط_الهاديء/ناورو'], 'code': 'NR', 'continent': 'أوقيانوسيا', 'name': 'ناورو', 'capital': 'يارين'},
- {'timezones': ['المحيط_الهاديء/أوكلاند', 'المحيط_الهاديء/تشاتهام'], 'code': 'NZ', 'continent': 'أوقيانوسيا', 'name': 'نيوزيلاندا', 'capital': 'ويلينغتون'},
- {'timezones': ['آسيا/مسقط'], 'code': 'OM', 'continent': 'آسيا', 'name': 'عمان', 'capital': 'مسقط'},
- {'timezones': ['أمريكا/بنما'], 'code': 'PA', 'continent': 'أمريكا الشمالية', 'name': 'بنما', 'capital': 'بنما'},
- {'timezones': ['أمريكا/ليما'], 'code': 'PE', 'continent': 'أمريكا الجنوبية', 'name': 'البيرو', 'capital': 'ليما'},
- {'timezones': ['المحيط_الهاديء/بورت_مورسبي'], 'code': 'PG', 'continent': 'أوقيانوسيا', 'name': 'بابوا غينيا الجديدة', 'capital': 'بورت مورسبي'},
- {'timezones': ['آسيا/مانيلا'], 'code': 'PH', 'continent': 'آسيا', 'name': 'الفيليبين', 'capital': 'مانيلا'},
- {'timezones': ['آسيا/كاراتشي'], 'code': 'PK', 'continent': 'آسيا', 'name': 'باكستان', 'capital': 'إسلام أباد'},
- {'timezones': ['أوروبا/وارسو'], 'code': 'PL', 'continent': 'أوروبا', 'name': 'بولندا', 'capital': 'وارسو'},
- {'timezones': ['أوروبا/لشبونة', 'الأطلنطي/ماديرا', 'الأطلنطي/الأزور'], 'code': 'PT', 'continent': 'أوروبا', 'name': 'البرتغال', 'capital': 'لشبونة'},
- {'timezones': ['المحيط_الهاديء/بالاو'], 'code': 'PW', 'continent': 'أوقيانوسيا', 'name': 'بالاو', 'capital': 'نجيرولمد'},
- {'timezones': ['أمريكا/أسونسيون'], 'code': 'PY', 'continent': 'أمريكا الجنوبية', 'name': 'بابرغوي', 'capital': 'أسونسيون'},
- {'timezones': ['آسيا/قطر'], 'code': 'QA', 'continent': 'آسيا', 'name': 'قطر', 'capital': 'الدوحة'},
- {'timezones': ['أوروبا/بوخارست'], 'code': 'RO', 'continent': 'أوروبا', 'name': 'رومانيا', 'capital': 'بوخارست'},
- {'timezones': ['أوروبا/كالينينغراد', 'أوروبا/موسكو', 'أوروبا/Volgograd', 'أوروبا/سمارة', 'آسيا/يكاترينبورغ', 'آسيا/أومسك', 'آسيا/نوفوسيبيرسك', 'آسيا/كراسنوياسك', 'آسيا/إروتسك', 'آسيا/ياكوتسك', 'آسيا/فالديفوستوك', 'آسيا/ساخالن', 'آسيا/ماغادان', 'آسيا/كامشتكا', 'آسيا/أنادير'], 'code': 'RU', 'continent': 'أوروبا', 'name': 'روسيا', 'capital': 'موسكو'},
- {'timezones': ['إفريقيا/كيغالي'], 'code': 'RW', 'continent': 'إفريقيا', 'name': 'رواندا', 'capital': 'كيغالي'},
- {'timezones': ['آسيا/الرياض'], 'code': 'SA', 'continent': 'آسيا', 'name': 'المملكة العربية السعودية', 'capital': 'الرياض'},
- {'timezones': ['المحيط_الهاديء/غوادالكانال'], 'code': 'SB', 'continent': 'أوقيانوسيا', 'name': 'جزر سولمون', 'capital': 'هونيارا'},
- {'timezones': ['الهندي/ماهي'], 'code': 'SC', 'continent': 'إفريقيا', 'name': 'سيشل', 'capital': 'فيكتوريا'},
- {'timezones': ['إفريقيا/الخرطوم'], 'code': 'SD', 'continent': 'إفريقيا', 'name': 'السودان', 'capital': 'الخرطوم'},
- {'timezones': ['أوروبا/ستوكهولم'], 'code': 'SE', 'continent':'أوروبا', 'name': 'السويد', 'capital': 'ستوكهولم'},
- {'timezones': ['آسيا/سنغافورة'], 'code': 'SG', 'continent': 'آسيا', 'name': 'سنغافورة', 'capital': 'سنغافورة'},
- {'timezones': ['أوروبا/ليوبليانا'], 'code': 'SI', 'continent': 'أوروبا', 'name': 'سلوفانيا', 'capital': 'ليوبليانا'},
- {'timezones': ['أوروبا/براتيسلافا'], 'code': 'SK', 'continent': 'أوروبا', 'name': 'سلوفاكيا', 'capital': 'براتيسلافا'},
- {'timezones': ['إفريقيا/فريتاون'], 'code': 'SL', 'continent': 'إفريقيا', 'name': 'سيراليون', 'capital': 'فريتاون'},
- {'timezones': ['أوروبا/سان_مارينو'], 'code': 'SM', 'continent': 'أوروبا', 'name': 'جمهورية سان مارينو', 'capital': 'سان مارينو'},
- {'timezones': ['إفريقيا/داكار'], 'code': 'SN', 'continent': 'إفريقيا', 'name': 'السنغال', 'capital': 'داكار'},
- {'timezones': ['إفريقيا/مقديشو'], 'code': 'SO', 'continent': 'إفريقيا', 'name': 'الصومال', 'capital': 'مقديشو'},
- {'timezones': ['أمريكا/باراماريبو'], 'code': 'SR', 'continent': 'أمريكا الجنوبية', 'name': 'Suriname', 'capital': 'باراماريبو'},
- {'timezones': ['إفريقيا/ساو_تومي'], 'code': 'ST', 'continent': 'إفريقيا', 'name': ' ساو تومي وبرينسيب', 'capital': 'ساو تومي'},
- {'timezones': ['آسيا/دممشق'], 'code': 'SY', 'continent': 'آسيا', 'name': 'سوريا', 'capital': 'دمشق'},
- {'timezones': ['إفريقيا/لومي'], 'code': 'TG', 'continent': 'إفريقيا', 'name': 'توغو', 'capital': 'لومي'},
- {'timezones': ['آسيا/بانغوك'], 'code': 'TH', 'continent': 'آسيا', 'name': 'تايلند', 'capital': 'بناغوك'},
- {'timezones': ['آسيا/دوشنبه'], 'code': 'TJ', 'continent': 'آسيا', 'name': 'طاجكيستان', 'capital': 'دوشنبه'},
- {'timezones': ['آسيا/عشق_آباد'], 'code': 'TM', 'continent': 'آسيا', 'name': 'تركمانستان', 'capital': 'عشق آباد'},
- {'timezones': ['إفريقيا/تونس'], 'code': 'TN', 'continent': 'إفريقيا', 'name': 'تونس', 'capital': 'تونس'},
- {'timezones': ['المحيط_الهاديء/تونغاتابو'], 'code': 'TO', 'continent': 'أوقيانوسيا', 'name': 'تونغا', 'capital': 'نوكو ألوفا'},
- {'timezones': ['أوروبا/إسطنبول'], 'code': 'TR', 'continent': 'آسيا', 'name': 'تركيا', 'capital': 'أنقرة'},
- {'timezones': ['أمريكا/بورت_أوف_سبين'], 'code': 'TT', 'continent': 'أمريكا الشمالية', 'name': 'ترينيداد وتوباغو', 'capital': 'بورت أوف سبين'},
- {'timezones': ['المحيط_الهاديء/فونافوتي'], 'code': 'TV', 'continent': 'أوقيانوسيا', 'name': 'توفالو', 'capital': 'فونافوتي'},
- {'timezones': ['إفريقيا/دار_السلام'], 'code': 'TZ', 'continent': 'إفريقيا', 'name': 'تانزانيا', 'capital': 'دودوما'},
- {'timezones': ['أوروبا/كييف', 'أوروبا/أوجهورود', 'أوروبا/زاباروجيا', 'أوروبا/سيمفروبول'], 'code': 'UA', 'continent': 'أوروبا', 'name': 'أوكرانيا', 'capital': 'كييف'},
- {'timezones': ['إفريقيا/كامبالا'], 'code': 'UG', 'continent': 'إفريقيا', 'name': 'أوغندا', 'capital': 'كامبالا'},
- {'timezones': ['أمريكا/نيويورك', 'أمريكا/ديترويت', 'أمريكا/كنتاكي/لويسفيل', 'أمريكا/كنتاكي/مونتيسللو', 'أمريكا/إنديانا/إنديانابولس', 'أمريكا/إنديانا/مارنغو', 'أمريكا/إنديانا/نوكس', 'أمريكا/إنديانا/فيفاي', 'أمريكا/شيكاغو', 'أمريكا/إنديانا/فانسان', 'أمريكا/إنديانا/بيترزبيرغ', 'أمريكا/مينومني', 'أمريكا/نورث_داكوتا/سينتر', 'أمريكا/نورث_داكوتا/نيو_سالم', 'أمريكا/دنفر', 'أمريكا/بويسي', 'أمريكا/شيبروك', 'أمريكا/فينيكس', 'أمريكا/لوس_أنجيلوس', 'أمريكا/أنكوريج', 'أمريكا/جونو', 'أمريكا/ياكوتات', 'أمريكا/نوم', 'أمريكا/أداك', 'المحيط_الهاديء/هونولولو'], 'code': 'US', 'continent': 'أمريكا الشمالية', 'name': 'الولايات المتحدة الأمريكية', 'capital': 'واشنطن'},
- {'timezones': ['أمريكا/مونتفيدو'], 'code': 'UY', 'continent': 'أمريكا الجنوبية', 'name': 'أوروغواي', 'capital': 'مونتفيدو'},
- {'timezones': ['آسيا/سمرقند', 'آسيا/طشقند'], 'code': 'UZ', 'continent': 'آسيا', 'name': 'أوزبكستان', 'capital': 'طشقند'},
- {'timezones': ['أوروبا/الفاتيكان'], 'code': 'VA', 'continent': 'أوروبا', 'name': 'الفاتيكان', 'capital': 'الفاتيكان'},
- {'timezones': ['أمريكا/كاركاس'], 'code': 'VE', 'continent': 'أمريكا الجنوبية', 'name': 'فنزويلا', 'capital': 'كاركاس'},
- {'timezones': ['آسيا/سايغون'], 'code': 'VN', 'continent': 'آسيا', 'name': 'فيتنام', 'capital': 'هانوي'},
- {'timezones': ['المحيط_الهاديء/أيفاتي'], 'code': 'VU', 'continent': 'أوقيانوسيا', 'name': 'فانواتو', 'capital': 'بورت فيلا'},
- {'timezones': ['آسيا/عدن'], 'code': 'YE', 'continent': 'آسيا', 'name': 'اليمن', 'capital': "صنعاء"},
- {'timezones': ['إفريقيا/لوساكا'], 'code': 'ZM', 'continent': 'إفريقيا', 'name': 'زامبيا', 'capital': 'لوساكا'},
- {'timezones': ['إفريقيا/هراري'], 'code': 'ZW', 'continent': 'إفريقيا', 'name': 'زيمبابوي', 'capital': 'هراري'},
- {'timezones': ['إفريقيا/الجزائر'], 'code': 'DZ', 'continent': 'إفريقيا', 'name': 'الجزائر', 'capital': 'الجزائر'},
- {'timezones': ['أوروبا/سراييفو'], 'code': 'BA', 'continent': 'أوروبا', 'name': 'البوسنة والهرسك', 'capital': 'سراييفو'},
- {'timezones': ['آسيا/بنوم_بنه'], 'code': 'KH', 'continent': 'آسيا', 'name': 'كمبوديا', 'capital': 'بنوم بنه'},
- {'timezones': ['إفريقيا/بانغي'], 'code': 'CF', 'continent': 'إفريقيا', 'name': 'جمهورية أفريقيا الوسطى', 'capital': 'بانغي'},
- {'timezones': ['إفريقيا/نجامينا'], 'code': 'TD', 'continent': 'إفريقيا', 'name': 'تشاد', 'capital': "نجامينا"},
- {'timezones': ['الهندي/كومورو'], 'code': 'KM', 'continent': 'إفريقيا', 'name': 'جزر القمر', 'capital': 'موروني'},
- {'timezones': ['أوروبا/زغرب'], 'code': 'HR', 'continent': 'أوروبا', 'name': 'كرواتيا', 'capital': 'زغرب'},
- {'timezones': ['آسيا/ديلي'], 'code': 'TL', 'continent': 'آسيا', 'name': 'تيمور الشرقية', 'capital': 'ديلي'},
- {'timezones': ['أمريكا/السلفادور'], 'code': 'SV', 'continent': 'أمريكا الشمالية', 'name': 'السلفادور', 'capital': 'سان سلفادور'},
- {'timezones': ['إفريقيا/مالابو'], 'code': 'GQ', 'continent': 'إفريقيا', 'name': 'غينيا الاستوائية', 'capital': 'مالابو'},
- {'timezones': ['أمريكا/غرينادا'], 'code': 'GD', 'continent': 'أمريكا الشمالية', 'name': 'غرينادا', 'capital': "سانت جورجز"},
- {'timezones': ['آسيا/ألماتي', 'آسيا/كيزيلوردا', 'آسيا/أقتوبي', 'آسيا/أقتاو', 'آسيا/أورال'], 'code': 'KZ', 'continent': 'آسيا', 'name': 'كازاخستان', 'capital': 'أستانة'},
- {'timezones': ['آسيا/فيينتيان'], 'code': 'LA', 'continent': 'آسيا', 'name': 'لاوس', 'capital': 'فيينتيان'},
- {'timezones': ['المحيط_الهاديء/تشوك', 'المحيط_الهاديء/بونابي', 'المحيط_الهاديء/كورساي'], 'code': 'FM', 'continent': 'أوقيانوسيا', 'name': 'ولايات ميكرونيسيا المتحدة', 'capital': 'باليكير'},
- {'timezones': ['أوروبا/كيشيناو'], 'code': 'MD', 'continent': 'أوروبا', 'name': 'مولدافيا', 'capital': 'كيشيناو'},
- {'timezones': ['أوروبا/موناكو'], 'code': 'MC', 'continent': 'أوروبا', 'name': 'موناكو', 'capital': 'موناكو'},
- {'timezones': ['أوروبا/بودغوريتسا'], 'code': 'ME', 'continent': 'أوروبا', 'name': 'الجبل الأسود', 'capital': 'بودغوريتسا'},
- {'timezones': ['إفريقيا/الدار_البيضاء'], 'code': 'MA', 'continent': 'إفريقيا', 'name': 'المغرب', 'capital': 'الرباط'},
- {'timezones': ['أمريكا/سانت_كيتس'], 'code': 'KN', 'continent': 'أمريكا الشمالية', 'name': 'سانت كيتس ونيفيس', 'capital': 'باستير'},
- {'timezones': ['أمريكا/سانت_لوسيا'], 'code': 'LC', 'continent': 'أمريكا الشمالية', 'name': 'سانت لوسيا', 'capital': 'كاستريس'},
- {'timezones': ['أمريكا/سينت_فينسينت'], 'code': 'VC', 'continent': 'أمريكا الشمالية', 'name': 'سانت فينسنت والغرينادين', 'capital': 'كينغستاون'},
- {'timezones': ['المحيط_الهاديء/أبيا'], 'code': 'WS', 'continent': 'أوقيانوسيا', 'name': 'ساموا', 'capital': 'أبيا'},
- {'timezones': ['أوروبا/بلغراد'], 'code': 'RS', 'continent': 'أوروبا', 'name': 'صربيا', 'capital': 'بلغراد'},
- {'timezones': ['إفريقيا/جوهانسبرغ'], 'code': 'ZA', 'continent': 'إفريقيا', 'name': 'جنوب إفريقيا', 'capital': 'بريتوريا'},
- {'timezones': ['أوروبا/مدريد', 'إفريقيا/سبتة', 'الأطلنطي/الكناري'], 'code': 'ES', 'continent': 'أوروبا', 'name': 'إسبانيا', 'capital': 'مدريد'},
- {'timezones': ['آسيا/كولمبو'], 'code': 'LK', 'continent': 'آسيا', 'name': 'سريلانكا', 'capital': 'سري جاياواردنابورا كوتي'},
- {'timezones': ['إفريقيا/مبابان'], 'code': 'SZ', 'continent': 'إفريقيا', 'name': 'سوازيلاند', 'capital': 'مبابان'},
- {'timezones': ['أوروبا/زيورخ'], 'code': 'CH', 'continent': 'أوروبا', 'name': 'سويسرا', 'capital': 'برن'},
- {'timezones': ['آسيا/دبي'], 'code': 'AE', 'continent': 'آسيا', 'name': 'الإمارات العربية المتحدة', 'capital': 'أبو ظبي'},
- {'timezones': ['أوروبا/لندن'], 'code': 'GB', 'continent': 'أوروبا', 'name': 'المملكة المتحدة', 'capital': 'لندن'},
- ]
+ countries = [{'timezones': ['أوروب/أندورا'],
+ 'alpha-2-code': 'AD',
+ 'continent': 'أوروبا',
+ 'name': 'أندورا',
+ 'capital': 'أندورا لا فيلا'},
+ {'timezones': ['آسيا/كابل'],
+ 'alpha-2-code': 'AF',
+ 'continent': 'آسيا',
+ 'name': 'أفغانستان',
+ 'capital': 'كابل'},
+ {'timezones': ['أمريكا/أنتيغوا'],
+ 'alpha-2-code': 'AG',
+ 'continent': 'أمريكا الشمالية',
+ 'name': 'أنتيغوا وباربودا',
+ 'capital': "سانت جونز"},
+ {'timezones': ['أوروبا/تيرانا'],
+ 'alpha-2-code': 'AL',
+ 'continent': 'أوروبا',
+ 'name': 'ألبانيا',
+ 'capital': 'تيرانا'},
+ {'timezones': ['آسيا/يريفان'],
+ 'alpha-2-code': 'AM',
+ 'continent': 'آسيا',
+ 'name': 'أرمينيا',
+ 'capital': 'يريفان'},
+ {'timezones': ['إفريقيا/لواندا'],
+ 'alpha-2-code': 'AO',
+ 'continent': 'إفريقيا',
+ 'name': 'أنغولا',
+ 'capital': 'لواندا'},
+ {'timezones': ['أمريكا/الأرجنتين/بوينس_آيرس',
+ 'أمريكا/الأرجنتين/Cordoba',
+ 'أمريكا/الأرجنتين/خوخوي',
+ 'أمريكا/الأرجنتين/توكومان',
+ 'أمريكا/الأرجنتين/كاتاماركا',
+ 'أمريكا/الأرجنتين/لا_ريوخا',
+ 'أمريكا/الأرجنتين/سان_خوان',
+ 'أمريكا/الأرجنتين/مندوزا',
+ 'أمريكا/الأرجنتين/ريو_غاليغوس',
+ 'أمريكا/الأرجنتين/أوشوايا'],
+ 'alpha-2-code': 'AR',
+ 'continent': 'أمريكا الجنوبية',
+ 'name': 'الأرجنتين',
+ 'capital': 'بوينس آيرس'},
+ {'timezones': ['أوروبا/النمسا'],
+ 'alpha-2-code': 'AT',
+ 'continent': 'أوروبا',
+ 'name': 'النمسا',
+ 'capital': 'فيينا'},
+ {'timezones': ['أستراليا/لورد_هاو',
+ 'أستراليا/هوبارت',
+ 'أستراليا/كري',
+ 'أستراليا/ملبورن',
+ 'أستراليا/سدني',
+ 'أستراليا/بروكن_هل',
+ 'أستراليا/بريزبن',
+ 'أستراليا/ليندمان',
+ 'أستراليا/أديلايد',
+ 'أستراليا/داروين',
+ 'أستراليا/برث'],
+ 'alpha-2-code': 'AU',
+ 'continent': 'أوقيانوسيا',
+ 'name': 'أستراليا',
+ 'capital': 'كانبرا'},
+ {'timezones': ['آسيا/باكو'],
+ 'alpha-2-code': 'AZ',
+ 'continent': 'آسيا',
+ 'name': 'أذربيجان',
+ 'capital': 'باكو'},
+ {'timezones': ['أمريكا/باربادوس'],
+ 'alpha-2-code': 'BB',
+ 'continent': 'أمريكا الشمالية',
+ 'name': 'باربادوس',
+ 'capital': 'بريدج تاون'},
+ {'timezones': ['آسيا/دكا'],
+ 'alpha-2-code': 'BD',
+ 'continent': 'آسيا',
+ 'name': 'بنغلادش',
+ 'capital': 'دكا'},
+ {'timezones': ['أوروبا/بروكسل'],
+ 'alpha-2-code': 'BE',
+ 'continent': 'أوروبا',
+ 'name': 'بلجيكا',
+ 'capital': 'بروكسل'},
+ {'timezones': ['إفريقيا/واغادوغو'],
+ 'alpha-2-code': 'BF',
+ 'continent': 'إفريقيا',
+ 'name': 'بوركينا فاسو',
+ 'capital': 'واغادوغو'},
+ {'timezones': ['أوروبا/صوفيا'],
+ 'alpha-2-code': 'BG',
+ 'continent': 'أوروبا',
+ 'name': 'بلغاريا',
+ 'capital': 'صوفيا'},
+ {'timezones': ['آسيا/البحرين'],
+ 'alpha-2-code': 'BH',
+ 'continent': 'آسيا',
+ 'name': 'البحرين',
+ 'capital': 'المنامة'},
+ {'timezones': ['إفريقيا/بوجمبورا'],
+ 'alpha-2-code': 'BI',
+ 'continent': 'إفريقيا',
+ 'name': 'بوروندي',
+ 'capital': 'بوجمبورا'},
+ {'timezones': ['إفريقيا/بورتو نوفو'],
+ 'alpha-2-code': 'BJ',
+ 'continent': 'إفريقيا',
+ 'name': 'بنين',
+ 'capital': 'بورتو نوفو'},
+ {'timezones': ['آسيا/بروناي'],
+ 'alpha-2-code': 'BN',
+ 'continent': 'آسيا',
+ 'name': 'اتحاد بروناي (دار السلام)',
+ 'capital': 'بندر سري بكاوان'},
+ {'timezones': ['أمريكا/لاباز'],
+ 'alpha-2-code': 'BO',
+ 'continent': 'أمريكا الجنوبية',
+ 'name': 'بوليفيا',
+ 'capital': 'سوكري'},
+ {'timezones': ['أمريكا/نورونها',
+ 'أمريكا/بليم',
+ 'أمريكا/فورتاليزا',
+ 'أمريكا/ريسيفي',
+ 'أمريكا/أراغوينا',
+ 'أمريكا/ماسايو',
+ 'أمريكا/باهيا',
+ 'أمريكا/ساو_باولو',
+ 'أمريكا/كامبو_غراندي',
+ 'أمريكا/كويابا',
+ 'أمريكا/بورتو_فاليو',
+ 'أمريكا/بوا_فيستا',
+ 'أمريكا/ماناوس',
+ 'أمريكا/إيرونيبي',
+ 'أمريكا/ريو_برانكو'],
+ 'alpha-2-code': 'BR',
+ 'continent': 'أمريكا الجنوبية',
+ 'name': 'البرازيل',
+ 'capital': 'برازيليا'},
+ {'timezones': ['أمريكا/ناساو'],
+ 'alpha-2-code': 'BS',
+ 'continent': 'أمريكا الشمالية',
+ 'name': 'باهاماس',
+ 'capital': 'ناساو'},
+ {'timezones': ['آسيا/تيمفو'],
+ 'alpha-2-code': 'BT',
+ 'continent': 'آسيا',
+ 'name': 'بوتان',
+ 'capital': 'تيمفو'},
+ {'timezones': ['إفريقيا/غابورون'],
+ 'alpha-2-code': 'BW',
+ 'continent': 'إفريقيا',
+ 'name': 'بوتسوانا',
+ 'capital': 'غابورون'},
+ {'timezones': ['أوروبا/مينسك'],
+ 'alpha-2-code': 'BY',
+ 'continent': 'أوروبا',
+ 'name': 'روسيا البيضاء',
+ 'capital': 'مينسك'},
+ {'timezones': ['أمريكا/بليز'],
+ 'alpha-2-code': 'BZ',
+ 'continent': 'أمريكا الشمالية',
+ 'name': 'بليز',
+ 'capital': 'بلموبان'},
+ {'timezones': ['أمريكا/سينت_جونز',
+ 'أمريكا/هاليفاكس',
+ 'أمريكا/جليس_باي',
+ 'أمريكا/مونكتون',
+ 'أمريكا/جووس_باي',
+ 'أمريكا/بلانك_سابلون',
+ 'أمريكا/مونتريال',
+ 'أمريكا/تورونتو',
+ 'أمريكا/نيبيغون',
+ 'أمريكا/ثاندر_باي',
+ 'أمريكا/بانغيرتانغ',
+ 'أمريكا/إيكواليوت',
+ 'أمريكا/أتيكوكان',
+ 'أمريكا/رانكن_إنلت',
+ 'أمريكا/وينيبيغ',
+ 'أمريكا/رايني_ريفر',
+ 'أمريكا/كامبريدج_باي',
+ 'أمريكا/ريجينا',
+ 'أمريكا/سويفت_كارنت',
+ 'أمريكا/إدمونتون',
+ 'أمريكا/يلو_نايف',
+ 'أمريكا/إنوفك',
+ 'أمريكا/دوسن_كريك',
+ 'أمريكا/فانكوفر',
+ 'أمريكا/وايت_هورس',
+ 'أمريكا/داوسون'],
+ 'alpha-2-code': 'CA',
+ 'continent': 'أمريكا الشمالية',
+ 'name': 'كندا',
+ 'capital': 'أوتاوا'},
+ {'timezones': ['إفريقيا/كينشاسا',
+ 'إفريقيا/لوبومباشي'],
+ 'alpha-2-code': 'CD',
+ 'continent': 'إفريقيا',
+ 'name': 'جمهورية الكونغو الديمقراطية',
+ 'capital': 'كينشاسا'},
+ {'timezones': ['إفريقيا/برازافيل'],
+ 'alpha-2-code': 'CG',
+ 'continent': 'إفريقيا',
+ 'name': 'جمهورية الكونغو',
+ 'capital': 'برازافيل'},
+ {'timezones': ['إفريقيا/أبيدجان'],
+ 'alpha-2-code': 'CI',
+ 'continent': 'إفريقيا',
+ 'name': "ساحل العاج",
+ 'capital': 'ياموسوكرو'},
+ {'timezones': ['أمريكا/سانتياغو',
+ 'المحيط_الهاديء/جزيرة_القيامة'],
+ 'alpha-2-code': 'CL',
+ 'continent': 'أمريكا الجنوبية',
+ 'name': 'تشيلي',
+ 'capital': 'سانتياغو'},
+ {'timezones': ['إفريقيا/دوالا'],
+ 'alpha-2-code': 'CM',
+ 'continent': 'إفريقيا',
+ 'name': 'الكاميرون',
+ 'capital': 'ياوندي'},
+ {'timezones': ['آسيا/شانغهاي',
+ 'آسيا/هاربن',
+ 'آسيا/تشونغتشينغ',
+ 'آسيا/أورومتشي',
+ 'آسيا/كاشغر'],
+ 'alpha-2-code': 'CN',
+ 'continent': 'آسيا',
+ 'name': "جمهورية الصين الشعبية",
+ 'capital': 'بكين'},
+ {'timezones': ['أمريكا/بوغوتا'],
+ 'alpha-2-code': 'CO',
+ 'continent': 'أمريكا الجنوبية',
+ 'name': 'كولومبيا',
+ 'capital': 'بوغوتا'},
+ {'timezones': ['أمريكا/كوستاريكا'],
+ 'alpha-2-code': 'CR',
+ 'continent': 'أمريكا الشمالية',
+ 'name': 'كوستاريكا',
+ 'capital': 'سان خوسيه'},
+ {'timezones': ['أمريكا/هافانا'],
+ 'alpha-2-code': 'CU',
+ 'continent': 'أمريكا الشمالية',
+ 'name': 'كوبا',
+ 'capital': 'هافانا'},
+ {'timezones': ['الأطلنطي/الرأس_الأخضر'],
+ 'alpha-2-code': 'CV',
+ 'continent': 'إفريقيا',
+ 'name': 'جمهورية الرأس الأخضر',
+ 'capital': 'برايا'},
+ {'timezones': ['آسيا/نيقوسيا'],
+ 'alpha-2-code': 'CY',
+ 'continent': 'آسيا',
+ 'name': 'قبرص',
+ 'capital': 'نيقوسيا'},
+ {'timezones': ['أوروبا/براغ'],
+ 'alpha-2-code': 'CZ',
+ 'continent': 'أوروبا',
+ 'name': 'جمهورية التشيك',
+ 'capital': 'براغ'},
+ {'timezones': ['أوروبا/برلين'],
+ 'alpha-2-code': 'DE',
+ 'continent': 'أوروبا',
+ 'name': 'ألمانيا',
+ 'capital': 'برلين'},
+ {'timezones': ['إفريقيا/جيبوتي'],
+ 'alpha-2-code': 'DJ',
+ 'continent': 'إفريقيا',
+ 'name': 'جيبوتي',
+ 'capital': 'جيبوتي'},
+ {'timezones': ['أوروبا/كوبنهاغن'],
+ 'alpha-2-code': 'DK',
+ 'continent': 'أوروبا',
+ 'name': 'الدنمارك',
+ 'capital': 'كوبنهاغن'},
+ {'timezones': ['أمريكا/دومينيكا'],
+ 'alpha-2-code': 'DM',
+ 'continent': 'أمريكا الشمالية',
+ 'name': 'دومينيكا',
+ 'capital': 'روسياو'},
+ {'timezones': ['أمريكا/سانتو_دومينغو'],
+ 'alpha-2-code': 'DO',
+ 'continent': 'أمريكا الشمالية',
+ 'name': 'جمهورية الدومينيكان',
+ 'capital': 'سانتو دومينغو'},
+ {'timezones': ['أمريكا/غواياكيل',
+ 'المحيط_الهاديء/أرخبيل_غالاباغوس'],
+ 'alpha-2-code': 'EC',
+ 'continent': 'أمريكا الجنوبية',
+ 'name': 'الإكوادور',
+ 'capital': 'كيتو'},
+ {'timezones': ['أوروبا/تالين'],
+ 'alpha-2-code': 'EE',
+ 'continent': 'أوروبا',
+ 'name': 'إستونيا',
+ 'capital': 'تالين'},
+ {'timezones': ['إفريقيا/القاهرة'],
+ 'alpha-2-code': 'EG',
+ 'continent': 'إفريقيا',
+ 'name': 'مصر',
+ 'capital': 'القاهرة'},
+ {'timezones': ['إفريقيا/أسمرة'],
+ 'alpha-2-code': 'ER',
+ 'continent': 'إفريقيا',
+ 'name': 'إرتيريا',
+ 'capital': 'أسمرة'},
+ {'timezones': ['إفريقيا/أديس أبابا'],
+ 'alpha-2-code': 'ET',
+ 'continent': 'إفريقيا',
+ 'name': 'إثيوبيا',
+ 'capital': 'أديس أبابا'},
+ {'timezones': ['أوروبا/هلسنكي'],
+ 'alpha-2-code': 'FI',
+ 'continent': 'أوروبا',
+ 'name': 'فنلندا',
+ 'capital': 'هلسنكي'},
+ {'timezones': ['المحيط_الهاديء/فيجي'],
+ 'alpha-2-code': 'FJ',
+ 'continent': 'أوقيانوسيا',
+ 'name': 'فيجي',
+ 'capital': 'سوفا'},
+ {'timezones': ['أوروبا/باريس'],
+ 'alpha-2-code': 'FR',
+ 'continent': 'أوروبا',
+ 'name': 'فرنسا',
+ 'capital': 'باريس'},
+ {'timezones': ['إفريقيا/ليبرفيل'],
+ 'alpha-2-code': 'GA',
+ 'continent': 'إفريقيا',
+ 'name': 'الغابون',
+ 'capital': 'ليبرفيل'},
+ {'timezones': ['آسيا/تبليسي'],
+ 'alpha-2-code': 'GE',
+ 'continent': 'آسيا',
+ 'name': 'جورجيا',
+ 'capital': 'تبليسي'},
+ {'timezones': ['إفريقيا/أكرا'],
+ 'alpha-2-code': 'GH',
+ 'continent': 'إفريقيا',
+ 'name': 'غانا',
+ 'capital': 'أكرا'},
+ {'timezones': ['إفريقيا/بانجول'],
+ 'alpha-2-code': 'GM',
+ 'continent': 'إفريقيا',
+ 'name': 'غامبيا',
+ 'capital': 'بانجول'},
+ {'timezones': ['إفريقيا/كوناكري'],
+ 'alpha-2-code': 'GN',
+ 'continent': 'إفريقيا',
+ 'name': 'غينيا',
+ 'capital': 'كوناكري'},
+ {'timezones': ['أوروبا/أثينا'],
+ 'alpha-2-code': 'GR',
+ 'continent': 'أوروبا',
+ 'name': 'اليونان',
+ 'capital': 'أثينا'},
+ {'timezones': ['أمريكا/غواتيمالا'],
+ 'alpha-2-code': 'GT',
+ 'continent': 'أمريكا الشمالية',
+ 'name': 'غواتيمالا',
+ 'capital': 'غواتيمالا سيتي'},
+ {'timezones': ['أمريكا/غواتيمالا'],
+ 'alpha-2-code': 'GT',
+ 'continent': 'أمريكا الشمالية',
+ 'name': 'هايتي',
+ 'capital': 'بورت أو برانس'},
+ {'timezones': ['إفريقيا/بيساو'],
+ 'alpha-2-code': 'GW',
+ 'continent': 'إفريقيا',
+ 'name': 'غينيا بيساو',
+ 'capital': 'بيساو'},
+ {'timezones': ['أمريكا/غيانا'],
+ 'alpha-2-code': 'GY',
+ 'continent': 'أمريكا الجنوبية',
+ 'name': 'غيانا',
+ 'capital': 'جورج تاون'},
+ {'timezones': ['أمريكا/تيجوسيجالبا'],
+ 'alpha-2-code': 'HN',
+ 'continent': 'أمريكا الشمالية',
+ 'name': 'هندوراس',
+ 'capital': 'تيجوسيجالبا'},
+ {'timezones': ['أوروبا/بودابست'],
+ 'alpha-2-code': 'HU',
+ 'continent': 'أوروبا',
+ 'name': 'هنغاريا',
+ 'capital': 'بودابست'},
+ {'timezones': ['آسيا/جاكرتا',
+ 'آسيا/بونتياناك',
+ 'آسيا/ماكاسار',
+ 'آسيا/جايابورا'],
+ 'alpha-2-code': 'ID',
+ 'continent': 'آسيا',
+ 'name': 'إندونسيا',
+ 'capital': 'جاكرتا'},
+ {'timezones': ['أوروبا/دبلن'],
+ 'alpha-2-code': 'IE',
+ 'continent': 'أوروبا',
+ 'name': 'إيرلندا',
+ 'capital': 'دبلن'},
+ {'timezones': ['آسيا/القدس'],
+ 'alpha-2-code': 'IL',
+ 'continent': 'آسيا',
+ 'name': 'فلسطين',
+ 'capital': 'القدس'},
+ {'timezones': ['آسيا/كالكتا'],
+ 'alpha-2-code': 'IN',
+ 'continent': 'آسيا',
+ 'name': 'الهند',
+ 'capital': 'نيو دلهي'},
+ {'timezones': ['آسيا/بغداد'],
+ 'alpha-2-code': 'IQ',
+ 'continent': 'آسيا',
+ 'name': 'العراق',
+ 'capital': 'بغداد'},
+ {'timezones': ['آسيا/طهران'],
+ 'alpha-2-code': 'IR',
+ 'continent': 'آسيا',
+ 'name': 'إيران',
+ 'capital': 'طهران'},
+ {'timezones': ['الأطلنطي/ريكيافيك'],
+ 'alpha-2-code': 'IS',
+ 'continent': 'أوروبا',
+ 'name': 'آيسلندا',
+ 'capital': 'ريكيافيك'},
+ {'timezones': ['أوروبا/روما'],
+ 'alpha-2-code': 'IT',
+ 'continent': 'أوروبا',
+ 'name': 'إيطاليا',
+ 'capital': 'روما'},
+ {'timezones': ['أمريكا/جامايكا'],
+ 'alpha-2-code': 'JM',
+ 'continent': 'أمريكا الشمالية',
+ 'name': 'جامايكا',
+ 'capital': 'كينغستون'},
+ {'timezones': ['آسيا/عمّان'],
+ 'alpha-2-code': 'JO',
+ 'continent': 'آسيا',
+ 'name': 'الأردن',
+ 'capital': 'عمّان'},
+ {'timezones': ['آسيا/طوكيو'],
+ 'alpha-2-code': 'JP',
+ 'continent': 'آسيا',
+ 'name': 'اليابان',
+ 'capital': 'طوكيو'},
+ {'timezones': ['إفريقيا/نيروبي'],
+ 'alpha-2-code': 'KE',
+ 'continent': 'إفريقيا',
+ 'name': 'كينيا',
+ 'capital': 'نيروبي'},
+ {'timezones': ['آسيا/بشكيك'],
+ 'alpha-2-code': 'KG',
+ 'continent': 'آسيا',
+ 'name': 'قيرغيزستان',
+ 'capital': 'بشكيك'},
+ {'timezones': ['المحيط_الهاديء/تاراوا',
+ 'المحيط_الهاديء/إيديربيري',
+ 'المحيط_الهاديء/كريتيماتي'],
+ 'alpha-2-code': 'KI',
+ 'continent': 'أوقيانوسيا',
+ 'name': 'كيريباتي',
+ 'capital': 'جنوب تاراوا'},
+ {'timezones': ['آسيا/بيونغ_يانغ'],
+ 'alpha-2-code': 'KP',
+ 'continent': 'آسيا',
+ 'name': 'كوريا الشمالية',
+ 'capital': 'بيونغ يانغ'},
+ {'timezones': ['آسيا/سيؤول'],
+ 'alpha-2-code': 'KR',
+ 'continent': 'آسيا',
+ 'name': '؛كوريا الجنوبية',
+ 'capital': 'سيؤول'},
+ {'timezones': ['آسيا/الكويت'],
+ 'alpha-2-code': 'KW',
+ 'continent': 'آسيا',
+ 'name': 'الكويت',
+ 'capital': 'الكويت'},
+ {'timezones': ['آسيا/بيروت'],
+ 'alpha-2-code': 'LB',
+ 'continent': 'آسيا',
+ 'name': 'لبنان',
+ 'capital': 'بيروت'},
+ {'timezones': ['أوروبا/فادوز'],
+ 'alpha-2-code': 'LI',
+ 'continent': 'أوروبا',
+ 'name': 'ليختنشتاين',
+ 'capital': 'فادوز'},
+ {'timezones': ['إفريقيا/مونروفيا'],
+ 'alpha-2-code': 'LR',
+ 'continent': 'إفريقيا',
+ 'name': 'ليبيريا',
+ 'capital': 'مونروفيا'},
+ {'timezones': ['إفريقيا/ماسيرو'],
+ 'alpha-2-code': 'LS',
+ 'continent': 'إفريقيا',
+ 'name': 'ليسوتو',
+ 'capital': 'ماسيرو'},
+ {'timezones': ['أوروبا/فيلنيوس'],
+ 'alpha-2-code': 'LT',
+ 'continent': 'أوروبا',
+ 'name': 'ليتوانيا',
+ 'capital': 'فيلنيوس'},
+ {'timezones': ['أوروبا/لوكسمبرغ'],
+ 'alpha-2-code': 'LU',
+ 'continent': 'أوروبا',
+ 'name': 'لوكسمبرغ',
+ 'capital': 'لوكسمبرغ سيتي'},
+ {'timezones': ['أوروبا/ربيغ'],
+ 'alpha-2-code': 'LV',
+ 'continent': 'أوروبا',
+ 'name': 'لاتفيا',
+ 'capital': 'ربيغ'},
+ {'timezones': ['إفريقيا/طرابلس'],
+ 'alpha-2-code': 'LY',
+ 'continent': 'إفريقيا',
+ 'name': 'ليبيا',
+ 'capital': 'طرابلس'},
+ {'timezones': ['الهندي/أنتاناناريفو'],
+ 'alpha-2-code': 'MG',
+ 'continent': 'إفريقيا',
+ 'name': 'مدغشقر',
+ 'capital': 'أنتاناناريفو'},
+ {'timezones': ['المحيط_الهاديء/ماجورو',
+ 'المحيط_الهاديء/كواجلين_أتول'],
+ 'alpha-2-code': 'MH',
+ 'continent': 'أوقيانوسيا',
+ 'name': 'جزر مارشال',
+ 'capital': 'ماجورو'},
+ {'timezones': ['أوروبا/سكوبيه'],
+ 'alpha-2-code': 'MK',
+ 'continent': 'أوروبا',
+ 'name': 'جمهورية مقدونيا',
+ 'capital': 'سكوبيه'},
+ {'timezones': ['إفريقيا/باماكو'],
+ 'alpha-2-code': 'ML',
+ 'continent': 'إفريقيا',
+ 'name': 'مالي',
+ 'capital': 'باماكو'},
+ {'timezones': ['آسيا/رانغون'],
+ 'alpha-2-code': 'MM',
+ 'continent': 'آسيا',
+ 'name': 'ميانمار',
+ 'capital': 'نايبيداو'},
+ {'timezones': ['آسيا/أولان_باتور',
+ 'آسيا/Hovd',
+ 'آسيا/تشويبالسان'],
+ 'alpha-2-code': 'MN',
+ 'continent': 'آسيا',
+ 'name': 'مانغوليا',
+ 'capital': 'أولان باتور'},
+ {'timezones': ['إفريقيا/نواكشط'],
+ 'alpha-2-code': 'MR',
+ 'continent': 'إفريقيا',
+ 'name': 'موريتانيا',
+ 'capital': 'نواكشط'},
+ {'timezones': ['أوروبا/مالطا'],
+ 'alpha-2-code': 'MT',
+ 'continent': 'أوروبا',
+ 'name': 'مالطا',
+ 'capital': 'فاليتا'},
+ {'timezones': ['الهندي/موريشيوس'],
+ 'alpha-2-code': 'MU',
+ 'continent': 'إفريقيا',
+ 'name': 'موريشيوس',
+ 'capital': 'بور لويس'},
+ {'timezones': ['الهندي/جزر_المالديف'],
+ 'alpha-2-code': 'MV',
+ 'continent': 'آسيا',
+ 'name': 'جمهورية المالديف',
+ 'capital': 'ماليه'},
+ {'timezones': ['إفريقيا/بلانتاير'],
+ 'alpha-2-code': 'MW',
+ 'continent': 'إفريقيا',
+ 'name': 'ملاوي',
+ 'capital': 'ليلونغوي'},
+ {'timezones': ['أمريكا/ميكسيكو_سيتي',
+ 'أمريكا/كانكون',
+ 'أمريكا/ميرديا',
+ 'أمريكا/مونتيري',
+ 'أمريكا/مازاتلان',
+ 'أمريكا/شيواوا',
+ 'أمريكا/ارموسييو_سونورا',
+ 'أمريكا/تيخوانا'],
+ 'alpha-2-code': 'MX',
+ 'continent': 'أمريكا الشمالية',
+ 'name': 'المكسيك',
+ 'capital': 'ميكسيكو سيتي§'},
+ {'timezones': ['آسيا/كوالا_لامبور',
+ 'آسيا/Kuching'],
+ 'alpha-2-code': 'MY',
+ 'continent': 'آسيا',
+ 'name': 'ماليزيا',
+ 'capital': 'كوالا لامبور'},
+ {'timezones': ['إفريقيا/مابوتو'],
+ 'alpha-2-code': 'MZ',
+ 'continent': 'إفريقيا',
+ 'name': 'موزمبيق',
+ 'capital': 'مابوتو'},
+ {'timezones': ['إفريقيا/ويندهوك'],
+ 'alpha-2-code': 'NA',
+ 'continent': 'إفريقيا',
+ 'name': 'ناميبيا',
+ 'capital': 'ويندهوك'},
+ {'timezones': ['إفريقيا/نيامي'],
+ 'alpha-2-code': 'NE',
+ 'continent': 'إفريقيا',
+ 'name': 'النيجر',
+ 'capital': 'نيامي'},
+ {'timezones': ['إفريقيا/لاغوس'],
+ 'alpha-2-code': 'NG',
+ 'continent': 'إفريقيا',
+ 'name': 'نيجيريا',
+ 'capital': 'أبوجا'},
+ {'timezones': ['أمريكا/ماناغوا'],
+ 'alpha-2-code': 'NI',
+ 'continent': 'أمريكا الشمالية',
+ 'name': 'نيكاراغوا',
+ 'capital': 'ماناغوا'},
+ {'timezones': ['أوروبا/أمستردام'],
+ 'alpha-2-code': 'NL',
+ 'continent': 'أوروبا',
+ 'name': 'هولندا',
+ 'capital': 'أمستردام'},
+ {'timezones': ['أوروبا/أوسلو'],
+ 'alpha-2-code': 'NO',
+ 'continent': 'أوروبا',
+ 'name': 'النرويج',
+ 'capital': 'أوسلو'},
+ {'timezones': ['آسيا/كاتماندو'],
+ 'alpha-2-code': 'NP',
+ 'continent': 'آسيا',
+ 'name': 'النيبال',
+ 'capital': 'كاتماندو'},
+ {'timezones': ['المحيط_الهاديء/ناورو'],
+ 'alpha-2-code': 'NR',
+ 'continent': 'أوقيانوسيا',
+ 'name': 'ناورو',
+ 'capital': 'يارين'},
+ {'timezones': ['المحيط_الهاديء/أوكلاند',
+ 'المحيط_الهاديء/تشاتهام'],
+ 'alpha-2-code': 'NZ',
+ 'continent': 'أوقيانوسيا',
+ 'name': 'نيوزيلاندا',
+ 'capital': 'ويلينغتون'},
+ {'timezones': ['آسيا/مسقط'],
+ 'alpha-2-code': 'OM',
+ 'continent': 'آسيا',
+ 'name': 'عمان',
+ 'capital': 'مسقط'},
+ {'timezones': ['أمريكا/بنما'],
+ 'alpha-2-code': 'PA',
+ 'continent': 'أمريكا الشمالية',
+ 'name': 'بنما',
+ 'capital': 'بنما'},
+ {'timezones': ['أمريكا/ليما'],
+ 'alpha-2-code': 'PE',
+ 'continent': 'أمريكا الجنوبية',
+ 'name': 'البيرو',
+ 'capital': 'ليما'},
+ {'timezones': ['المحيط_الهاديء/بورت_مورسبي'],
+ 'alpha-2-code': 'PG',
+ 'continent': 'أوقيانوسيا',
+ 'name': 'بابوا غينيا الجديدة',
+ 'capital': 'بورت مورسبي'},
+ {'timezones': ['آسيا/مانيلا'],
+ 'alpha-2-code': 'PH',
+ 'continent': 'آسيا',
+ 'name': 'الفيليبين',
+ 'capital': 'مانيلا'},
+ {'timezones': ['آسيا/كاراتشي'],
+ 'alpha-2-code': 'PK',
+ 'continent': 'آسيا',
+ 'name': 'باكستان',
+ 'capital': 'إسلام أباد'},
+ {'timezones': ['أوروبا/وارسو'],
+ 'alpha-2-code': 'PL',
+ 'continent': 'أوروبا',
+ 'name': 'بولندا',
+ 'capital': 'وارسو'},
+ {'timezones': ['أوروبا/لشبونة',
+ 'الأطلنطي/ماديرا',
+ 'الأطلنطي/الأزور'],
+ 'alpha-2-code': 'PT',
+ 'continent': 'أوروبا',
+ 'name': 'البرتغال',
+ 'capital': 'لشبونة'},
+ {'timezones': ['المحيط_الهاديء/بالاو'],
+ 'alpha-2-code': 'PW',
+ 'continent': 'أوقيانوسيا',
+ 'name': 'بالاو',
+ 'capital': 'نجيرولمد'},
+ {'timezones': ['أمريكا/أسونسيون'],
+ 'alpha-2-code': 'PY',
+ 'continent': 'أمريكا الجنوبية',
+ 'name': 'بابرغوي',
+ 'capital': 'أسونسيون'},
+ {'timezones': ['آسيا/قطر'],
+ 'alpha-2-code': 'QA',
+ 'continent': 'آسيا',
+ 'name': 'قطر',
+ 'capital': 'الدوحة'},
+ {'timezones': ['أوروبا/بوخارست'],
+ 'alpha-2-code': 'RO',
+ 'continent': 'أوروبا',
+ 'name': 'رومانيا',
+ 'capital': 'بوخارست'},
+ {'timezones': ['أوروبا/كالينينغراد',
+ 'أوروبا/موسكو',
+ 'أوروبا/Volgograd',
+ 'أوروبا/سمارة',
+ 'آسيا/يكاترينبورغ',
+ 'آسيا/أومسك',
+ 'آسيا/نوفوسيبيرسك',
+ 'آسيا/كراسنوياسك',
+ 'آسيا/إروتسك',
+ 'آسيا/ياكوتسك',
+ 'آسيا/فالديفوستوك',
+ 'آسيا/ساخالن',
+ 'آسيا/ماغادان',
+ 'آسيا/كامشتكا',
+ 'آسيا/أنادير'],
+ 'alpha-2-code': 'RU',
+ 'continent': 'أوروبا',
+ 'name': 'روسيا',
+ 'capital': 'موسكو'},
+ {'timezones': ['إفريقيا/كيغالي'],
+ 'alpha-2-code': 'RW',
+ 'continent': 'إفريقيا',
+ 'name': 'رواندا',
+ 'capital': 'كيغالي'},
+ {'timezones': ['آسيا/الرياض'],
+ 'alpha-2-code': 'SA',
+ 'continent': 'آسيا',
+ 'name': 'المملكة العربية السعودية',
+ 'capital': 'الرياض'},
+ {'timezones': ['المحيط_الهاديء/غوادالكانال'],
+ 'alpha-2-code': 'SB',
+ 'continent': 'أوقيانوسيا',
+ 'name': 'جزر سولمون',
+ 'capital': 'هونيارا'},
+ {'timezones': ['الهندي/ماهي'],
+ 'alpha-2-code': 'SC',
+ 'continent': 'إفريقيا',
+ 'name': 'سيشل',
+ 'capital': 'فيكتوريا'},
+ {'timezones': ['إفريقيا/الخرطوم'],
+ 'alpha-2-code': 'SD',
+ 'continent': 'إفريقيا',
+ 'name': 'السودان',
+ 'capital': 'الخرطوم'},
+ {'timezones': ['أوروبا/ستوكهولم'],
+ 'alpha-2-code': 'SE',
+ 'continent':'أوروبا',
+ 'name': 'السويد',
+ 'capital': 'ستوكهولم'},
+ {'timezones': ['آسيا/سنغافورة'],
+ 'alpha-2-code': 'SG',
+ 'continent': 'آسيا',
+ 'name': 'سنغافورة',
+ 'capital': 'سنغافورة'},
+ {'timezones': ['أوروبا/ليوبليانا'],
+ 'alpha-2-code': 'SI',
+ 'continent': 'أوروبا',
+ 'name': 'سلوفانيا',
+ 'capital': 'ليوبليانا'},
+ {'timezones': ['أوروبا/براتيسلافا'],
+ 'alpha-2-code': 'SK',
+ 'continent': 'أوروبا',
+ 'name': 'سلوفاكيا',
+ 'capital': 'براتيسلافا'},
+ {'timezones': ['إفريقيا/فريتاون'],
+ 'alpha-2-code': 'SL',
+ 'continent': 'إفريقيا',
+ 'name': 'سيراليون',
+ 'capital': 'فريتاون'},
+ {'timezones': ['أوروبا/سان_مارينو'],
+ 'alpha-2-code': 'SM',
+ 'continent': 'أوروبا',
+ 'name': 'جمهورية سان مارينو',
+ 'capital': 'سان مارينو'},
+ {'timezones': ['إفريقيا/داكار'],
+ 'alpha-2-code': 'SN',
+ 'continent': 'إفريقيا',
+ 'name': 'السنغال',
+ 'capital': 'داكار'},
+ {'timezones': ['إفريقيا/مقديشو'],
+ 'alpha-2-code': 'SO',
+ 'continent': 'إفريقيا',
+ 'name': 'الصومال',
+ 'capital': 'مقديشو'},
+ {'timezones': ['أمريكا/باراماريبو'],
+ 'alpha-2-code': 'SR',
+ 'continent': 'أمريكا الجنوبية',
+ 'name': 'Suriname',
+ 'capital': 'باراماريبو'},
+ {'timezones': ['إفريقيا/ساو_تومي'],
+ 'alpha-2-code': 'ST',
+ 'continent': 'إفريقيا',
+ 'name': ' ساو تومي وبرينسيب',
+ 'capital': 'ساو تومي'},
+ {'timezones': ['آسيا/دممشق'],
+ 'alpha-2-code': 'SY',
+ 'continent': 'آسيا',
+ 'name': 'سوريا',
+ 'capital': 'دمشق'},
+ {'timezones': ['إفريقيا/لومي'],
+ 'alpha-2-code': 'TG',
+ 'continent': 'إفريقيا',
+ 'name': 'توغو',
+ 'capital': 'لومي'},
+ {'timezones': ['آسيا/بانغوك'],
+ 'alpha-2-code': 'TH',
+ 'continent': 'آسيا',
+ 'name': 'تايلند',
+ 'capital': 'بناغوك'},
+ {'timezones': ['آسيا/دوشنبه'],
+ 'alpha-2-code': 'TJ',
+ 'continent': 'آسيا',
+ 'name': 'طاجكيستان',
+ 'capital': 'دوشنبه'},
+ {'timezones': ['آسيا/عشق_آباد'],
+ 'alpha-2-code': 'TM',
+ 'continent': 'آسيا',
+ 'name': 'تركمانستان',
+ 'capital': 'عشق آباد'},
+ {'timezones': ['إفريقيا/تونس'],
+ 'alpha-2-code': 'TN',
+ 'continent': 'إفريقيا',
+ 'name': 'تونس',
+ 'capital': 'تونس'},
+ {'timezones': ['المحيط_الهاديء/تونغاتابو'],
+ 'alpha-2-code': 'TO',
+ 'continent': 'أوقيانوسيا',
+ 'name': 'تونغا',
+ 'capital': 'نوكو ألوفا'},
+ {'timezones': ['أوروبا/إسطنبول'],
+ 'alpha-2-code': 'TR',
+ 'continent': 'آسيا',
+ 'name': 'تركيا',
+ 'capital': 'أنقرة'},
+ {'timezones': ['أمريكا/بورت_أوف_سبين'],
+ 'alpha-2-code': 'TT',
+ 'continent': 'أمريكا الشمالية',
+ 'name': 'ترينيداد وتوباغو',
+ 'capital': 'بورت أوف سبين'},
+ {'timezones': ['المحيط_الهاديء/فونافوتي'],
+ 'alpha-2-code': 'TV',
+ 'continent': 'أوقيانوسيا',
+ 'name': 'توفالو',
+ 'capital': 'فونافوتي'},
+ {'timezones': ['إفريقيا/دار_السلام'],
+ 'alpha-2-code': 'TZ',
+ 'continent': 'إفريقيا',
+ 'name': 'تانزانيا',
+ 'capital': 'دودوما'},
+ {'timezones': ['أوروبا/كييف',
+ 'أوروبا/أوجهورود',
+ 'أوروبا/زاباروجيا',
+ 'أوروبا/سيمفروبول'],
+ 'alpha-2-code': 'UA',
+ 'continent': 'أوروبا',
+ 'name': 'أوكرانيا',
+ 'capital': 'كييف'},
+ {'timezones': ['إفريقيا/كامبالا'],
+ 'alpha-2-code': 'UG',
+ 'continent': 'إفريقيا',
+ 'name': 'أوغندا',
+ 'capital': 'كامبالا'},
+ {'timezones': ['أمريكا/نيويورك',
+ 'أمريكا/ديترويت',
+ 'أمريكا/كنتاكي/لويسفيل',
+ 'أمريكا/كنتاكي/مونتيسللو',
+ 'أمريكا/إنديانا/إنديانابولس',
+ 'أمريكا/إنديانا/مارنغو',
+ 'أمريكا/إنديانا/نوكس',
+ 'أمريكا/إنديانا/فيفاي',
+ 'أمريكا/شيكاغو',
+ 'أمريكا/إنديانا/فانسان',
+ 'أمريكا/إنديانا/بيترزبيرغ',
+ 'أمريكا/مينومني',
+ 'أمريكا/نورث_داكوتا/سينتر',
+ 'أمريكا/نورث_داكوتا/نيو_سالم',
+ 'أمريكا/دنفر',
+ 'أمريكا/بويسي',
+ 'أمريكا/شيبروك',
+ 'أمريكا/فينيكس',
+ 'أمريكا/لوس_أنجيلوس',
+ 'أمريكا/أنكوريج',
+ 'أمريكا/جونو',
+ 'أمريكا/ياكوتات',
+ 'أمريكا/نوم',
+ 'أمريكا/أداك',
+ 'المحيط_الهاديء/هونولولو'],
+ 'alpha-2-code': 'US',
+ 'continent': 'أمريكا الشمالية',
+ 'name': 'الولايات المتحدة الأمريكية',
+ 'capital': 'واشنطن'},
+ {'timezones': ['أمريكا/مونتفيدو'],
+ 'alpha-2-code': 'UY',
+ 'continent': 'أمريكا الجنوبية',
+ 'name': 'أوروغواي',
+ 'capital': 'مونتفيدو'},
+ {'timezones': ['آسيا/سمرقند',
+ 'آسيا/طشقند'],
+ 'alpha-2-code': 'UZ',
+ 'continent': 'آسيا',
+ 'name': 'أوزبكستان',
+ 'capital': 'طشقند'},
+ {'timezones': ['أوروبا/الفاتيكان'],
+ 'alpha-2-code': 'VA',
+ 'continent': 'أوروبا',
+ 'name': 'الفاتيكان',
+ 'capital': 'الفاتيكان'},
+ {'timezones': ['أمريكا/كاركاس'],
+ 'alpha-2-code': 'VE',
+ 'continent': 'أمريكا الجنوبية',
+ 'name': 'فنزويلا',
+ 'capital': 'كاركاس'},
+ {'timezones': ['آسيا/سايغون'],
+ 'alpha-2-code': 'VN',
+ 'continent': 'آسيا',
+ 'name': 'فيتنام',
+ 'capital': 'هانوي'},
+ {'timezones': ['المحيط_الهاديء/أيفاتي'],
+ 'alpha-2-code': 'VU',
+ 'continent': 'أوقيانوسيا',
+ 'name': 'فانواتو',
+ 'capital': 'بورت فيلا'},
+ {'timezones': ['آسيا/عدن'],
+ 'alpha-2-code': 'YE',
+ 'continent': 'آسيا',
+ 'name': 'اليمن',
+ 'capital': "صنعاء"},
+ {'timezones': ['إفريقيا/لوساكا'],
+ 'alpha-2-code': 'ZM',
+ 'continent': 'إفريقيا',
+ 'name': 'زامبيا',
+ 'capital': 'لوساكا'},
+ {'timezones': ['إفريقيا/هراري'],
+ 'alpha-2-code': 'ZW',
+ 'continent': 'إفريقيا',
+ 'name': 'زيمبابوي',
+ 'capital': 'هراري'},
+ {'timezones': ['إفريقيا/الجزائر'],
+ 'alpha-2-code': 'DZ',
+ 'continent': 'إفريقيا',
+ 'name': 'الجزائر',
+ 'capital': 'الجزائر'},
+ {'timezones': ['أوروبا/سراييفو'],
+ 'alpha-2-code': 'BA',
+ 'continent': 'أوروبا',
+ 'name': 'البوسنة والهرسك',
+ 'capital': 'سراييفو'},
+ {'timezones': ['آسيا/بنوم_بنه'],
+ 'alpha-2-code': 'KH',
+ 'continent': 'آسيا',
+ 'name': 'كمبوديا',
+ 'capital': 'بنوم بنه'},
+ {'timezones': ['إفريقيا/بانغي'],
+ 'alpha-2-code': 'CF',
+ 'continent': 'إفريقيا',
+ 'name': 'جمهورية أفريقيا الوسطى',
+ 'capital': 'بانغي'},
+ {'timezones': ['إفريقيا/نجامينا'],
+ 'alpha-2-code': 'TD',
+ 'continent': 'إفريقيا',
+ 'name': 'تشاد',
+ 'capital': "نجامينا"},
+ {'timezones': ['الهندي/كومورو'],
+ 'alpha-2-code': 'KM',
+ 'continent': 'إفريقيا',
+ 'name': 'جزر القمر',
+ 'capital': 'موروني'},
+ {'timezones': ['أوروبا/زغرب'],
+ 'alpha-2-code': 'HR',
+ 'continent': 'أوروبا',
+ 'name': 'كرواتيا',
+ 'capital': 'زغرب'},
+ {'timezones': ['آسيا/ديلي'],
+ 'alpha-2-code': 'TL',
+ 'continent': 'آسيا',
+ 'name': 'تيمور الشرقية',
+ 'capital': 'ديلي'},
+ {'timezones': ['أمريكا/السلفادور'],
+ 'alpha-2-code': 'SV',
+ 'continent': 'أمريكا الشمالية',
+ 'name': 'السلفادور',
+ 'capital': 'سان سلفادور'},
+ {'timezones': ['إفريقيا/مالابو'],
+ 'alpha-2-code': 'GQ',
+ 'continent': 'إفريقيا',
+ 'name': 'غينيا الاستوائية',
+ 'capital': 'مالابو'},
+ {'timezones': ['أمريكا/غرينادا'],
+ 'alpha-2-code': 'GD',
+ 'continent': 'أمريكا الشمالية',
+ 'name': 'غرينادا',
+ 'capital': "سانت جورجز"},
+ {'timezones': ['آسيا/ألماتي',
+ 'آسيا/كيزيلوردا',
+ 'آسيا/أقتوبي',
+ 'آسيا/أقتاو',
+ 'آسيا/أورال'],
+ 'alpha-2-code': 'KZ',
+ 'continent': 'آسيا',
+ 'name': 'كازاخستان',
+ 'capital': 'أستانة'},
+ {'timezones': ['آسيا/فيينتيان'],
+ 'alpha-2-code': 'LA',
+ 'continent': 'آسيا',
+ 'name': 'لاوس',
+ 'capital': 'فيينتيان'},
+ {'timezones': ['المحيط_الهاديء/تشوك',
+ 'المحيط_الهاديء/بونابي',
+ 'المحيط_الهاديء/كورساي'],
+ 'alpha-2-code': 'FM',
+ 'continent': 'أوقيانوسيا',
+ 'name': 'ولايات ميكرونيسيا المتحدة',
+ 'capital': 'باليكير'},
+ {'timezones': ['أوروبا/كيشيناو'],
+ 'alpha-2-code': 'MD',
+ 'continent': 'أوروبا',
+ 'name': 'مولدافيا',
+ 'capital': 'كيشيناو'},
+ {'timezones': ['أوروبا/موناكو'],
+ 'alpha-2-code': 'MC',
+ 'continent': 'أوروبا',
+ 'name': 'موناكو',
+ 'capital': 'موناكو'},
+ {'timezones': ['أوروبا/بودغوريتسا'],
+ 'alpha-2-code': 'ME',
+ 'continent': 'أوروبا',
+ 'name': 'الجبل الأسود',
+ 'capital': 'بودغوريتسا'},
+ {'timezones': ['إفريقيا/الدار_البيضاء'],
+ 'alpha-2-code': 'MA',
+ 'continent': 'إفريقيا',
+ 'name': 'المغرب',
+ 'capital': 'الرباط'},
+ {'timezones': ['أمريكا/سانت_كيتس'],
+ 'alpha-2-code': 'KN',
+ 'continent': 'أمريكا الشمالية',
+ 'name': 'سانت كيتس ونيفيس',
+ 'capital': 'باستير'},
+ {'timezones': ['أمريكا/سانت_لوسيا'],
+ 'alpha-2-code': 'LC',
+ 'continent': 'أمريكا الشمالية',
+ 'name': 'سانت لوسيا',
+ 'capital': 'كاستريس'},
+ {'timezones': ['أمريكا/سينت_فينسينت'],
+ 'alpha-2-code': 'VC',
+ 'continent': 'أمريكا الشمالية',
+ 'name': 'سانت فينسنت والغرينادين',
+ 'capital': 'كينغستاون'},
+ {'timezones': ['المحيط_الهاديء/أبيا'],
+ 'alpha-2-code': 'WS',
+ 'continent': 'أوقيانوسيا',
+ 'name': 'ساموا',
+ 'capital': 'أبيا'},
+ {'timezones': ['أوروبا/بلغراد'],
+ 'alpha-2-code': 'RS',
+ 'continent': 'أوروبا',
+ 'name': 'صربيا',
+ 'capital': 'بلغراد'},
+ {'timezones': ['إفريقيا/جوهانسبرغ'],
+ 'alpha-2-code': 'ZA',
+ 'continent': 'إفريقيا',
+ 'name': 'جنوب إفريقيا',
+ 'capital': 'بريتوريا'},
+ {'timezones': ['أوروبا/مدريد',
+ 'إفريقيا/سبتة',
+ 'الأطلنطي/الكناري'],
+ 'alpha-2-code': 'ES',
+ 'continent': 'أوروبا',
+ 'name': 'إسبانيا',
+ 'capital': 'مدريد'},
+ {'timezones': ['آسيا/كولمبو'],
+ 'alpha-2-code': 'LK',
+ 'continent': 'آسيا',
+ 'name': 'سريلانكا',
+ 'capital': 'سري جاياواردنابورا كوتي'},
+ {'timezones': ['إفريقيا/مبابان'],
+ 'alpha-2-code': 'SZ',
+ 'continent': 'إفريقيا',
+ 'name': 'سوازيلاند',
+ 'capital': 'مبابان'},
+ {'timezones': ['أوروبا/زيورخ'],
+ 'alpha-2-code': 'CH',
+ 'continent': 'أوروبا',
+ 'name': 'سويسرا',
+ 'capital': 'برن'},
+ {'timezones': ['آسيا/دبي'],
+ 'alpha-2-code': 'AE',
+ 'continent': 'آسيا',
+ 'name': 'الإمارات العربية المتحدة',
+ 'capital': 'أبو ظبي'},
+ {'timezones': ['أوروبا/لندن'],
+ 'alpha-2-code': 'GB',
+ 'continent': 'أوروبا',
+ 'name': 'المملكة المتحدة',
+ 'capital': 'لندن'},
+ ]
AM_PM = {
'AM': 'ص',
diff --git a/src/libs/faker/providers/date_time/ar_EG/__init__.py b/src/libs/faker/providers/date_time/ar_EG/__init__.py
index 9e68d71..e85d065 100644
--- a/src/libs/faker/providers/date_time/ar_EG/__init__.py
+++ b/src/libs/faker/providers/date_time/ar_EG/__init__.py
@@ -18,5 +18,5 @@ class Provider(ArabicDateTimeProvider):
'09': 'سبتمبر',
'10': 'أكتوبر',
'11': 'نوفمبر',
- '12': 'ديسمبر'
+ '12': 'ديسمبر',
}
diff --git a/src/libs/faker/providers/date_time/hu_HU/__init__.py b/src/libs/faker/providers/date_time/hu_HU/__init__.py
index 7b87d97..3ca1d26 100644
--- a/src/libs/faker/providers/date_time/hu_HU/__init__.py
+++ b/src/libs/faker/providers/date_time/hu_HU/__init__.py
@@ -3,6 +3,7 @@
from __future__ import unicode_literals
from .. import Provider as DateTimeProvider
+
class Provider(DateTimeProvider):
def day_of_week(self):
diff --git a/src/libs/faker/providers/date_time/id_ID/__init__.py b/src/libs/faker/providers/date_time/id_ID/__init__.py
index 9e90ff1..5904d2d 100644
--- a/src/libs/faker/providers/date_time/id_ID/__init__.py
+++ b/src/libs/faker/providers/date_time/id_ID/__init__.py
@@ -3,6 +3,7 @@
from __future__ import unicode_literals
from .. import Provider as DateTimeProvider
+
class Provider(DateTimeProvider):
def day_of_week(self):
diff --git a/src/libs/faker/providers/date_time/pl_PL/__init__.py b/src/libs/faker/providers/date_time/pl_PL/__init__.py
index d2b3cc8..75e47cc 100644
--- a/src/libs/faker/providers/date_time/pl_PL/__init__.py
+++ b/src/libs/faker/providers/date_time/pl_PL/__init__.py
@@ -29,7 +29,7 @@ class Provider(DateTimeProvider):
'09': 'wrzesień',
'10': 'październik',
'11': 'listopad',
- '12': 'grudzień'
+ '12': 'grudzień',
}
def day_of_week(self):
diff --git a/src/libs/faker/providers/file/__init__.py b/src/libs/faker/providers/file/__init__.py
index a82357e..a81f5c6 100644
--- a/src/libs/faker/providers/file/__init__.py
+++ b/src/libs/faker/providers/file/__init__.py
@@ -1,5 +1,7 @@
# coding=utf-8
from __future__ import unicode_literals
+
+import string
from collections import OrderedDict
from .. import BaseProvider
@@ -8,104 +10,128 @@
class Provider(BaseProvider):
application_mime_types = (
- "application/atom+xml", # Atom feeds
+ "application/atom+xml", # Atom feeds
"application/ecmascript",
- # ECMAScript/JavaScript; Defined in RFC 4329 (equivalent to application/javascript but with stricter processing rules)
- "application/EDI-X12", # EDI X12 data; Defined in RFC 1767
- "application/EDIFACT", # EDI EDIFACT data; Defined in RFC 1767
- "application/json", # JavaScript Object Notation JSON; Defined in RFC 4627
- "application/javascript", # ECMAScript/JavaScript; Defined in RFC 4329 (equivalent to application/ecmascript
+ # ECMAScript/JavaScript; Defined in RFC 4329 (equivalent to
+ # application/javascript but with stricter processing rules)
+ "application/EDI-X12", # EDI X12 data; Defined in RFC 1767
+ "application/EDIFACT", # EDI EDIFACT data; Defined in RFC 1767
+ "application/json", # JavaScript Object Notation JSON; Defined in RFC 4627
+ # ECMAScript/JavaScript; Defined in RFC 4329 (equivalent to
+ # application/ecmascript
+ "application/javascript",
# but with looser processing rules) It is not accepted in IE 8
# or earlier - text/javascript is accepted but it is defined as obsolete in RFC 4329.
# The "type" attribute of the