PKG-INFO 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198
  1. Metadata-Version: 1.1
  2. Name: tzlocal
  3. Version: 1.2.2
  4. Summary: tzinfo object for the local timezone
  5. Home-page: https://github.com/regebro/tzlocal
  6. Author: Lennart Regebro
  7. Author-email: regebro@gmail.com
  8. License: CC0 1.0 Universal
  9. Description: tzlocal
  10. =======
  11. This Python module returns a `tzinfo` object with the local timezone information under Unix and Win-32.
  12. It requires `pytz`, and returns `pytz` `tzinfo` objects.
  13. This module attempts to fix a glaring hole in `pytz`, that there is no way to
  14. get the local timezone information, unless you know the zoneinfo name, and
  15. under several Linux distros that's hard or impossible to figure out.
  16. Also, with Windows different timezone system using pytz isn't of much use
  17. unless you separately configure the zoneinfo timezone name.
  18. With `tzlocal` you only need to call `get_localzone()` and you will get a
  19. `tzinfo` object with the local time zone info. On some Unices you will still
  20. not get to know what the timezone name is, but you don't need that when you
  21. have the tzinfo file. However, if the timezone name is readily available it
  22. will be used.
  23. Supported systems
  24. -----------------
  25. These are the systems that are in theory supported:
  26. * Windows 2000 and later
  27. * Any unix-like system with a /etc/localtime or /usr/local/etc/localtime
  28. If you have one of the above systems and it does not work, it's a bug.
  29. Please report it.
  30. Usage
  31. -----
  32. Load the local timezone:
  33. >>> from tzlocal import get_localzone
  34. >>> tz = get_localzone()
  35. >>> tz
  36. <DstTzInfo 'Europe/Warsaw' WMT+1:24:00 STD>
  37. Create a local datetime:
  38. >>> from datetime import datetime
  39. >>> dt = tz.localize(datetime(2015, 4, 10, 7, 22))
  40. >>> dt
  41. datetime.datetime(2015, 4, 10, 7, 22, tzinfo=<DstTzInfo 'Europe/Warsaw' CEST+2:00:00 DST>)
  42. Lookup another timezone with `pytz`:
  43. >>> import pytz
  44. >>> eastern = pytz.timezone('US/Eastern')
  45. Convert the datetime:
  46. >>> dt.astimezone(eastern)
  47. datetime.datetime(2015, 4, 10, 1, 22, tzinfo=<DstTzInfo 'US/Eastern' EDT-1 day, 20:00:00 DST>)
  48. Maintainer
  49. ----------
  50. * Lennart Regebro, regebro@gmail.com
  51. Contributors
  52. ------------
  53. * Marc Van Olmen
  54. * Benjamen Meyer
  55. * Manuel Ebert
  56. * Xiaokun Zhu
  57. * Cameris
  58. * Edward Betts
  59. * McK KIM
  60. * Cris Ewing
  61. (Sorry if I forgot someone)
  62. License
  63. -------
  64. * CC0 1.0 Universal http://creativecommons.org/publicdomain/zero/1.0/
  65. Changes
  66. =======
  67. 1.2.2 (2016-03-02)
  68. ------------------
  69. - #30: Fixed a bug on OS X.
  70. 1.2.1 (2016-02-28)
  71. ------------------
  72. - Tests failed if TZ was set in the environment. (EdwardBetts)
  73. - Replaces os.popen() with subprocess.Popen() for OS X to
  74. handle when systemsetup doesn't exist. (mckabi, cewing)
  75. 1.2 (2015-06-14)
  76. ----------------
  77. - Systemd stores no time zone name, forcing us to look at the name of the file
  78. that localtime symlinks to. (cameris)
  79. 1.1.2 (2014-10-18)
  80. ------------------
  81. - Timezones that has 3 items did not work on Mac OS X.
  82. (Marc Van Olmen)
  83. - Now doesn't fail if the TZ environment variable isn't an Olsen time zone.
  84. - Some timezones on Windows can apparently be empty (perhaps the are deleted).
  85. Now these are ignored.
  86. (Xiaokun Zhu)
  87. 1.1.1 (2014-01-29)
  88. ------------------
  89. - I forgot to add Etc/UTC as an alias for Etc/GMT.
  90. 1.1 (2014-01-28)
  91. ----------------
  92. - Adding better support for OS X.
  93. - Added support to map from tzdata/Olsen names to Windows names.
  94. (Thanks to Benjamen Meyer).
  95. 1.0 (2013-05-29)
  96. ----------------
  97. - Fixed some more cases where spaces needs replacing with underscores.
  98. - Better handling of misconfigured /etc/timezone.
  99. - Better error message on Windows if we can't find a timezone at all.
  100. 0.3 (2012-09-13)
  101. ----------------
  102. - Windows 7 support.
  103. - Python 2.5 supported; because it only needed a __future__ import.
  104. - Python 3.3 tested, it worked.
  105. - Got rid of relative imports, because I don't actually like them,
  106. so I don't know why I used them in the first place.
  107. - For each Windows zone, use the default zoneinfo zone, not the last one.
  108. 0.2 (2012-09-12)
  109. ----------------
  110. - Python 3 support.
  111. 0.1 (2012-09-11)
  112. ----------------
  113. - Initial release.
  114. Keywords: timezone pytz
  115. Platform: UNKNOWN
  116. Classifier: Development Status :: 4 - Beta
  117. Classifier: License :: CC0 1.0 Universal (CC0 1.0) Public Domain Dedication
  118. Classifier: Operating System :: Microsoft :: Windows
  119. Classifier: Operating System :: Unix
  120. Classifier: Operating System :: MacOS :: MacOS X
  121. Classifier: Programming Language :: Python :: 2.5
  122. Classifier: Programming Language :: Python :: 2.6
  123. Classifier: Programming Language :: Python :: 2.7
  124. Classifier: Programming Language :: Python :: 3.1
  125. Classifier: Programming Language :: Python :: 3.2
  126. Classifier: Programming Language :: Python :: 3.3
  127. Classifier: Programming Language :: Python :: 3.4
  128. Classifier: Programming Language :: Python :: 3.5