python-weather 2.0.1__tar.gz → 2.0.3__tar.gz

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.
@@ -1,6 +1,6 @@
1
1
  The MIT License (MIT)
2
2
 
3
- Copyright (c) 2021-2024 null (https://github.com/null8626)
3
+ Copyright (c) 2021-2024 null8626
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
@@ -1,9 +1,10 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: python-weather
3
- Version: 2.0.1
3
+ Version: 2.0.3
4
4
  Summary: A free and asynchronous weather API wrapper made in Python, for Python.
5
5
  Author: null8626
6
6
  License: MIT
7
+ Project-URL: Donations, https://ko-fi.com/null8626
7
8
  Project-URL: Changelog, https://python-weather.readthedocs.io/en/latest/changelog.html
8
9
  Project-URL: Homepage, https://python-weather.readthedocs.io/en/latest/
9
10
  Project-URL: Documentation, https://python-weather.readthedocs.io/en/latest/
@@ -15,6 +16,7 @@ Classifier: Framework :: AsyncIO
15
16
  Classifier: Intended Audience :: Education
16
17
  Classifier: Intended Audience :: Developers
17
18
  Classifier: Intended Audience :: Information Technology
19
+ Classifier: Natural Language :: English
18
20
  Classifier: Topic :: Education
19
21
  Classifier: Topic :: Internet
20
22
  Classifier: Topic :: Scientific/Engineering
@@ -33,13 +35,16 @@ Classifier: Programming Language :: Python :: 3.12
33
35
  Requires-Python: >=3.8
34
36
  Description-Content-Type: text/markdown
35
37
  License-File: LICENSE
36
- Requires-Dist: aiohttp==3.9.3
38
+ Requires-Dist: aiohttp==3.9.5
37
39
 
38
- # [python-weather][pypi-url] [![pypi][pypi-image]][pypi-url] [![downloads][downloads-image]][pypi-url]
40
+ # [python-weather][pypi-url] [![pypi][pypi-image]][pypi-url] [![downloads][downloads-image]][pypi-url] [![ko-fi][ko-fi-brief-image]][ko-fi-url]
39
41
 
40
42
  [pypi-image]: https://img.shields.io/pypi/v/python-weather.svg?style=flat-square
41
43
  [pypi-url]: https://pypi.org/project/python-weather/
42
44
  [downloads-image]: https://img.shields.io/pypi/dm/python-weather?style=flat-square
45
+ [ko-fi-brief-image]: https://img.shields.io/badge/donations-ko--fi-red?color=ff5e5b&style=flat-square
46
+ [ko-fi-image]: https://ko-fi.com/img/githubbutton_sm.svg
47
+ [ko-fi-url]: https://ko-fi.com/null8626
43
48
 
44
49
  A free and asynchronous weather Python API wrapper made in Python, for Python.
45
50
 
@@ -85,3 +90,9 @@ if __name__ == '__main__':
85
90
 
86
91
  asyncio.run(getweather())
87
92
  ```
93
+
94
+ ## Donations
95
+
96
+ If you want to support this project, consider donating! ❤
97
+
98
+ [![ko-fi][ko-fi-image]][ko-fi-url]
@@ -1,8 +1,11 @@
1
- # [python-weather][pypi-url] [![pypi][pypi-image]][pypi-url] [![downloads][downloads-image]][pypi-url]
1
+ # [python-weather][pypi-url] [![pypi][pypi-image]][pypi-url] [![downloads][downloads-image]][pypi-url] [![ko-fi][ko-fi-brief-image]][ko-fi-url]
2
2
 
3
3
  [pypi-image]: https://img.shields.io/pypi/v/python-weather.svg?style=flat-square
4
4
  [pypi-url]: https://pypi.org/project/python-weather/
5
5
  [downloads-image]: https://img.shields.io/pypi/dm/python-weather?style=flat-square
6
+ [ko-fi-brief-image]: https://img.shields.io/badge/donations-ko--fi-red?color=ff5e5b&style=flat-square
7
+ [ko-fi-image]: https://ko-fi.com/img/githubbutton_sm.svg
8
+ [ko-fi-url]: https://ko-fi.com/null8626
6
9
 
7
10
  A free and asynchronous weather Python API wrapper made in Python, for Python.
8
11
 
@@ -48,3 +51,9 @@ if __name__ == '__main__':
48
51
 
49
52
  asyncio.run(getweather())
50
53
  ```
54
+
55
+ ## Donations
56
+
57
+ If you want to support this project, consider donating! ❤
58
+
59
+ [![ko-fi][ko-fi-image]][ko-fi-url]
@@ -3,13 +3,13 @@ requires = ["setuptools"]
3
3
 
4
4
  [project]
5
5
  name = "python-weather"
6
- version = "2.0.1"
6
+ version = "2.0.3"
7
7
  description = "A free and asynchronous weather API wrapper made in Python, for Python."
8
8
  readme = "README.md"
9
9
  license = { text = "MIT" }
10
10
  authors = [{ name = "null8626" }]
11
11
  keywords = ["weather", "forecast", "weather-api", "weather-forecast"]
12
- dependencies = ["aiohttp==3.9.3"]
12
+ dependencies = ["aiohttp==3.9.5"]
13
13
  classifiers = [
14
14
  "Development Status :: 5 - Production/Stable",
15
15
  "Framework :: aiohttp",
@@ -17,6 +17,7 @@ classifiers = [
17
17
  "Intended Audience :: Education",
18
18
  "Intended Audience :: Developers",
19
19
  "Intended Audience :: Information Technology",
20
+ "Natural Language :: English",
20
21
  "Topic :: Education",
21
22
  "Topic :: Internet",
22
23
  "Topic :: Scientific/Engineering",
@@ -36,6 +37,7 @@ classifiers = [
36
37
  requires-python = ">=3.8"
37
38
 
38
39
  [project.urls]
40
+ Donations = "https://ko-fi.com/null8626"
39
41
  Changelog = "https://python-weather.readthedocs.io/en/latest/changelog.html"
40
42
  Homepage = "https://python-weather.readthedocs.io/en/latest/"
41
43
  Documentation = "https://python-weather.readthedocs.io/en/latest/"
@@ -1,9 +1,14 @@
1
+ # -*- coding: utf-8 -*-
2
+
1
3
  from .enums import HeatIndex, Kind, Locale, Phase, UltraViolet, WindDirection
2
4
  from .constants import METRIC, IMPERIAL
3
5
  from .client import Client
4
6
  from .errors import Error
5
7
 
6
- __version__ = '2.0.1'
8
+ __title__ = 'python-weather'
9
+ __author__ = 'null8626'
10
+ __license__ = 'MIT'
11
+ __version__ = '2.0.3'
7
12
  __all__ = (
8
13
  'METRIC',
9
14
  'IMPERIAL',
@@ -79,23 +79,20 @@ class Client(CustomizableBase):
79
79
  locale = self._CustomizableBase__locale
80
80
 
81
81
  subdomain = f'{locale.value}.' if locale != Locale.ENGLISH else ''
82
- delay = 0
82
+ delay = 0.5
83
83
 
84
84
  while True:
85
- if delay != 0:
86
- await sleep(delay)
87
- delay *= 2
88
-
89
85
  async with self.__session.get(
90
86
  f'https://{subdomain}wttr.in/{quote_plus(location)}?format=j1'
91
87
  ) as resp:
92
88
  try:
93
89
  return Forecast(await resp.json(), unit, locale)
94
90
  except Exception as e:
95
- if delay == 4:
91
+ if delay == 2:
96
92
  raise e # okay, that's too much requests - just raise the error
97
- elif delay == 0:
98
- delay = 0.5
93
+
94
+ await sleep(delay)
95
+ delay *= 2
99
96
 
100
97
  async def close(self):
101
98
  """Closes the :class:`Client` object. Nothing will happen if it's already closed."""
@@ -35,5 +35,5 @@ class _Unit:
35
35
  METRIC = _Unit('C', 'Kmph', '', 'MM', '', 1)
36
36
  IMPERIAL = _Unit('F', 'Miles', 'Inches', 'Inches', 'Miles', 2.54)
37
37
 
38
- WIND_DIRECTION_EMOJIS = ['↓', '↙', '←', '↖', '↑', '↗', '→', '↘']
38
+ WIND_DIRECTION_EMOJIS = ('↓', '↙', '←', '↖', '↑', '↗', '→', '↘')
39
39
  LATLON_REGEX = compile(r'^Lat (\-?[\d\.]+) and Lon (\-?[\d\.]+)$')
@@ -402,7 +402,7 @@ class Phase(BasicEnum):
402
402
  return '🌒'
403
403
  elif self is self.FIRST_QUARTER:
404
404
  return '🌓'
405
- elif self is self.Waxing_GIBBOUS:
405
+ elif self is self.WAXING_GIBBOUS:
406
406
  return '🌔'
407
407
  elif self is self.FULL_MOON:
408
408
  return '🌕'
@@ -1,9 +1,10 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: python-weather
3
- Version: 2.0.1
3
+ Version: 2.0.3
4
4
  Summary: A free and asynchronous weather API wrapper made in Python, for Python.
5
5
  Author: null8626
6
6
  License: MIT
7
+ Project-URL: Donations, https://ko-fi.com/null8626
7
8
  Project-URL: Changelog, https://python-weather.readthedocs.io/en/latest/changelog.html
8
9
  Project-URL: Homepage, https://python-weather.readthedocs.io/en/latest/
9
10
  Project-URL: Documentation, https://python-weather.readthedocs.io/en/latest/
@@ -15,6 +16,7 @@ Classifier: Framework :: AsyncIO
15
16
  Classifier: Intended Audience :: Education
16
17
  Classifier: Intended Audience :: Developers
17
18
  Classifier: Intended Audience :: Information Technology
19
+ Classifier: Natural Language :: English
18
20
  Classifier: Topic :: Education
19
21
  Classifier: Topic :: Internet
20
22
  Classifier: Topic :: Scientific/Engineering
@@ -33,13 +35,16 @@ Classifier: Programming Language :: Python :: 3.12
33
35
  Requires-Python: >=3.8
34
36
  Description-Content-Type: text/markdown
35
37
  License-File: LICENSE
36
- Requires-Dist: aiohttp==3.9.3
38
+ Requires-Dist: aiohttp==3.9.5
37
39
 
38
- # [python-weather][pypi-url] [![pypi][pypi-image]][pypi-url] [![downloads][downloads-image]][pypi-url]
40
+ # [python-weather][pypi-url] [![pypi][pypi-image]][pypi-url] [![downloads][downloads-image]][pypi-url] [![ko-fi][ko-fi-brief-image]][ko-fi-url]
39
41
 
40
42
  [pypi-image]: https://img.shields.io/pypi/v/python-weather.svg?style=flat-square
41
43
  [pypi-url]: https://pypi.org/project/python-weather/
42
44
  [downloads-image]: https://img.shields.io/pypi/dm/python-weather?style=flat-square
45
+ [ko-fi-brief-image]: https://img.shields.io/badge/donations-ko--fi-red?color=ff5e5b&style=flat-square
46
+ [ko-fi-image]: https://ko-fi.com/img/githubbutton_sm.svg
47
+ [ko-fi-url]: https://ko-fi.com/null8626
43
48
 
44
49
  A free and asynchronous weather Python API wrapper made in Python, for Python.
45
50
 
@@ -85,3 +90,9 @@ if __name__ == '__main__':
85
90
 
86
91
  asyncio.run(getweather())
87
92
  ```
93
+
94
+ ## Donations
95
+
96
+ If you want to support this project, consider donating! ❤
97
+
98
+ [![ko-fi][ko-fi-image]][ko-fi-url]
@@ -0,0 +1 @@
1
+ aiohttp==3.9.5
@@ -1 +0,0 @@
1
- aiohttp==3.9.3
File without changes