tzdata
¶
tzdata - Imports timezone data files from UNIX zoneinfo.
-
class
upoints.tzdata.
Zone
(location, country, zone, comments=None)[source]¶ Bases:
upoints.point.Point
Class for representing timezone descriptions from zoneinfo data.
New in version 0.6.0.
Initialise a new
Zone
object.Parameters:
-
class
upoints.tzdata.
Zones
(zone_file=None)[source]¶ Bases:
upoints.point.Points
Class for representing a group of
Zone
objects.New in version 0.6.0.
Initialise a new Zones object.
-
dump_zone_file
()[source]¶ Generate a zoneinfo compatible zone description table.
Returns: zoneinfo descriptions Return type: list
-
import_locations
(zone_file)[source]¶ Parse zoneinfo zone description data files.
import_locations()
returns a list ofZone
objects.It expects data files in one of the following formats:
AN +1211-06900 America/Curacao AO -0848+01314 Africa/Luanda AQ -7750+16636 Antarctica/McMurdo McMurdo Station, Ross Island
Files containing the data in this format can be found in the
zone.tab
file that is normally found in/usr/share/zoneinfo
on UNIX-like systems, or from the standard distribution site.When processed by
import_locations()
alist
object of the following style will be returned:[Zone(None, None, "AN", "America/Curacao", None), Zone(None, None, "AO", "Africa/Luanda", None), Zone(None, None, "AO", "Antartica/McMurdo", ["McMurdo Station", "Ross Island"])]
Parameters: zone_file (iter) – zone.tab
data to readReturns: Locations as Zone
objectsReturn type: list Raises: FileFormatError
– Unknown file format
-