{
    "content": [
        {
            "type": "text",
            "text": "# pytz (pydoc)\n\n**Summary:** pytz\n\n## Section Outline\n\n- **NAME** (2 lines)\n- **DESCRIPTION** (8 lines)\n- **PACKAGE CONTENTS** (6 lines)\n- **CLASSES** (10 lines) — 5 subsections\n  - class AmbiguousTimeError (77 lines)\n  - class BaseTzInfo (51 lines)\n  - class InvalidTimeError (70 lines)\n  - class NonExistentTimeError (75 lines)\n  - class UnknownTimeZoneError (88 lines)\n- **FUNCTIONS** (53 lines) — 1 subsections\n  - timezone (35 lines)\n- **DATA** (9 lines)\n- **VERSION** (2 lines)\n- **FILE** (3 lines)\n\n## Full Content\n\n### NAME\n\npytz\n\n### DESCRIPTION\n\ndatetime.tzinfo timezone definitions generated from the\nOlson timezone database:\n\nftp://elsie.nci.nih.gov/pub/tz*.tar.gz\n\nSee the datetime section of the Python Library Reference for information\non how to use these modules.\n\n### PACKAGE CONTENTS\n\nexceptions\nlazy\nreference\ntzfile\ntzinfo\n\n### CLASSES\n\nbuiltins.KeyError(builtins.LookupError)\npytz.exceptions.UnknownTimeZoneError(builtins.KeyError, pytz.exceptions.Error)\ndatetime.tzinfo(builtins.object)\npytz.tzinfo.BaseTzInfo\npytz.exceptions.Error(builtins.Exception)\npytz.exceptions.InvalidTimeError\npytz.exceptions.AmbiguousTimeError\npytz.exceptions.NonExistentTimeError\npytz.exceptions.UnknownTimeZoneError(builtins.KeyError, pytz.exceptions.Error)\n\n#### class AmbiguousTimeError\n\n|  Exception raised when attempting to create an ambiguous wallclock time.\n|\n|  At the end of a DST transition period, a particular wallclock time will\n|  occur twice (once before the clocks are set back, once after). Both\n|  possibilities may be correct, unless further information is supplied.\n|\n|  See DstTzInfo.normalize() for more info\n|\n|  Method resolution order:\n|      AmbiguousTimeError\n|      InvalidTimeError\n|      Error\n|      builtins.Exception\n|      builtins.BaseException\n|      builtins.object\n|\n|  Data descriptors inherited from Error:\n|\n|  weakref\n|      list of weak references to the object (if defined)\n|\n|  ----------------------------------------------------------------------\n|  Methods inherited from builtins.Exception:\n|\n|  init(self, /, *args, kwargs)\n|      Initialize self.  See help(type(self)) for accurate signature.\n|\n|  ----------------------------------------------------------------------\n|  Static methods inherited from builtins.Exception:\n|\n|  new(*args, kwargs) from builtins.type\n|      Create and return a new object.  See help(type) for accurate signature.\n|\n|  ----------------------------------------------------------------------\n|  Methods inherited from builtins.BaseException:\n|\n|  delattr(self, name, /)\n|      Implement delattr(self, name).\n|\n|  getattribute(self, name, /)\n|      Return getattr(self, name).\n|\n|  reduce(...)\n|      Helper for pickle.\n|\n|  repr(self, /)\n|      Return repr(self).\n|\n|  setattr(self, name, value, /)\n|      Implement setattr(self, name, value).\n|\n|  setstate(...)\n|\n|  str(self, /)\n|      Return str(self).\n|\n|  withtraceback(...)\n|      Exception.withtraceback(tb) --\n|      set self.traceback to tb and return self.\n|\n|  ----------------------------------------------------------------------\n|  Data descriptors inherited from builtins.BaseException:\n|\n|  cause\n|      exception cause\n|\n|  context\n|      exception context\n|\n|  dict\n|\n|  suppresscontext\n|\n|  traceback\n|\n|  args\n\n#### class BaseTzInfo\n\n|  Method resolution order:\n|      BaseTzInfo\n|      datetime.tzinfo\n|      builtins.object\n|\n|  Methods defined here:\n|\n|  str(self)\n|      Return str(self).\n|\n|  ----------------------------------------------------------------------\n|  Data descriptors defined here:\n|\n|  dict\n|      dictionary for instance variables (if defined)\n|\n|  weakref\n|      list of weak references to the object (if defined)\n|\n|  ----------------------------------------------------------------------\n|  Data and other attributes defined here:\n|\n|  zone = None\n|\n|  ----------------------------------------------------------------------\n|  Methods inherited from datetime.tzinfo:\n|\n|  getattribute(self, name, /)\n|      Return getattr(self, name).\n|\n|  reduce(...)\n|      -> (cls, state)\n|\n|  dst(...)\n|      datetime -> DST offset as timedelta positive east of UTC.\n|\n|  fromutc(...)\n|      datetime in UTC -> datetime in local time.\n|\n|  tzname(...)\n|      datetime -> string name of time zone.\n|\n|  utcoffset(...)\n|      datetime -> timedelta showing offset from UTC, negative values indicating West of UTC\n|\n|  ----------------------------------------------------------------------\n|  Static methods inherited from datetime.tzinfo:\n|\n|  new(*args, kwargs) from builtins.type\n|      Create and return a new object.  See help(type) for accurate signature.\n\n#### class InvalidTimeError\n\n|  Base class for invalid time exceptions.\n|\n|  Method resolution order:\n|      InvalidTimeError\n|      Error\n|      builtins.Exception\n|      builtins.BaseException\n|      builtins.object\n|\n|  Data descriptors inherited from Error:\n|\n|  weakref\n|      list of weak references to the object (if defined)\n|\n|  ----------------------------------------------------------------------\n|  Methods inherited from builtins.Exception:\n|\n|  init(self, /, *args, kwargs)\n|      Initialize self.  See help(type(self)) for accurate signature.\n|\n|  ----------------------------------------------------------------------\n|  Static methods inherited from builtins.Exception:\n|\n|  new(*args, kwargs) from builtins.type\n|      Create and return a new object.  See help(type) for accurate signature.\n|\n|  ----------------------------------------------------------------------\n|  Methods inherited from builtins.BaseException:\n|\n|  delattr(self, name, /)\n|      Implement delattr(self, name).\n|\n|  getattribute(self, name, /)\n|      Return getattr(self, name).\n|\n|  reduce(...)\n|      Helper for pickle.\n|\n|  repr(self, /)\n|      Return repr(self).\n|\n|  setattr(self, name, value, /)\n|      Implement setattr(self, name, value).\n|\n|  setstate(...)\n|\n|  str(self, /)\n|      Return str(self).\n|\n|  withtraceback(...)\n|      Exception.withtraceback(tb) --\n|      set self.traceback to tb and return self.\n|\n|  ----------------------------------------------------------------------\n|  Data descriptors inherited from builtins.BaseException:\n|\n|  cause\n|      exception cause\n|\n|  context\n|      exception context\n|\n|  dict\n|\n|  suppresscontext\n|\n|  traceback\n|\n|  args\n\n#### class NonExistentTimeError\n\n|  Exception raised when attempting to create a wallclock time that\n|  cannot exist.\n|\n|  At the start of a DST transition period, the wallclock time jumps forward.\n|  The instants jumped over never occur.\n|\n|  Method resolution order:\n|      NonExistentTimeError\n|      InvalidTimeError\n|      Error\n|      builtins.Exception\n|      builtins.BaseException\n|      builtins.object\n|\n|  Data descriptors inherited from Error:\n|\n|  weakref\n|      list of weak references to the object (if defined)\n|\n|  ----------------------------------------------------------------------\n|  Methods inherited from builtins.Exception:\n|\n|  init(self, /, *args, kwargs)\n|      Initialize self.  See help(type(self)) for accurate signature.\n|\n|  ----------------------------------------------------------------------\n|  Static methods inherited from builtins.Exception:\n|\n|  new(*args, kwargs) from builtins.type\n|      Create and return a new object.  See help(type) for accurate signature.\n|\n|  ----------------------------------------------------------------------\n|  Methods inherited from builtins.BaseException:\n|\n|  delattr(self, name, /)\n|      Implement delattr(self, name).\n|\n|  getattribute(self, name, /)\n|      Return getattr(self, name).\n|\n|  reduce(...)\n|      Helper for pickle.\n|\n|  repr(self, /)\n|      Return repr(self).\n|\n|  setattr(self, name, value, /)\n|      Implement setattr(self, name, value).\n|\n|  setstate(...)\n|\n|  str(self, /)\n|      Return str(self).\n|\n|  withtraceback(...)\n|      Exception.withtraceback(tb) --\n|      set self.traceback to tb and return self.\n|\n|  ----------------------------------------------------------------------\n|  Data descriptors inherited from builtins.BaseException:\n|\n|  cause\n|      exception cause\n|\n|  context\n|      exception context\n|\n|  dict\n|\n|  suppresscontext\n|\n|  traceback\n|\n|  args\n\n#### class UnknownTimeZoneError\n\n|  Exception raised when pytz is passed an unknown timezone.\n|\n|  >>> isinstance(UnknownTimeZoneError(), LookupError)\n|  True\n|\n|  This class is actually a subclass of KeyError to provide backwards\n|  compatibility with code relying on the undocumented behavior of earlier\n|  pytz releases.\n|\n|  >>> isinstance(UnknownTimeZoneError(), KeyError)\n|  True\n|\n|  And also a subclass of pytz.exceptions.Error, as are other pytz\n|  exceptions.\n|\n|  >>> isinstance(UnknownTimeZoneError(), Error)\n|  True\n|\n|  Method resolution order:\n|      UnknownTimeZoneError\n|      builtins.KeyError\n|      builtins.LookupError\n|      Error\n|      builtins.Exception\n|      builtins.BaseException\n|      builtins.object\n|\n|  Data descriptors defined here:\n|\n|  weakref\n|      list of weak references to the object (if defined)\n|\n|  ----------------------------------------------------------------------\n|  Methods inherited from builtins.KeyError:\n|\n|  init(self, /, *args, kwargs)\n|      Initialize self.  See help(type(self)) for accurate signature.\n|\n|  str(self, /)\n|      Return str(self).\n|\n|  ----------------------------------------------------------------------\n|  Static methods inherited from builtins.LookupError:\n|\n|  new(*args, kwargs) from builtins.type\n|      Create and return a new object.  See help(type) for accurate signature.\n|\n|  ----------------------------------------------------------------------\n|  Methods inherited from builtins.BaseException:\n|\n|  delattr(self, name, /)\n|      Implement delattr(self, name).\n|\n|  getattribute(self, name, /)\n|      Return getattr(self, name).\n|\n|  reduce(...)\n|      Helper for pickle.\n|\n|  repr(self, /)\n|      Return repr(self).\n|\n|  setattr(self, name, value, /)\n|      Implement setattr(self, name, value).\n|\n|  setstate(...)\n|\n|  withtraceback(...)\n|      Exception.withtraceback(tb) --\n|      set self.traceback to tb and return self.\n|\n|  ----------------------------------------------------------------------\n|  Data descriptors inherited from builtins.BaseException:\n|\n|  cause\n|      exception cause\n|\n|  context\n|      exception context\n|\n|  dict\n|\n|  suppresscontext\n|\n|  traceback\n|\n|  args\n\n### FUNCTIONS\n\nFixedOffset(offset, tzinfos={})\nreturn a fixed-offset timezone based off a number of minutes.\n\n>>> one = FixedOffset(-330)\n>>> one\npytz.FixedOffset(-330)\n>>> str(one.utcoffset(datetime.datetime.now()))\n'-1 day, 18:30:00'\n>>> str(one.dst(datetime.datetime.now()))\n'0:00:00'\n\n>>> two = FixedOffset(1380)\n>>> two\npytz.FixedOffset(1380)\n>>> str(two.utcoffset(datetime.datetime.now()))\n'23:00:00'\n>>> str(two.dst(datetime.datetime.now()))\n'0:00:00'\n\nThe datetime.timedelta must be between the range of -1 and 1 day,\nnon-inclusive.\n\n>>> FixedOffset(1440)\nTraceback (most recent call last):\n...\nValueError: ('absolute offset is too large', 1440)\n\n>>> FixedOffset(-1440)\nTraceback (most recent call last):\n...\nValueError: ('absolute offset is too large', -1440)\n\nAn offset of 0 is special-cased to return UTC.\n\n>>> FixedOffset(0) is UTC\nTrue\n\nThere should always be only one instance of a FixedOffset per timedelta.\nThis should be true for multiple creation calls.\n\n>>> FixedOffset(-330) is one\nTrue\n>>> FixedOffset(1380) is two\nTrue\n\nIt should also be true for pickling.\n\n>>> import pickle\n>>> pickle.loads(pickle.dumps(one)) is one\nTrue\n>>> pickle.loads(pickle.dumps(two)) is two\nTrue\n\n#### timezone\n\nReturn a datetime.tzinfo implementation for the given timezone\n\n>>> from datetime import datetime, timedelta\n>>> utc = timezone('UTC')\n>>> eastern = timezone('US/Eastern')\n>>> eastern.zone\n'US/Eastern'\n>>> timezone(unicode('US/Eastern')) is eastern\nTrue\n>>> utcdt = datetime(2002, 10, 27, 6, 0, 0, tzinfo=utc)\n>>> locdt = utcdt.astimezone(eastern)\n>>> fmt = '%Y-%m-%d %H:%M:%S %Z (%z)'\n>>> locdt.strftime(fmt)\n'2002-10-27 01:00:00 EST (-0500)'\n>>> (locdt - timedelta(minutes=10)).strftime(fmt)\n'2002-10-27 00:50:00 EST (-0500)'\n>>> eastern.normalize(locdt - timedelta(minutes=10)).strftime(fmt)\n'2002-10-27 01:50:00 EDT (-0400)'\n>>> (locdt + timedelta(minutes=10)).strftime(fmt)\n'2002-10-27 01:10:00 EST (-0500)'\n\nRaises UnknownTimeZoneError if passed an unknown zone.\n\n>>> try:\n...     timezone('Asia/Shangri-La')\n... except UnknownTimeZoneError:\n...     print('Unknown')\nUnknown\n\n>>> try:\n...     timezone(unicode('\\N{TRADE MARK SIGN}'))\n... except UnknownTimeZoneError:\n...     print('Unknown')\nUnknown\n\n### DATA\n\nall = ['timezone', 'utc', 'countrytimezones', 'countrynames', 'A...\nalltimezones = ['Africa/Abidjan', 'Africa/Accra', 'Africa/AddisAbaba...\nalltimezonesset = {'Africa/Abidjan', 'Africa/Accra', 'Africa/AddisA...\ncommontimezones = ['Africa/Abidjan', 'Africa/Accra', 'Africa/AddisAb...\ncommontimezonesset = {'Africa/Abidjan', 'Africa/Accra', 'Africa/Addi...\ncountrynames = <pytz.CountryNameDict object>\ncountrytimezones = <pytz.CountryTimezoneDict object>\nutc = <UTC>\n\n### VERSION\n\n2022.1\n\n### FILE\n\n/usr/lib/python3/dist-packages/pytz/init.py\n\n"
        }
    ],
    "structuredContent": {
        "command": "pytz",
        "section": "",
        "mode": "pydoc",
        "summary": "pytz",
        "synopsis": null,
        "tldr_summary": null,
        "tldr_examples": [],
        "tldr_source": null,
        "flags": [],
        "examples": [],
        "see_also": [],
        "section_outline": [
            {
                "name": "NAME",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "DESCRIPTION",
                "lines": 8,
                "subsections": []
            },
            {
                "name": "PACKAGE CONTENTS",
                "lines": 6,
                "subsections": []
            },
            {
                "name": "CLASSES",
                "lines": 10,
                "subsections": [
                    {
                        "name": "class AmbiguousTimeError",
                        "lines": 77
                    },
                    {
                        "name": "class BaseTzInfo",
                        "lines": 51
                    },
                    {
                        "name": "class InvalidTimeError",
                        "lines": 70
                    },
                    {
                        "name": "class NonExistentTimeError",
                        "lines": 75
                    },
                    {
                        "name": "class UnknownTimeZoneError",
                        "lines": 88
                    }
                ]
            },
            {
                "name": "FUNCTIONS",
                "lines": 53,
                "subsections": [
                    {
                        "name": "timezone",
                        "lines": 35
                    }
                ]
            },
            {
                "name": "DATA",
                "lines": 9,
                "subsections": []
            },
            {
                "name": "VERSION",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "FILE",
                "lines": 3,
                "subsections": []
            }
        ]
    }
}