matplotlib-rs 0.0.8__cp313-cp313-win_amd64.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (352) hide show
  1. docs/releases/0.0.1.md +268 -0
  2. docs/releases/0.0.2.md +69 -0
  3. docs/releases/0.0.3.md +80 -0
  4. docs/releases/0.0.4.md +73 -0
  5. docs/releases/0.0.5.md +24 -0
  6. docs/releases/0.0.6.md +24 -0
  7. docs/releases/0.0.7.md +24 -0
  8. docs/releases/0.0.8.md +16 -0
  9. licenses/LICENSE_CONTOURPY +29 -0
  10. licenses/LICENSE_CYCLER +27 -0
  11. licenses/LICENSE_DATEUTIL +54 -0
  12. licenses/LICENSE_KIWISOLVER +71 -0
  13. licenses/LICENSE_LIBWEBP +56 -0
  14. licenses/LICENSE_MATPLOTLIB +1253 -0
  15. licenses/LICENSE_PYPARSING +20 -0
  16. licenses/LICENSE_QHULL +39 -0
  17. licenses/LICENSE_SIX +18 -0
  18. matplotlib_rs/__init__.py +1683 -0
  19. matplotlib_rs/__main__.py +27 -0
  20. matplotlib_rs/_afm.py +500 -0
  21. matplotlib_rs/_animation_data.py +263 -0
  22. matplotlib_rs/_api/__init__.py +495 -0
  23. matplotlib_rs/_api/deprecation.py +534 -0
  24. matplotlib_rs/_axis_py.py +2991 -0
  25. matplotlib_rs/_blocking_input.py +31 -0
  26. matplotlib_rs/_cm.py +1500 -0
  27. matplotlib_rs/_cm_bivar.py +1289 -0
  28. matplotlib_rs/_cm_listed.py +2848 -0
  29. matplotlib_rs/_cm_multivar.py +167 -0
  30. matplotlib_rs/_color_data.py +1142 -0
  31. matplotlib_rs/_colormap.py +132 -0
  32. matplotlib_rs/_constrained_layout.py +825 -0
  33. matplotlib_rs/_contour.py +108 -0
  34. matplotlib_rs/_doc_cache.py +12214 -0
  35. matplotlib_rs/_docstring.py +142 -0
  36. matplotlib_rs/_enums.py +178 -0
  37. matplotlib_rs/_figure_rs.py +294 -0
  38. matplotlib_rs/_fontconfig_pattern.py +129 -0
  39. matplotlib_rs/_foreign.py +220 -0
  40. matplotlib_rs/_hook.py +94 -0
  41. matplotlib_rs/_image.py +160 -0
  42. matplotlib_rs/_imageio.py +229 -0
  43. matplotlib_rs/_internal_utils.py +65 -0
  44. matplotlib_rs/_kiwi.py +484 -0
  45. matplotlib_rs/_layoutgrid.py +549 -0
  46. matplotlib_rs/_live.py +192 -0
  47. matplotlib_rs/_mathtext.py +3103 -0
  48. matplotlib_rs/_mathtext_data.py +1811 -0
  49. matplotlib_rs/_mplrs.cp313-win_amd64.pyd +0 -0
  50. matplotlib_rs/_path.py +25 -0
  51. matplotlib_rs/_png.py +162 -0
  52. matplotlib_rs/_pylab_helpers.py +137 -0
  53. matplotlib_rs/_qhull.py +66 -0
  54. matplotlib_rs/_rcpush.py +84 -0
  55. matplotlib_rs/_spines_rs.py +108 -0
  56. matplotlib_rs/_style_helpers.py +52 -0
  57. matplotlib_rs/_text_helpers.py +51 -0
  58. matplotlib_rs/_tight_bbox.py +85 -0
  59. matplotlib_rs/_tight_layout.py +302 -0
  60. matplotlib_rs/_tri.py +140 -0
  61. matplotlib_rs/_type1font.py +1228 -0
  62. matplotlib_rs/_vendor/__init__.py +8 -0
  63. matplotlib_rs/_vendor/cycler.py +574 -0
  64. matplotlib_rs/_vendor/dateutil/__init__.py +27 -0
  65. matplotlib_rs/_vendor/dateutil/_common.py +44 -0
  66. matplotlib_rs/_vendor/dateutil/_tzdata_impl.py +148 -0
  67. matplotlib_rs/_vendor/dateutil/_version.py +5 -0
  68. matplotlib_rs/_vendor/dateutil/easter.py +90 -0
  69. matplotlib_rs/_vendor/dateutil/parser/__init__.py +62 -0
  70. matplotlib_rs/_vendor/dateutil/parser/_parser.py +1614 -0
  71. matplotlib_rs/_vendor/dateutil/parser/isoparser.py +417 -0
  72. matplotlib_rs/_vendor/dateutil/relativedelta.py +597 -0
  73. matplotlib_rs/_vendor/dateutil/rrule.py +1765 -0
  74. matplotlib_rs/_vendor/dateutil/tz/__init__.py +61 -0
  75. matplotlib_rs/_vendor/dateutil/tz/_common.py +420 -0
  76. matplotlib_rs/_vendor/dateutil/tz/_factories.py +81 -0
  77. matplotlib_rs/_vendor/dateutil/tz/_tzfile.py +1429 -0
  78. matplotlib_rs/_vendor/dateutil/tz/_tzpath.py +105 -0
  79. matplotlib_rs/_vendor/dateutil/tz/tz.py +1473 -0
  80. matplotlib_rs/_vendor/dateutil/tz/win.py +371 -0
  81. matplotlib_rs/_vendor/dateutil/tzwin.py +3 -0
  82. matplotlib_rs/_vendor/dateutil/utils.py +72 -0
  83. matplotlib_rs/_vendor/dateutil/zoneinfo/__init__.py +234 -0
  84. matplotlib_rs/_vendor/pyparsing/__init__.py +414 -0
  85. matplotlib_rs/_vendor/pyparsing/actions.py +265 -0
  86. matplotlib_rs/_vendor/pyparsing/common.py +571 -0
  87. matplotlib_rs/_vendor/pyparsing/core.py +6973 -0
  88. matplotlib_rs/_vendor/pyparsing/exceptions.py +354 -0
  89. matplotlib_rs/_vendor/pyparsing/helpers.py +1770 -0
  90. matplotlib_rs/_vendor/pyparsing/results.py +929 -0
  91. matplotlib_rs/_vendor/pyparsing/testing.py +399 -0
  92. matplotlib_rs/_vendor/pyparsing/unicode.py +357 -0
  93. matplotlib_rs/_vendor/pyparsing/util.py +515 -0
  94. matplotlib_rs/_vendor/pyparsing/warnings.py +11 -0
  95. matplotlib_rs/_vendor/six.py +1004 -0
  96. matplotlib_rs/animation.py +1843 -0
  97. matplotlib_rs/artist.py +2302 -0
  98. matplotlib_rs/axes/__init__.py +19 -0
  99. matplotlib_rs/axes/_axes.py +9402 -0
  100. matplotlib_rs/axes/_bar.py +185 -0
  101. matplotlib_rs/axes/_base.py +5236 -0
  102. matplotlib_rs/axes/_base_rs.py +727 -0
  103. matplotlib_rs/axes/_boxplot.py +391 -0
  104. matplotlib_rs/axes/_hist.py +99 -0
  105. matplotlib_rs/axes/_secondary_axes.py +357 -0
  106. matplotlib_rs/axis.py +1963 -0
  107. matplotlib_rs/backend_bases.py +3760 -0
  108. matplotlib_rs/backend_managers.py +388 -0
  109. matplotlib_rs/backend_tools.py +1002 -0
  110. matplotlib_rs/backends/__init__.py +6 -0
  111. matplotlib_rs/backends/_backend_pdf_ps.py +451 -0
  112. matplotlib_rs/backends/backend_agg.py +552 -0
  113. matplotlib_rs/backends/backend_mixed.py +123 -0
  114. matplotlib_rs/backends/backend_pdf.py +2711 -0
  115. matplotlib_rs/backends/backend_pgf.py +1031 -0
  116. matplotlib_rs/backends/backend_ps.py +1491 -0
  117. matplotlib_rs/backends/backend_svg.py +1395 -0
  118. matplotlib_rs/backends/backend_template.py +214 -0
  119. matplotlib_rs/backends/registry.py +423 -0
  120. matplotlib_rs/bezier.py +691 -0
  121. matplotlib_rs/category.py +236 -0
  122. matplotlib_rs/cbook.py +2762 -0
  123. matplotlib_rs/cm.py +251 -0
  124. matplotlib_rs/collections.py +2711 -0
  125. matplotlib_rs/colorbar.py +1586 -0
  126. matplotlib_rs/colorizer.py +909 -0
  127. matplotlib_rs/colors.py +4278 -0
  128. matplotlib_rs/container.py +256 -0
  129. matplotlib_rs/contour.py +1756 -0
  130. matplotlib_rs/dates.py +1847 -0
  131. matplotlib_rs/dviread.py +1386 -0
  132. matplotlib_rs/figure.py +3815 -0
  133. matplotlib_rs/font_manager.py +1855 -0
  134. matplotlib_rs/ft2font.py +515 -0
  135. matplotlib_rs/gridspec.py +808 -0
  136. matplotlib_rs/hatch.py +244 -0
  137. matplotlib_rs/image.py +1863 -0
  138. matplotlib_rs/inset.py +291 -0
  139. matplotlib_rs/layout_engine.py +310 -0
  140. matplotlib_rs/legend.py +1480 -0
  141. matplotlib_rs/legend_handler.py +812 -0
  142. matplotlib_rs/lines.py +1886 -0
  143. matplotlib_rs/markers.py +908 -0
  144. matplotlib_rs/mathtext.py +141 -0
  145. matplotlib_rs/mlab.py +959 -0
  146. matplotlib_rs/mpl-data/fonts/ttf/DejaVuSans-Bold.ttf +0 -0
  147. matplotlib_rs/mpl-data/fonts/ttf/DejaVuSans-BoldOblique.ttf +0 -0
  148. matplotlib_rs/mpl-data/fonts/ttf/DejaVuSans-Oblique.ttf +0 -0
  149. matplotlib_rs/mpl-data/fonts/ttf/DejaVuSans.ttf +0 -0
  150. matplotlib_rs/mpl-data/fonts/ttf/DejaVuSansDisplay.ttf +0 -0
  151. matplotlib_rs/mpl-data/fonts/ttf/DejaVuSansMono-Bold.ttf +0 -0
  152. matplotlib_rs/mpl-data/fonts/ttf/DejaVuSansMono-BoldOblique.ttf +0 -0
  153. matplotlib_rs/mpl-data/fonts/ttf/DejaVuSansMono-Oblique.ttf +0 -0
  154. matplotlib_rs/mpl-data/fonts/ttf/DejaVuSansMono.ttf +0 -0
  155. matplotlib_rs/mpl-data/fonts/ttf/DejaVuSerif-Bold.ttf +0 -0
  156. matplotlib_rs/mpl-data/fonts/ttf/DejaVuSerif-BoldItalic.ttf +0 -0
  157. matplotlib_rs/mpl-data/fonts/ttf/DejaVuSerif-Italic.ttf +0 -0
  158. matplotlib_rs/mpl-data/fonts/ttf/DejaVuSerif.ttf +0 -0
  159. matplotlib_rs/mpl-data/fonts/ttf/DejaVuSerifDisplay.ttf +0 -0
  160. matplotlib_rs/mpl-data/fonts/ttf/LICENSE_DEJAVU +99 -0
  161. matplotlib_rs/mpl-data/fonts/ttf/LICENSE_STIX +124 -0
  162. matplotlib_rs/mpl-data/fonts/ttf/LastResortHE-Regular.ttf +0 -0
  163. matplotlib_rs/mpl-data/fonts/ttf/STIXGeneral.ttf +0 -0
  164. matplotlib_rs/mpl-data/fonts/ttf/STIXGeneralBol.ttf +0 -0
  165. matplotlib_rs/mpl-data/fonts/ttf/STIXGeneralBolIta.ttf +0 -0
  166. matplotlib_rs/mpl-data/fonts/ttf/STIXGeneralItalic.ttf +0 -0
  167. matplotlib_rs/mpl-data/fonts/ttf/STIXNonUni.ttf +0 -0
  168. matplotlib_rs/mpl-data/fonts/ttf/STIXNonUniBol.ttf +0 -0
  169. matplotlib_rs/mpl-data/fonts/ttf/STIXNonUniBolIta.ttf +0 -0
  170. matplotlib_rs/mpl-data/fonts/ttf/STIXNonUniIta.ttf +0 -0
  171. matplotlib_rs/mpl-data/fonts/ttf/STIXSizFiveSymReg.ttf +0 -0
  172. matplotlib_rs/mpl-data/fonts/ttf/STIXSizFourSymBol.ttf +0 -0
  173. matplotlib_rs/mpl-data/fonts/ttf/STIXSizFourSymReg.ttf +0 -0
  174. matplotlib_rs/mpl-data/fonts/ttf/STIXSizOneSymBol.ttf +0 -0
  175. matplotlib_rs/mpl-data/fonts/ttf/STIXSizOneSymReg.ttf +0 -0
  176. matplotlib_rs/mpl-data/fonts/ttf/STIXSizThreeSymBol.ttf +0 -0
  177. matplotlib_rs/mpl-data/fonts/ttf/STIXSizThreeSymReg.ttf +0 -0
  178. matplotlib_rs/mpl-data/fonts/ttf/STIXSizTwoSymBol.ttf +0 -0
  179. matplotlib_rs/mpl-data/fonts/ttf/STIXSizTwoSymReg.ttf +0 -0
  180. matplotlib_rs/mpl-data/fonts/ttf/cmb10.ttf +0 -0
  181. matplotlib_rs/mpl-data/fonts/ttf/cmex10.ttf +0 -0
  182. matplotlib_rs/mpl-data/fonts/ttf/cmmi10.ttf +0 -0
  183. matplotlib_rs/mpl-data/fonts/ttf/cmr10.ttf +0 -0
  184. matplotlib_rs/mpl-data/fonts/ttf/cmss10.ttf +0 -0
  185. matplotlib_rs/mpl-data/fonts/ttf/cmsy10.ttf +0 -0
  186. matplotlib_rs/mpl-data/fonts/ttf/cmti10.ttf +0 -0
  187. matplotlib_rs/mpl-data/fonts/ttf/cmtt10.ttf +0 -0
  188. matplotlib_rs/mpl-data/images/back-symbolic.svg +46 -0
  189. matplotlib_rs/mpl-data/images/back.pdf +0 -0
  190. matplotlib_rs/mpl-data/images/back.png +0 -0
  191. matplotlib_rs/mpl-data/images/back.svg +46 -0
  192. matplotlib_rs/mpl-data/images/back_large.png +0 -0
  193. matplotlib_rs/mpl-data/images/filesave-symbolic.svg +68 -0
  194. matplotlib_rs/mpl-data/images/filesave.pdf +72 -0
  195. matplotlib_rs/mpl-data/images/filesave.png +0 -0
  196. matplotlib_rs/mpl-data/images/filesave.svg +68 -0
  197. matplotlib_rs/mpl-data/images/filesave_large.png +0 -0
  198. matplotlib_rs/mpl-data/images/forward-symbolic.svg +46 -0
  199. matplotlib_rs/mpl-data/images/forward.pdf +0 -0
  200. matplotlib_rs/mpl-data/images/forward.png +0 -0
  201. matplotlib_rs/mpl-data/images/forward.svg +46 -0
  202. matplotlib_rs/mpl-data/images/forward_large.png +0 -0
  203. matplotlib_rs/mpl-data/images/hand.pdf +0 -0
  204. matplotlib_rs/mpl-data/images/hand.png +0 -0
  205. matplotlib_rs/mpl-data/images/hand.svg +130 -0
  206. matplotlib_rs/mpl-data/images/help-symbolic.svg +52 -0
  207. matplotlib_rs/mpl-data/images/help.pdf +71 -0
  208. matplotlib_rs/mpl-data/images/help.png +0 -0
  209. matplotlib_rs/mpl-data/images/help.svg +52 -0
  210. matplotlib_rs/mpl-data/images/help_large.png +0 -0
  211. matplotlib_rs/mpl-data/images/home-symbolic.svg +59 -0
  212. matplotlib_rs/mpl-data/images/home.pdf +0 -0
  213. matplotlib_rs/mpl-data/images/home.png +0 -0
  214. matplotlib_rs/mpl-data/images/home.svg +59 -0
  215. matplotlib_rs/mpl-data/images/home_large.png +0 -0
  216. matplotlib_rs/mpl-data/images/matplotlib.pdf +0 -0
  217. matplotlib_rs/mpl-data/images/matplotlib.png +0 -0
  218. matplotlib_rs/mpl-data/images/matplotlib.svg +3171 -0
  219. matplotlib_rs/mpl-data/images/matplotlib_large.png +0 -0
  220. matplotlib_rs/mpl-data/images/move-symbolic.svg +73 -0
  221. matplotlib_rs/mpl-data/images/move.pdf +0 -0
  222. matplotlib_rs/mpl-data/images/move.png +0 -0
  223. matplotlib_rs/mpl-data/images/move.svg +73 -0
  224. matplotlib_rs/mpl-data/images/move_large.png +0 -0
  225. matplotlib_rs/mpl-data/images/qt4_editor_options.pdf +0 -0
  226. matplotlib_rs/mpl-data/images/qt4_editor_options.png +0 -0
  227. matplotlib_rs/mpl-data/images/qt4_editor_options.svg +48 -0
  228. matplotlib_rs/mpl-data/images/qt4_editor_options_large.png +0 -0
  229. matplotlib_rs/mpl-data/images/subplots-symbolic.svg +81 -0
  230. matplotlib_rs/mpl-data/images/subplots.pdf +0 -0
  231. matplotlib_rs/mpl-data/images/subplots.png +0 -0
  232. matplotlib_rs/mpl-data/images/subplots.svg +81 -0
  233. matplotlib_rs/mpl-data/images/subplots_large.png +0 -0
  234. matplotlib_rs/mpl-data/images/zoom_to_rect-symbolic.svg +40 -0
  235. matplotlib_rs/mpl-data/images/zoom_to_rect.pdf +69 -0
  236. matplotlib_rs/mpl-data/images/zoom_to_rect.png +0 -0
  237. matplotlib_rs/mpl-data/images/zoom_to_rect.svg +40 -0
  238. matplotlib_rs/mpl-data/images/zoom_to_rect_large.png +0 -0
  239. matplotlib_rs/mpl-data/kpsewhich.lua +4 -0
  240. matplotlib_rs/mpl-data/matplotlibrc +849 -0
  241. matplotlib_rs/mpl-data/plot_directive/plot_directive.css +16 -0
  242. matplotlib_rs/mpl-data/sample_data/Minduka_Present_Blue_Pack.png +0 -0
  243. matplotlib_rs/mpl-data/sample_data/README.txt +2 -0
  244. matplotlib_rs/mpl-data/sample_data/Stocks.csv +526 -0
  245. matplotlib_rs/mpl-data/sample_data/axes_grid/bivariate_normal.npy +0 -0
  246. matplotlib_rs/mpl-data/sample_data/data_x_x2_x3.csv +11 -0
  247. matplotlib_rs/mpl-data/sample_data/eeg.dat +0 -0
  248. matplotlib_rs/mpl-data/sample_data/embedding_in_wx3.xrc +65 -0
  249. matplotlib_rs/mpl-data/sample_data/goog.npz +0 -0
  250. matplotlib_rs/mpl-data/sample_data/grace_hopper.jpg +0 -0
  251. matplotlib_rs/mpl-data/sample_data/jacksboro_fault_dem.npz +0 -0
  252. matplotlib_rs/mpl-data/sample_data/logo2.png +0 -0
  253. matplotlib_rs/mpl-data/sample_data/membrane.dat +0 -0
  254. matplotlib_rs/mpl-data/sample_data/msft.csv +66 -0
  255. matplotlib_rs/mpl-data/sample_data/s1045.ima.gz +0 -0
  256. matplotlib_rs/mpl-data/sample_data/topobathy.npz +0 -0
  257. matplotlib_rs/mpl-data/stylelib/Solarize_Light2.mplstyle +53 -0
  258. matplotlib_rs/mpl-data/stylelib/_classic_test_patch.mplstyle +8 -0
  259. matplotlib_rs/mpl-data/stylelib/_mpl-gallery-nogrid.mplstyle +19 -0
  260. matplotlib_rs/mpl-data/stylelib/_mpl-gallery.mplstyle +19 -0
  261. matplotlib_rs/mpl-data/stylelib/bmh.mplstyle +27 -0
  262. matplotlib_rs/mpl-data/stylelib/classic.mplstyle +491 -0
  263. matplotlib_rs/mpl-data/stylelib/dark_background.mplstyle +26 -0
  264. matplotlib_rs/mpl-data/stylelib/fast.mplstyle +11 -0
  265. matplotlib_rs/mpl-data/stylelib/fivethirtyeight.mplstyle +37 -0
  266. matplotlib_rs/mpl-data/stylelib/ggplot.mplstyle +39 -0
  267. matplotlib_rs/mpl-data/stylelib/grayscale.mplstyle +29 -0
  268. matplotlib_rs/mpl-data/stylelib/petroff10.mplstyle +5 -0
  269. matplotlib_rs/mpl-data/stylelib/petroff6.mplstyle +5 -0
  270. matplotlib_rs/mpl-data/stylelib/petroff8.mplstyle +5 -0
  271. matplotlib_rs/mpl-data/stylelib/seaborn-v0_8-bright.mplstyle +3 -0
  272. matplotlib_rs/mpl-data/stylelib/seaborn-v0_8-colorblind.mplstyle +3 -0
  273. matplotlib_rs/mpl-data/stylelib/seaborn-v0_8-dark-palette.mplstyle +3 -0
  274. matplotlib_rs/mpl-data/stylelib/seaborn-v0_8-dark.mplstyle +30 -0
  275. matplotlib_rs/mpl-data/stylelib/seaborn-v0_8-darkgrid.mplstyle +30 -0
  276. matplotlib_rs/mpl-data/stylelib/seaborn-v0_8-deep.mplstyle +3 -0
  277. matplotlib_rs/mpl-data/stylelib/seaborn-v0_8-muted.mplstyle +3 -0
  278. matplotlib_rs/mpl-data/stylelib/seaborn-v0_8-notebook.mplstyle +21 -0
  279. matplotlib_rs/mpl-data/stylelib/seaborn-v0_8-paper.mplstyle +21 -0
  280. matplotlib_rs/mpl-data/stylelib/seaborn-v0_8-pastel.mplstyle +3 -0
  281. matplotlib_rs/mpl-data/stylelib/seaborn-v0_8-poster.mplstyle +21 -0
  282. matplotlib_rs/mpl-data/stylelib/seaborn-v0_8-talk.mplstyle +21 -0
  283. matplotlib_rs/mpl-data/stylelib/seaborn-v0_8-ticks.mplstyle +30 -0
  284. matplotlib_rs/mpl-data/stylelib/seaborn-v0_8-white.mplstyle +30 -0
  285. matplotlib_rs/mpl-data/stylelib/seaborn-v0_8-whitegrid.mplstyle +30 -0
  286. matplotlib_rs/mpl-data/stylelib/seaborn-v0_8.mplstyle +57 -0
  287. matplotlib_rs/mpl-data/stylelib/tableau-colorblind10.mplstyle +3 -0
  288. matplotlib_rs/mpl_toolkits/__init__.py +3 -0
  289. matplotlib_rs/mpl_toolkits/axes_grid1/__init__.py +11 -0
  290. matplotlib_rs/mpl_toolkits/axes_grid1/anchored_artists.py +415 -0
  291. matplotlib_rs/mpl_toolkits/axes_grid1/axes_divider.py +619 -0
  292. matplotlib_rs/mpl_toolkits/axes_grid1/axes_grid.py +565 -0
  293. matplotlib_rs/mpl_toolkits/axes_grid1/axes_rgb.py +158 -0
  294. matplotlib_rs/mpl_toolkits/axes_grid1/axes_size.py +272 -0
  295. matplotlib_rs/mpl_toolkits/axes_grid1/inset_locator.py +525 -0
  296. matplotlib_rs/mpl_toolkits/axes_grid1/mpl_axes.py +129 -0
  297. matplotlib_rs/mpl_toolkits/axes_grid1/parasite_axes.py +261 -0
  298. matplotlib_rs/mpl_toolkits/axisartist/__init__.py +15 -0
  299. matplotlib_rs/mpl_toolkits/axisartist/angle_helper.py +396 -0
  300. matplotlib_rs/mpl_toolkits/axisartist/axes_divider.py +3 -0
  301. matplotlib_rs/mpl_toolkits/axisartist/axis_artist.py +1148 -0
  302. matplotlib_rs/mpl_toolkits/axisartist/axisline_style.py +193 -0
  303. matplotlib_rs/mpl_toolkits/axisartist/axislines.py +475 -0
  304. matplotlib_rs/mpl_toolkits/axisartist/floating_axes.py +265 -0
  305. matplotlib_rs/mpl_toolkits/axisartist/grid_finder.py +329 -0
  306. matplotlib_rs/mpl_toolkits/axisartist/grid_helper_curvelinear.py +353 -0
  307. matplotlib_rs/mpl_toolkits/axisartist/parasite_axes.py +8 -0
  308. matplotlib_rs/mpl_toolkits/mplot3d/__init__.py +4 -0
  309. matplotlib_rs/mpl_toolkits/mplot3d/art3d.py +1758 -0
  310. matplotlib_rs/mpl_toolkits/mplot3d/axes3d.py +4462 -0
  311. matplotlib_rs/mpl_toolkits/mplot3d/axis3d.py +807 -0
  312. matplotlib_rs/mpl_toolkits/mplot3d/proj3d.py +270 -0
  313. matplotlib_rs/offsetbox.py +1726 -0
  314. matplotlib_rs/patches.py +5049 -0
  315. matplotlib_rs/path.py +1147 -0
  316. matplotlib_rs/patheffects.py +512 -0
  317. matplotlib_rs/projections/__init__.py +126 -0
  318. matplotlib_rs/projections/geo.py +512 -0
  319. matplotlib_rs/projections/polar.py +1518 -0
  320. matplotlib_rs/pylab.py +68 -0
  321. matplotlib_rs/pyplot.py +4834 -0
  322. matplotlib_rs/quiver.py +1236 -0
  323. matplotlib_rs/rcsetup.py +3435 -0
  324. matplotlib_rs/sankey.py +815 -0
  325. matplotlib_rs/scale.py +1002 -0
  326. matplotlib_rs/spines.py +618 -0
  327. matplotlib_rs/stackplot.py +144 -0
  328. matplotlib_rs/streamplot.py +768 -0
  329. matplotlib_rs/style/__init__.py +269 -0
  330. matplotlib_rs/style/core.py +28 -0
  331. matplotlib_rs/table.py +860 -0
  332. matplotlib_rs/texmanager.py +375 -0
  333. matplotlib_rs/text.py +2412 -0
  334. matplotlib_rs/textpath.py +377 -0
  335. matplotlib_rs/ticker.py +3111 -0
  336. matplotlib_rs/transforms.py +3069 -0
  337. matplotlib_rs/tri/__init__.py +24 -0
  338. matplotlib_rs/tri/_triangulation.py +248 -0
  339. matplotlib_rs/tri/_tricontour.py +271 -0
  340. matplotlib_rs/tri/_trifinder.py +97 -0
  341. matplotlib_rs/tri/_triinterpolate.py +1575 -0
  342. matplotlib_rs/tri/_tripcolor.py +170 -0
  343. matplotlib_rs/tri/_triplot.py +87 -0
  344. matplotlib_rs/tri/_trirefine.py +308 -0
  345. matplotlib_rs/tri/_tritools.py +264 -0
  346. matplotlib_rs/typing.py +597 -0
  347. matplotlib_rs/units.py +196 -0
  348. matplotlib_rs/widgets.py +4455 -0
  349. matplotlib_rs-0.0.8.dist-info/METADATA +392 -0
  350. matplotlib_rs-0.0.8.dist-info/RECORD +352 -0
  351. matplotlib_rs-0.0.8.dist-info/WHEEL +4 -0
  352. matplotlib_rs-0.0.8.dist-info/sboms/matplotlib-rs.cyclonedx.json +4390 -0
@@ -0,0 +1,371 @@
1
+ # Vendored by tools/vendor_deps.py from python-dateutil 3.0.0 (see licenses/LICENSE_DATEUTIL).
2
+ # -*- coding: utf-8 -*-
3
+ """
4
+ This module provides an interface to the native time zone data on Windows,
5
+ including :py:class:`datetime.tzinfo` implementations.
6
+
7
+ Attempting to import this module on a non-Windows platform will raise an
8
+ :py:obj:`ImportError`.
9
+ """
10
+ # This code was originally contributed by Jeffrey Harris.
11
+ import datetime
12
+ import struct
13
+
14
+ from matplotlib_rs._vendor.six.moves import winreg
15
+ from matplotlib_rs._vendor.six import text_type
16
+
17
+ try:
18
+ import ctypes
19
+ from ctypes import wintypes
20
+ except ValueError:
21
+ # ValueError is raised on non-Windows systems for some horrible reason.
22
+ raise ImportError("Running tzwin on non-Windows system")
23
+
24
+ from ._common import tzrangebase
25
+
26
+ __all__ = ["tzwin", "tzwinlocal", "tzres"]
27
+
28
+ ONEWEEK = datetime.timedelta(7)
29
+
30
+ TZKEYNAMENT = r"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones"
31
+ TZKEYNAME9X = r"SOFTWARE\Microsoft\Windows\CurrentVersion\Time Zones"
32
+ TZLOCALKEYNAME = r"SYSTEM\CurrentControlSet\Control\TimeZoneInformation"
33
+
34
+
35
+ def _settzkeyname():
36
+ handle = winreg.ConnectRegistry(None, winreg.HKEY_LOCAL_MACHINE)
37
+ try:
38
+ winreg.OpenKey(handle, TZKEYNAMENT).Close()
39
+ TZKEYNAME = TZKEYNAMENT
40
+ except WindowsError:
41
+ TZKEYNAME = TZKEYNAME9X
42
+ handle.Close()
43
+ return TZKEYNAME
44
+
45
+
46
+ TZKEYNAME = _settzkeyname()
47
+
48
+
49
+ class tzres(object):
50
+ """
51
+ Class for accessing ``tzres.dll``, which contains timezone name related
52
+ resources.
53
+
54
+ .. versionadded:: 2.5.0
55
+ """
56
+ p_wchar = ctypes.POINTER(wintypes.WCHAR) # Pointer to a wide char
57
+
58
+ def __init__(self, tzres_loc='tzres.dll'):
59
+ # Load the user32 DLL so we can load strings from tzres
60
+ user32 = ctypes.WinDLL('user32')
61
+
62
+ # Specify the LoadStringW function
63
+ user32.LoadStringW.argtypes = (wintypes.HINSTANCE,
64
+ wintypes.UINT,
65
+ wintypes.LPWSTR,
66
+ ctypes.c_int)
67
+
68
+ self.LoadStringW = user32.LoadStringW
69
+ self._tzres = ctypes.WinDLL(tzres_loc)
70
+ self.tzres_loc = tzres_loc
71
+
72
+ def load_name(self, offset):
73
+ """
74
+ Load a timezone name from a DLL offset (integer).
75
+
76
+ >>> from dateutil.tzwin import tzres
77
+ >>> tzr = tzres()
78
+ >>> print(tzr.load_name(112))
79
+ 'Eastern Standard Time'
80
+
81
+ :param offset:
82
+ A positive integer value referring to a string from the tzres dll.
83
+
84
+ .. note::
85
+
86
+ Offsets found in the registry are generally of the form
87
+ ``@tzres.dll,-114``. The offset in this case is 114, not -114.
88
+
89
+ """
90
+ resource = self.p_wchar()
91
+ lpBuffer = ctypes.cast(ctypes.byref(resource), wintypes.LPWSTR)
92
+ nchar = self.LoadStringW(self._tzres._handle, offset, lpBuffer, 0)
93
+ return resource[:nchar]
94
+
95
+ def name_from_string(self, tzname_str):
96
+ """
97
+ Parse strings as returned from the Windows registry into the time zone
98
+ name as defined in the registry.
99
+
100
+ >>> from dateutil.tzwin import tzres
101
+ >>> tzr = tzres()
102
+ >>> print(tzr.name_from_string('@tzres.dll,-251'))
103
+ 'Dateline Daylight Time'
104
+ >>> print(tzr.name_from_string('Eastern Standard Time'))
105
+ 'Eastern Standard Time'
106
+
107
+ :param tzname_str:
108
+ A timezone name string as returned from a Windows registry key.
109
+
110
+ :return:
111
+ Returns the localized timezone string from tzres.dll if the string
112
+ is of the form `@tzres.dll,-offset`, else returns the input string.
113
+ """
114
+ if not tzname_str.startswith('@'):
115
+ return tzname_str
116
+
117
+ name_splt = tzname_str.split(',-')
118
+ try:
119
+ offset = int(name_splt[1])
120
+ except:
121
+ raise ValueError("Malformed timezone string.")
122
+
123
+ return self.load_name(offset)
124
+
125
+
126
+ class tzwinbase(tzrangebase):
127
+ """tzinfo class based on win32's timezones available in the registry."""
128
+ def __init__(self):
129
+ raise NotImplementedError('tzwinbase is an abstract base class')
130
+
131
+ def __eq__(self, other):
132
+ # Compare on all relevant dimensions, including name.
133
+ if not isinstance(other, tzwinbase):
134
+ return NotImplemented
135
+
136
+ return (self._std_offset == other._std_offset and
137
+ self._dst_offset == other._dst_offset and
138
+ self._stddayofweek == other._stddayofweek and
139
+ self._dstdayofweek == other._dstdayofweek and
140
+ self._stdweeknumber == other._stdweeknumber and
141
+ self._dstweeknumber == other._dstweeknumber and
142
+ self._stdhour == other._stdhour and
143
+ self._dsthour == other._dsthour and
144
+ self._stdminute == other._stdminute and
145
+ self._dstminute == other._dstminute and
146
+ self._std_abbr == other._std_abbr and
147
+ self._dst_abbr == other._dst_abbr)
148
+
149
+ @staticmethod
150
+ def list():
151
+ """Return a list of all time zones known to the system."""
152
+ with winreg.ConnectRegistry(None, winreg.HKEY_LOCAL_MACHINE) as handle:
153
+ with winreg.OpenKey(handle, TZKEYNAME) as tzkey:
154
+ result = [winreg.EnumKey(tzkey, i)
155
+ for i in range(winreg.QueryInfoKey(tzkey)[0])]
156
+ return result
157
+
158
+ def display(self):
159
+ """
160
+ Return the display name of the time zone.
161
+ """
162
+ return self._display
163
+
164
+ def transitions(self, year):
165
+ """
166
+ For a given year, get the DST on and off transition times, expressed
167
+ always on the standard time side. For zones with no transitions, this
168
+ function returns ``None``.
169
+
170
+ :param year:
171
+ The year whose transitions you would like to query.
172
+
173
+ :return:
174
+ Returns a :class:`tuple` of :class:`datetime.datetime` objects,
175
+ ``(dston, dstoff)`` for zones with an annual DST transition, or
176
+ ``None`` for fixed offset zones.
177
+ """
178
+
179
+ if not self.hasdst:
180
+ return None
181
+
182
+ dston = picknthweekday(year, self._dstmonth, self._dstdayofweek,
183
+ self._dsthour, self._dstminute,
184
+ self._dstweeknumber)
185
+
186
+ dstoff = picknthweekday(year, self._stdmonth, self._stddayofweek,
187
+ self._stdhour, self._stdminute,
188
+ self._stdweeknumber)
189
+
190
+ # Ambiguous dates default to the STD side
191
+ dstoff -= self._dst_base_offset
192
+
193
+ return dston, dstoff
194
+
195
+ def _get_hasdst(self):
196
+ return self._dstmonth != 0
197
+
198
+ @property
199
+ def _dst_base_offset(self):
200
+ return self._dst_base_offset_
201
+
202
+
203
+ class tzwin(tzwinbase):
204
+ """
205
+ Time zone object created from the zone info in the Windows registry
206
+
207
+ These are similar to :py:class:`dateutil.tz.tzrange` objects in that
208
+ the time zone data is provided in the format of a single offset rule
209
+ for either 0 or 2 time zone transitions per year.
210
+
211
+ :param: name
212
+ The name of a Windows time zone key, e.g. "Eastern Standard Time".
213
+ The full list of keys can be retrieved with :func:`tzwin.list`.
214
+ """
215
+
216
+ def __init__(self, name):
217
+ self._name = name
218
+
219
+ with winreg.ConnectRegistry(None, winreg.HKEY_LOCAL_MACHINE) as handle:
220
+ tzkeyname = text_type("{kn}\\{name}").format(kn=TZKEYNAME, name=name)
221
+ with winreg.OpenKey(handle, tzkeyname) as tzkey:
222
+ keydict = valuestodict(tzkey)
223
+
224
+ self._std_abbr = keydict["Std"]
225
+ self._dst_abbr = keydict["Dlt"]
226
+
227
+ self._display = keydict["Display"]
228
+
229
+ # See http://ww_winreg.jsiinc.com/SUBA/tip0300/rh0398.htm
230
+ tup = struct.unpack("=3l16h", keydict["TZI"])
231
+ stdoffset = -tup[0]-tup[1] # Bias + StandardBias * -1
232
+ dstoffset = stdoffset-tup[2] # + DaylightBias * -1
233
+ self._std_offset = datetime.timedelta(minutes=stdoffset)
234
+ self._dst_offset = datetime.timedelta(minutes=dstoffset)
235
+
236
+ # for the meaning see the win32 TIME_ZONE_INFORMATION structure docs
237
+ # http://msdn.microsoft.com/en-us/library/windows/desktop/ms725481(v=vs.85).aspx
238
+ (self._stdmonth,
239
+ self._stddayofweek, # Sunday = 0
240
+ self._stdweeknumber, # Last = 5
241
+ self._stdhour,
242
+ self._stdminute) = tup[4:9]
243
+
244
+ (self._dstmonth,
245
+ self._dstdayofweek, # Sunday = 0
246
+ self._dstweeknumber, # Last = 5
247
+ self._dsthour,
248
+ self._dstminute) = tup[12:17]
249
+
250
+ self._dst_base_offset_ = self._dst_offset - self._std_offset
251
+ self.hasdst = self._get_hasdst()
252
+
253
+ def __repr__(self):
254
+ return "tzwin(%s)" % repr(self._name)
255
+
256
+ def __reduce__(self):
257
+ return (self.__class__, (self._name,))
258
+
259
+
260
+ class tzwinlocal(tzwinbase):
261
+ """
262
+ Class representing the local time zone information in the Windows registry
263
+
264
+ While :class:`dateutil.tz.tzlocal` makes system calls (via the :mod:`time`
265
+ module) to retrieve time zone information, ``tzwinlocal`` retrieves the
266
+ rules directly from the Windows registry and creates an object like
267
+ :class:`dateutil.tz.tzwin`.
268
+
269
+ Because Windows does not have an equivalent of :func:`time.tzset`, on
270
+ Windows, :class:`dateutil.tz.tzlocal` instances will always reflect the
271
+ time zone settings *at the time that the process was started*, meaning
272
+ changes to the machine's time zone settings during the run of a program
273
+ on Windows will **not** be reflected by :class:`dateutil.tz.tzlocal`.
274
+ Because ``tzwinlocal`` reads the registry directly, it is unaffected by
275
+ this issue.
276
+ """
277
+ def __init__(self):
278
+ with winreg.ConnectRegistry(None, winreg.HKEY_LOCAL_MACHINE) as handle:
279
+ with winreg.OpenKey(handle, TZLOCALKEYNAME) as tzlocalkey:
280
+ keydict = valuestodict(tzlocalkey)
281
+
282
+ self._std_abbr = keydict["StandardName"]
283
+ self._dst_abbr = keydict["DaylightName"]
284
+
285
+ try:
286
+ tzkeyname = text_type('{kn}\\{sn}').format(kn=TZKEYNAME,
287
+ sn=self._std_abbr)
288
+ with winreg.OpenKey(handle, tzkeyname) as tzkey:
289
+ _keydict = valuestodict(tzkey)
290
+ self._display = _keydict["Display"]
291
+ except OSError:
292
+ self._display = None
293
+
294
+ stdoffset = -keydict["Bias"]-keydict["StandardBias"]
295
+ dstoffset = stdoffset-keydict["DaylightBias"]
296
+
297
+ self._std_offset = datetime.timedelta(minutes=stdoffset)
298
+ self._dst_offset = datetime.timedelta(minutes=dstoffset)
299
+
300
+ # For reasons unclear, in this particular key, the day of week has been
301
+ # moved to the END of the SYSTEMTIME structure.
302
+ tup = struct.unpack("=8h", keydict["StandardStart"])
303
+
304
+ (self._stdmonth,
305
+ self._stdweeknumber, # Last = 5
306
+ self._stdhour,
307
+ self._stdminute) = tup[1:5]
308
+
309
+ self._stddayofweek = tup[7]
310
+
311
+ tup = struct.unpack("=8h", keydict["DaylightStart"])
312
+
313
+ (self._dstmonth,
314
+ self._dstweeknumber, # Last = 5
315
+ self._dsthour,
316
+ self._dstminute) = tup[1:5]
317
+
318
+ self._dstdayofweek = tup[7]
319
+
320
+ self._dst_base_offset_ = self._dst_offset - self._std_offset
321
+ self.hasdst = self._get_hasdst()
322
+
323
+ def __repr__(self):
324
+ return "tzwinlocal()"
325
+
326
+ def __str__(self):
327
+ # str will return the standard name, not the daylight name.
328
+ return "tzwinlocal(%s)" % repr(self._std_abbr)
329
+
330
+ def __reduce__(self):
331
+ return (self.__class__, ())
332
+
333
+
334
+ def picknthweekday(year, month, dayofweek, hour, minute, whichweek):
335
+ """ dayofweek == 0 means Sunday, whichweek 5 means last instance """
336
+ first = datetime.datetime(year, month, 1, hour, minute)
337
+
338
+ # This will work if dayofweek is ISO weekday (1-7) or Microsoft-style (0-6),
339
+ # Because 7 % 7 = 0
340
+ weekdayone = first.replace(day=((dayofweek - first.isoweekday()) % 7) + 1)
341
+ wd = weekdayone + ((whichweek - 1) * ONEWEEK)
342
+ if (wd.month != month):
343
+ wd -= ONEWEEK
344
+
345
+ return wd
346
+
347
+
348
+ def valuestodict(key):
349
+ """Convert a registry key's values to a dictionary."""
350
+ dout = {}
351
+ size = winreg.QueryInfoKey(key)[1]
352
+ tz_res = None
353
+
354
+ for i in range(size):
355
+ key_name, value, dtype = winreg.EnumValue(key, i)
356
+ if dtype == winreg.REG_DWORD or dtype == winreg.REG_DWORD_LITTLE_ENDIAN:
357
+ # If it's a DWORD (32-bit integer), it's stored as unsigned - convert
358
+ # that to a proper signed integer
359
+ if value & (1 << 31):
360
+ value = value - (1 << 32)
361
+ elif dtype == winreg.REG_SZ:
362
+ # If it's a reference to the tzres DLL, load the actual string
363
+ if value.startswith('@tzres'):
364
+ tz_res = tz_res or tzres()
365
+ value = tz_res.name_from_string(value)
366
+
367
+ value = value.rstrip('\x00') # Remove trailing nulls
368
+
369
+ dout[key_name] = value
370
+
371
+ return dout
@@ -0,0 +1,3 @@
1
+ # Vendored by tools/vendor_deps.py from python-dateutil 3.0.0 (see licenses/LICENSE_DATEUTIL).
2
+ # tzwin has moved to dateutil.tz.win
3
+ from .tz.win import *
@@ -0,0 +1,72 @@
1
+ # Vendored by tools/vendor_deps.py from python-dateutil 3.0.0 (see licenses/LICENSE_DATEUTIL).
2
+ # -*- coding: utf-8 -*-
3
+ """
4
+ This module offers general convenience and utility functions for dealing with
5
+ datetimes.
6
+
7
+ .. versionadded:: 2.7.0
8
+ """
9
+ from __future__ import unicode_literals
10
+
11
+ from datetime import datetime, time
12
+
13
+
14
+ def today(tzinfo=None):
15
+ """
16
+ Returns a :py:class:`datetime` representing the current day at midnight
17
+
18
+ :param tzinfo:
19
+ The time zone to attach (also used to determine the current day).
20
+
21
+ :return:
22
+ A :py:class:`datetime.datetime` object representing the current day
23
+ at midnight.
24
+ """
25
+
26
+ dt = datetime.now(tzinfo)
27
+ return datetime.combine(dt.date(), time(0, tzinfo=tzinfo))
28
+
29
+
30
+ def default_tzinfo(dt, tzinfo):
31
+ """
32
+ Sets the ``tzinfo`` parameter on naive datetimes only
33
+
34
+ This is useful for example when you are provided a datetime that may have
35
+ either an implicit or explicit time zone, such as when parsing a time zone
36
+ string.
37
+
38
+ .. doctest::
39
+
40
+ >>> from dateutil.tz import tzoffset
41
+ >>> from dateutil.parser import parse
42
+ >>> from dateutil.utils import default_tzinfo
43
+ >>> dflt_tz = tzoffset("EST", -18000)
44
+ >>> print(default_tzinfo(parse('2014-01-01 12:30 UTC'), dflt_tz))
45
+ 2014-01-01 12:30:00+00:00
46
+ >>> print(default_tzinfo(parse('2014-01-01 12:30'), dflt_tz))
47
+ 2014-01-01 12:30:00-05:00
48
+
49
+ :param dt:
50
+ The datetime on which to replace the time zone
51
+
52
+ :param tzinfo:
53
+ The :py:class:`datetime.tzinfo` subclass instance to assign to
54
+ ``dt`` if (and only if) it is naive.
55
+
56
+ :return:
57
+ Returns an aware :py:class:`datetime.datetime`.
58
+ """
59
+ if dt.tzinfo is not None:
60
+ return dt
61
+ else:
62
+ return dt.replace(tzinfo=tzinfo)
63
+
64
+
65
+ def within_delta(dt1, dt2, delta):
66
+ """
67
+ Useful for comparing two datetimes that may have a negligible difference
68
+ to be considered equal.
69
+ """
70
+ delta = abs(delta)
71
+ difference = dt1 - dt2
72
+ return -delta <= difference <= delta
@@ -0,0 +1,234 @@
1
+ # Vendored by tools/vendor_deps.py from python-dateutil 3.0.0 (see licenses/LICENSE_DATEUTIL).
2
+ # -*- coding: utf-8 -*-
3
+ """
4
+ The ``dateutil.zoneinfo`` module was originally designed to work with a tarball
5
+ shipped with ``dateutil``. Since ``dateutil`` now uses data from the same
6
+ sources as :py:mod:`zoneinfo`, this module is no longer necessary.
7
+
8
+ .. caution::
9
+ This module is deprecated, and its functionality has been dramatically
10
+ curtailed. It is recommended that you adopt the standard library module
11
+ :py:mod:`zoneinfo` or :func:`dateutil.tz.gettz` instead.
12
+
13
+ """
14
+
15
+ import json
16
+ import sys
17
+ import warnings
18
+ from tarfile import TarFile
19
+
20
+ from matplotlib_rs._vendor import six
21
+
22
+ from matplotlib_rs._vendor.dateutil import _tzdata_impl
23
+ from matplotlib_rs._vendor.dateutil.tz import tzfile as _tzfile
24
+
25
+ __all__ = ["get_zonefile_instance", "gettz", "gettz_db_metadata"]
26
+
27
+ ZONEFILENAME = None
28
+ METADATA_FN = 'METADATA'
29
+
30
+
31
+ def _importer_stacklevel():
32
+ """The ``stacklevel`` that attributes a warning to the importing code.
33
+
34
+ This module can be imported through ``dateutil.__getattr__`` (e.g. by
35
+ ``from dateutil import zoneinfo``), which calls
36
+ ``importlib.import_module``; the warnings machinery skips the import
37
+ system's own frames, but not those two, so skip them here.
38
+ """
39
+ level = 1
40
+ frame = sys._getframe(1) # The body of this module
41
+ while frame.f_back is not None:
42
+ frame = frame.f_back
43
+ filename = frame.f_code.co_filename
44
+ if "importlib" in filename and "_bootstrap" in filename:
45
+ # Since Python 3.5, the warnings machinery skips these frames
46
+ # without counting them; before that they count like any other.
47
+ if sys.version_info < (3, 5):
48
+ level += 1
49
+ continue
50
+
51
+ level += 1
52
+ if frame.f_globals.get("__name__") not in ("importlib", "dateutil"):
53
+ return level
54
+
55
+ return 2
56
+
57
+
58
+ warnings.warn(
59
+ "The `dateutil.zoneinfo` module has been replaced with a wrapper around "
60
+ "the tzdata package, and its use is deprecated, to be removed in a future "
61
+ "version. Use the standard library module `zoneinfo` or `dateutil.tz` "
62
+ "instead.",
63
+ DeprecationWarning,
64
+ stacklevel=_importer_stacklevel(),
65
+ )
66
+
67
+
68
+ tzfile = _tzfile
69
+
70
+ class ZoneInfoFile(object):
71
+ def __init__(self, zonefile_stream=None):
72
+ if zonefile_stream is not None:
73
+ self._load_legacy_zonefile_stream(zonefile_stream)
74
+ else:
75
+ self._eager_load_tzdata()
76
+
77
+ def _eager_load_tzdata(self):
78
+ try:
79
+ import tzdata
80
+ except ImportError as e:
81
+ six.raise_from(
82
+ ImportError(
83
+ "The tzdata module is required to use ZoneInfoFile; either add "
84
+ "a dependency on tzdata or migrate away from dateutil.zoneinfo."
85
+ ),
86
+ e,
87
+ )
88
+
89
+ zone_dict = {}
90
+
91
+ for key in _tzdata_impl._load_tzdata_keys():
92
+ with _tzdata_impl._load_tzdata(key) as f:
93
+ zone_dict[key] = tzfile(f, key=key)
94
+
95
+ self.zones = zone_dict
96
+ self.metadata = {
97
+ "metadata_version": "3.0",
98
+ "tzversion": tzdata.IANA_VERSION,
99
+ }
100
+
101
+ def _load_legacy_zonefile_stream(self, zonefile_stream):
102
+ with TarFile.open(fileobj=zonefile_stream) as tf:
103
+ self.zones = {
104
+ zf.name: tzfile(tf.extractfile(zf), filename=zf.name)
105
+ for zf in tf.getmembers()
106
+ if zf.isfile() and zf.name != METADATA_FN
107
+ }
108
+ # deal with links: They'll point to their parent object. Less
109
+ # waste of memory
110
+ links = {
111
+ zl.name: self.zones[zl.linkname]
112
+ for zl in tf.getmembers()
113
+ if zl.islnk() or zl.issym()
114
+ }
115
+ self.zones.update(links)
116
+ try:
117
+ metadata_json = tf.extractfile(tf.getmember(METADATA_FN))
118
+ metadata_str = metadata_json.read().decode("UTF-8")
119
+ self.metadata = json.loads(metadata_str)
120
+ except KeyError:
121
+ # no metadata in tar file
122
+ self.metadata = None
123
+
124
+ def get(self, name, default=None):
125
+ """
126
+ Wrapper for :func:`ZoneInfoFile.zones.get`. This is a convenience method
127
+ for retrieving zones from the zone dictionary.
128
+
129
+ :param name:
130
+ The name of the zone to retrieve. (Generally IANA zone names)
131
+
132
+ :param default:
133
+ The value to return in the event of a missing key.
134
+
135
+ .. versionadded:: 2.6.0
136
+
137
+ """
138
+ return self.zones.get(name, default)
139
+
140
+
141
+ # The current API has gettz as a module function, although in fact it taps into
142
+ # a stateful class. So as a workaround for now, without changing the API, we
143
+ # will create a new "global" class instance the first time a user requests a
144
+ # timezone. Ugly, but adheres to the api.
145
+ #
146
+ # TODO: Remove after deprecation period.
147
+ _CLASS_ZONE_INSTANCE = []
148
+
149
+
150
+ def get_zonefile_instance(new_instance=False):
151
+ """
152
+ This is a convenience function which provides a :class:`ZoneInfoFile`
153
+ instance using the data provided by the ``dateutil`` package. By default, it
154
+ caches a single instance of the ZoneInfoFile object and returns that.
155
+
156
+ :param new_instance:
157
+ If ``True``, a new instance of :class:`ZoneInfoFile` is instantiated and
158
+ used as the cached instance for the next call. Otherwise, new instances
159
+ are created only as necessary.
160
+
161
+ :return:
162
+ Returns a :class:`ZoneInfoFile` object.
163
+
164
+ .. versionadded:: 2.6
165
+ """
166
+ if new_instance:
167
+ zif = None
168
+ else:
169
+ zif = getattr(get_zonefile_instance, '_cached_instance', None)
170
+
171
+ if zif is None:
172
+ zif = ZoneInfoFile()
173
+
174
+ get_zonefile_instance._cached_instance = zif
175
+
176
+ return zif
177
+
178
+
179
+ def gettz(name):
180
+ """
181
+ This retrieves a time zone from the ``tzdata`` package.
182
+
183
+ :param name:
184
+ An IANA-style time zone name, as found in the zoneinfo file.
185
+
186
+ :return:
187
+ Returns a :class:`dateutil.tz.tzfile` time zone object.
188
+
189
+ .. warning::
190
+ It is generally inadvisable to use this function, and it is only
191
+ provided for API compatibility with earlier versions. This is *not*
192
+ equivalent to ``dateutil.tz.gettz()``, which selects an appropriate
193
+ time zone based on the inputs, favoring system zoneinfo. This is ONLY
194
+ for accessing the dateutil-specific zoneinfo (which may be out of
195
+ date compared to the system zoneinfo).
196
+
197
+ .. deprecated:: 2.6
198
+ If you need to use a specific zoneinfofile over the system zoneinfo,
199
+ instantiate a :class:`dateutil.zoneinfo.ZoneInfoFile` object and call
200
+ :func:`dateutil.zoneinfo.ZoneInfoFile.get(name)` instead.
201
+
202
+ Use :func:`get_zonefile_instance` to retrieve an instance of the
203
+ dateutil-provided zoneinfo.
204
+ """
205
+ warnings.warn("zoneinfo.gettz() will be removed in future versions, "
206
+ "to use the dateutil-provided zoneinfo files, instantiate a "
207
+ "ZoneInfoFile object and use ZoneInfoFile.zones.get() "
208
+ "instead. See the documentation for details.",
209
+ DeprecationWarning)
210
+
211
+ if len(_CLASS_ZONE_INSTANCE) == 0:
212
+ _CLASS_ZONE_INSTANCE.append(ZoneInfoFile())
213
+ return _CLASS_ZONE_INSTANCE[0].zones.get(name)
214
+
215
+
216
+ def gettz_db_metadata():
217
+ """Get the zonefile metadata
218
+
219
+ :returns:
220
+ A dictionary with the database metadata
221
+
222
+ .. deprecated:: 2.6
223
+ See deprecation warning in :func:`zoneinfo.gettz`. To get metadata,
224
+ query the attribute ``zoneinfo.ZoneInfoFile.metadata``.
225
+ """
226
+ warnings.warn("zoneinfo.gettz_db_metadata() will be removed in future "
227
+ "versions, to use the dateutil-provided zoneinfo files, "
228
+ "ZoneInfoFile object and query the 'metadata' attribute "
229
+ "instead. See the documentation for details.",
230
+ DeprecationWarning)
231
+
232
+ if len(_CLASS_ZONE_INSTANCE) == 0:
233
+ _CLASS_ZONE_INSTANCE.append(ZoneInfoFile())
234
+ return _CLASS_ZONE_INSTANCE[0].metadata