Skip to content

Commit b46f532

Browse files
committed
Ready to go live
1 parent 2909787 commit b46f532

File tree

1 file changed

+23
-20
lines changed

1 file changed

+23
-20
lines changed

README.md

Lines changed: 23 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,20 @@
99
[![PyPI - Python Version](https://img.shields.io/pypi/pyversions/pyowm.svg)](https://img.shields.io/pypi/pyversions/pyowm.svg)
1010
<br>
1111
[![Latest Release Documentation](https://readthedocs.org/projects/pyowm/badge/?version=latest)](https://pyowm.readthedocs.io/en/latest/)
12-
[![Build Status](https://travis-ci.org/csparpa/pyowm.png?branch=master)](https://travis-ci.org/csparpa/pyowm)
13-
[![Coverage Status](https://coveralls.io/repos/github/csparpa/pyowm/badge.svg?branch=master)](https://coveralls.io/github/csparpa/pyowm?branch=master)
12+
[![Build Status](https://travis-ci.org/csparpa/pyowm.png?branch=develop)](https://travis-ci.org/csparpa/pyowm)
13+
[![Coverage Status](https://coveralls.io/repos/github/csparpa/pyowm/badge.svg?branch=develop)](https://coveralls.io/github/csparpa/pyowm?branch=master)
1414
<br>
1515
<a href="https://www.buymeacoffee.com/LmAl1n9" target="_blank"><img src="https://www.buymeacoffee.com/assets/img/custom_images/black_img.png" alt="Buy Me A Coffee" style="height: auto !important;width: auto !important;" ></a>
1616
[![Say Thanks!](https://img.shields.io/badge/Say%20Thanks-!-1EAEDB.svg)](https://saythanks.io/to/csparpa%40gmail.com)
1717

1818
## What is it?
1919
PyOWM is a client Python wrapper library for OpenWeatherMap (OWM) web APIs. It allows quick and easy consumption of OWM data from Python applications via a simple object model and in a human-friendly fashion.
2020

21+
PyOWM runs on Python 3.7+
22+
23+
**Former Dark Sky API users**: you can can use PyOWM to get [OpenWeatherMap's OneCall API](https://openweathermap.org/api/one-call-api) data as an easy replacement to Dark Sky
24+
25+
### What kind of data do I get with PyOWM ?
2126
With PyOWM you can integrate into your code any of the following OpenWeatherMap web APIs:
2227

2328
- **Weather API v2.5** + **OneCall API**, providing current weather data, weather forecasts, weather history
@@ -28,11 +33,7 @@ With PyOWM you can integrate into your code any of the following OpenWeatherMap
2833
- **Weather Alerts API v3.0**, allowing to set triggers on weather conditions and areas and poll for spawned alerts
2934
- **Image tiles** for several map layers provided by OWM
3035

31-
PyOWM runs on Python 3.7+
32-
33-
**Former Dark Sky API users**: you can can use PyOWM to get [OpenWeatherMap's OneCall API](https://openweathermap.org/api/one-call-api) data as an easy replacement for Dark Sky
34-
35-
## Get started
36+
## Get started
3637

3738
### API key
3839

@@ -45,12 +46,13 @@ Please notice that the free API subscription plan is subject to requests throttl
4546
With a free OWM API Key:
4647

4748
```python
48-
import pyowm
49+
from pyowm import OWM
4950

50-
owm = pyowm.OWM('your-API-key') # You MUST provide a valid API key
51+
owm = OWM('your-API-key') # You MUST provide a valid API key
5152

5253
# Search for current weather in London (Great Britain)
53-
observation = owm.weather_at_place('London,GB')
54+
mgr = owm.weather_manager()
55+
observation = mgr.weather_at_place('London,GB')
5456
w = observation.weather
5557
print(w) # <Weather - reference time=2013-12-18 09:20, status=Clouds>
5658

@@ -61,20 +63,22 @@ w.temperature('celsius') # {'temp_max': 10.5, 'temp': 9.7, 'temp_min': 9.0}
6163

6264
# Search current weather observations in the surroundings of
6365
# lat=22.57W, lon=43.12S (Rio de Janeiro, BR)
64-
observation_list = owm.weather_around_coords(-22.57, -43.12)
66+
observation_list = mgr.weather_around_coords(-22.57, -43.12)
6567
```
6668

6769
With a paid OWM API key:
6870

6971
```python
70-
import pyowm
71-
72-
paid_owm = pyowm.OWM(API_key='your-pro-API-key', subscription_type='pro')
72+
from pyowm.owm import OWM
73+
from pyowm.utils import config
74+
from pyowm.utils import timestamps
75+
config_dict = config.get_default_config_for_subscription_type('professional')
76+
owm = OWM('your-paid-api-key', config_dict)
7377

7478
# Will it be clear tomorrow at this time in Milan (Italy) ?
75-
forecast = paid_owm.daily_forecast("Milan,IT")
76-
tomorrow = pyowm.timeutils.tomorrow()
77-
forecast.will_be_clear_at(tomorrow) # The sun always shines on Italy, right? ;)
79+
mgr = owm.weather_manager()
80+
forecast = mgr.daily_forecast("Milan,IT")
81+
forecast.will_be_clear_at(timestamps.tomorrow()) # The sun always shines on Italy, right? ;)
7882
```
7983

8084

@@ -85,9 +89,8 @@ Install with `pip` for your ease:
8589
$ pip install pyowm
8690
```
8791

88-
There is a lot of alternatives: [setuptools](https://github.com/csparpa/pyowm/wiki/Install#install-from-source-with-setuptools),
89-
[Windows installers](https://github.com/csparpa/pyowm/wiki/Install#windows-exe) and common package managers such as
90-
[Yaourt (Arch Linux)](https://github.com/csparpa/pyowm/wiki/Install#on-archlinux-with-yaourt) and [YaST/Zypper (OpenSuse)](https://github.com/csparpa/pyowm/wiki/Install#on-opensuse-with-yastzypper)
92+
There are alternatives: _setuptools_, _Windows installers_ and common Linux package managers such as _Yaourt (Arch Linux)_
93+
_YaST/Zypper (OpenSuse)_ (please refer to the documentation for more detail)
9194

9295
Eager to fetch the very latest updates to PyOWM? Install the development trunk (which might be unstable):
9396

0 commit comments

Comments
 (0)