PyNrk 1.0.8
Get know and get alert about everyday's weather!
License: MIT

<h1 id="NWF">Python-Norwegian-Meteorologisk-Institute</h1>

The name sounds PyNrk (Python-Norwegian-Meteorologisk-Institute) because the script is scraping data from <a href="https://yr.no">yr.no</a> . You can see the weather in actual time, you can see the weather in any day forecast and you can even set daily weather alerts.<br/>

* <a href="#install">INSTALLATION</a><br/>
	* <a href="#upgrade">UPGRADE</a><br/>
* <a href = "#usage">USAGE</a><br/>
* <a href = "#update">UPDATES AND VERSION</a><br/>
	* <a href="#zerozero">Version 1.0</a><br/>
	* <a href="#zeroone">Version 1.1</a><br/>
* <a href = "#about">ABOUT</a><br/>
* <a href = "#help">HELP</a><br/>
	* <a href = "#app">Application</a><br/>
		* <a href = "#registate">How to search continent, state or region?</a><br/>
		* <a href = "#today">How to search today's forecast?</a><br/>
		* <a href = "#daily">How to search more daily forecast?</a><br/>
		* <a href = "#help2">How to find help page?</a><br/>
		* <a href = "#set">How to set notification/ alert?</a><br/>
	* <a href = "#error">Error</a><br/>
		* <a href = "#urllib">urllib.error.HTTPError:</a><br/>
		* <a href = "#module">ModuleNotFoundError:</a><br/>
		* <a href = "#attribute">AttributeError:</a><br/>
* <a href = "#license">LICENSE</a><br/>
* <a href = "#contact">CONTACT</a><br/>
<br/>


<h2 id="install">INSTALLATION</h2>

See the <a href="https://pypi.org/project/PyNrk/">PyPi</a> page for more information.<br/><br/>
***Python3***<br/>
`pip3 install PyNrk`<br/>

***Python***<br/>
`pip install PyNrk`<br/>
<br/>


If you want to download source code (zip file) you can download it <a href="https://github.com/tucnakomet1/Python-Norwegian-Meteorologisk-Institute/archive/master.zip">here</a>.<br/><br/>
Or if you are Linux user type into the terminal:<br/> `git clone https://github.com/tucnakomet1/Python-Norwegian-Meteorologisk-Institute.git`
<br/><br/>


<h3 id="upgrade">UPGRADE</h3>

***Python3***<br/>
`pip3 install PyNrk --upgrade`<br/>

***Python***<br/>
`pip install PyNrk --upgrade`<br/>
<br/><br/><br/><br/><br/><br/><br/><br/><br/>



<h2 id="usage">USAGE</h2>


```python
>>> import PyNrk

##### Get help #####
>>> PyNrk.help()


##### See license #####
>>> PyNrk.license()


##### Contact #####
>>> PyNrk.contact()


##### List of continents and states #####
>>> PyNrk.ShowContinent()	# result: ['Africa', 'Antarctica', 'Asia', ....]

>>> PyNrk.ShowContinent("Europe")	# result: ['Austria', 'Italy', ....]

>>> PyNrk.ShowContinent("Europe", "Italy")	# result: ['Abruzzo', 'Aosta Valley', ...]


##### Get today's weather #####
>>> PyNrk.today("Italy")	# for actual weather in a few selected cities in whole Italy

>>> PyNrk.today("Italy", "Lazio")	# for actual weather in a few selected cities in whole Lazio region

>>> PyNrk.today("Italy", "Lazio", "Rome")	# for actual today's weather

>>> PyNrk.today("Italy", "Lazio", "Rome", 15)	# for today's weather in 15 hours


##### Get weather hour by hour #####
	# There is not possible to get the forecast for more than one day in advance because it doesn't even allow yr.no

>>> PyNrk.HourbyHour("Italy", "Lazio", "Rome", "today")	# for today's Hour By Hour forecast

>>> PyNrk.HourbyHour("Italy", "Lazio", "Rome", "tomorrow")	# for tomorrow's Hour By Hour forecast


##### Get anyday forecast #####
	# You can see 1 - 8 days forecast

>>> PyNrk.forecast("Italy")	# for 2 days forecast in a few selected cities in whole Italy

>>> PyNrk.forecast("Italy", "Lazio")	# for 2 days forecast in a few selected cities in whole Lazio region

>>> PyNrk.forecast("one", "Italy", "Lazio", "Rome")	# for tomorrow's forecast at actual time

>>> PyNrk.forecast("five", "Italy", "Lazio", "Rome", 15)	# for five days in advance forecast at 3 p.m.


##### Set every day alert #####
>>> PyNrk.SetAlert("Italy", "Lazio", "Rome", 10, 30)	# for every day weather alert at 10:30 a.m.
```

For better and more aesthetic result always `print()` the output:

```python
>>> import PyNrk
>>> GetToday = PyNrk.today("Italy", "Lazio", "Rome")
>>> print(GetToday)
```
<br/><br/><br/><br/><br/><br/><br/><br/>

<h2 id="update">UPDATES AND VERSION </h2>

<h3 id="zerozero"> Version 1.0 </h3> 

<em>Actuall version</em><br/>
- supported MacOS, Windows and Linux
- list of all continents, states and regions
- opportunity to get today's forecast
- opportunity to get 1-8 day's forecast
- opportunity to get hour-by-hour forecast
- Opportunity to set daily alerts for today's forecast
<br/><br/>


<h3 id="zeroone"> Version 1.1 </h3> 

<em>In development... Comming soon.</em><br/>
<em><strong>What can you expect:</em></strong><br/>
- choice to change language


<br/><br/><br/><br/><br/><br/><br/><br/><br/>


<h2 id="about">ABOUT</h2>

This scrript is created with the help of language Pyhon3. The name sounds PyNrk (Python-Norwegian-Meteorologisk-Institute) because the script is scraping data in reall time from <a href="https://yr.no">yr.no</a> . You can see the weather in actual time, you can see the weather in any day forecast and you can even set daily weather alerts.<br/> I tried to do my best so I hope everything is working. If you have some problem, please let me <a href = "#error">know</a>.<br/>
<br/><br/><br/><br/><br/><br/><br/><br/>


<h2 id="help">HELP</h2>

* <a href = "#app">Application</a><br/>
	* <a href = "#registate">How to search continent, state or region?</a><br/>
	* <a href = "#today">How to search today's forecast?</a><br/>
	* <a href = "#daily">How to search more daily forecast?</a><br/>
	* <a href = "#help2">How to find help page?</a><br/>
	* <a href = "#set">How to set notification/ alert?</a><br/>
* <a href = "#error">Error</a><br/>
	* <a href = "#urllib">urllib.error.HTTPError:</a><br/>
	* <a href = "#module">ModuleNotFoundError:</a><br/>
	* <a href = "#attribute">AttributeError:</a><br/>
<br/><br/>

 <h2 id = "app"> Application </h2>

<h3 id="registate">How to search continent, state or region? </h3>

<strong><em>Get list af all continents</em></strong><br/>
```python
>>> import PyNrk 
>>> continents = PyNrk.ShowContinent()
```

<br/>


<strong><em>Get list of all states in concretely continent</em></strong><br/>
```python
>>> import PyNrk 
>>> states = PyNrk.ShowContinent(continent) # Enter the Continent insted of "continent"
```

<br/>


<strong><em>Get list of all regions in concretely city</em></strong><br/>
```python
>>> import PyNrk 
>>> regions = PyNrk.ShowContinent(continent, state) # Enter the Continent and State insted of "continent, state"
```

<br/>


For more information about usage go <a href="https://github.com/tucnakomet1/Python-Norwegian-Meteorologisk-Institute#usage">here</a>.<br/><br/>


<h3 id="today"> How to search today's forecast? </h3>

<strong><em>Today's forecast in the whole State</em></strong><br/>
```python
>>> import PyNrk 
>>> TodayState = PyNrk.today(state) # Enter the State instead of "state"
>>> print(TodayState)
```
<br/>

<strong><em>Today's forecast in the whole Region</em></strong><br/>
```python
>>> import PyNrk 
>>> TodayRegion = PyNrk.today(state, region) # Enter the State and Region instead of "state, region"
>>> print(TodayRegion)
```
<br/>

<strong><em>Today's forecast in specific city</em></strong><br/>
```python
>>> import PyNrk 
>>> TodayCity = PyNrk.today(state, region, city) # Enter the State, Region and city instead of "state, region, city"
>>> print(TodayCity)
```
<br/>

<strong><em>Today's forecast in specific city and time</em></strong><br/>
```python
>>> import PyNrk 
>>> TodayTime = PyNrk.today(state, region, city, time) # Enter the State, Region, city and hour instead of "state, region, city, time"
>>> print(TodayTime)
```
<br/>

<strong><em>Today's forecast hour-by-hour</em></strong><br/>
```python
>>> import PyNrk 
>>> TodayHBH = PyNrk.HourByHour(state, region, city, "today") # Enter the State, Region, city and "today", instead of "state, region, city"
>>> print(TodayHBH)
```
<br/>

For more information about usage go <a href="https://github.com/tucnakomet1/Python-Norwegian-Meteorologisk-Institute#usage">here</a>.<br/>

<h3 id="daily"> How to search more daily forecast? </h3>

<strong><em>Two days forecast in the whole State</em></strong><br/>
```python
>>> import PyNrk 
>>> ForecastState = PyNrk.forecast(state) # Enter the State instead of "state"
>>> print(ForecastState)
```
<br/>

<strong><em>Two days forecast in the whole Region</em></strong><br/>
```python
>>> import PyNrk 
>>> ForecastRegion = PyNrk.forecast(state, region) # Enter the State and Region instead of "state, region"
>>> print(ForecastRegion)
```
<br/>

<strong><em>Any day forecast in specific city</em></strong><br/>
You can search one - eight day forecast.
```python
>>> import PyNrk 
>>> ForecastCity = PyNrk.forecast(day, state, region, city) # Enter the day ("one" - "eight"), State, Region and City instead of "day, state, region, city"
>>> print(ForecastCity)
```
<br/>

<strong><em>Any day forecast in specific city and time</em></strong><br/>
```python
>>> import PyNrk 
>>> ForecastTime = PyNrk.forecast(day,state, region, city, time) # Enter the day ("one" - "eight"), State, Region and City and hour instead of "day, state, region, city, time"
>>> print(ForecastTime)
```
<br/>

<strong><em>Tomorrow's forecast hour-by-hour</em></strong><br/>
Atribute `HourByHour()` works just for today's and tomorrow's weather.<br/>
```python
>>> import PyNrk 
>>> ForecastHBH = PyNrk.HourByHour(state, region, city, "tomorrow") # Enter the State, Region, city and "tomorrow" instead of "state, region, city"
>>> print(ForecastHBH)
```
<br/>

For more information about usage go <a href="https://github.com/tucnakomet1/Python-Norwegian-Meteorologisk-Institute#usage">here</a>.<br/><br/>

<h3 id="help2"> How to find help page? </h3>

this is the easiest way...<br/>
```python
>>> import PyNrk 
>>> PyNrk.help()
```
<br/>

<h3 id="set"> How to set notification/ alert? </h3>

Setting is really simple...<br/>
```python
>>> import PyNrk 
>>> PyNrk.SetAlert(state, region, city, hour, minute) # Enter the State, Region, city, hour and minute instead of "state, region, city, hour, minute"
```
<br/>

For more information about usage go <a href="https://github.com/tucnakomet1/Python-Norwegian-Meteorologisk-Institute#usage">here</a>.<br/><br/>


 <h2 id = "error"> Error </h2>

<h3 id="urllib"> urllib.error.HTTPError: HTTP Error 404: Not Found </h3><br/>

This error means you entered the wrong state, region, or city name.<br/>
You should try to search only the state first, then add the region and then add the city. That you know what's wrong.<br/><br/>

<h3 id="module"> ModuleNotFoundError: No module named 'dbus' </h3><br/>

This error means that you don't have `dbus` installed. Sometimes this happens to Windows users.<br/>
Repair is fortunately simple...<br/>
Just typy into cmd: `pip install dbus-python` <br/>
After installation should be everything alright.<br/><br/>


<h3 id="attribute"> AttributeError: 'NoneType' object has no attribute '...' </h3><br/>

This error means that you used / entered an object that doesn't exist. It is probably typing error.<br/>
Make sure you wrote everything <a href="#usage">correctly</a>.
<br/><br/><br/><br/><br/><br/><br/><br/>


<h2 id="license">LICENSE</h2>

[MIT](https://github.com/tucnakomet1/Python-Norwegian-Meteorologisk-Institute/blob/master/LICENSE.txt)
<br/><br/><br/><br/><br/><br/><br/><br/>

<h2 id="contact">CONTACT</h2>
You can contact me via my <a href="https://mail.google.com/mail/u/0/?view=cm&fs=1&to=tucnakomet@gmail.com&su=Python-Norwegian-Meteorologisk-Institute&&tf=1">gmail</a> address <a href="mailto:tucnakomet@gmail.com">tucnakomet@gmail.com</a>.<br/>
 <br/><br/>


 <a href = "#NWF"><span title="Go UP!"><img alt="up" src="https://ps.w.org/wpfront-scroll-top/assets/icon.svg?rev=1534312" width="40" height="40" style="border:0px solid;" /></a></span>
  <a href = "https://github.com/tucnakomet1"><span title="GitHub"><img alt="github" src="https://upload.wikimedia.org/wikipedia/commons/thumb/9/91/Octicons-mark-github.svg/1200px-Octicons-mark-github.svg.png" width="40" height="40" style="border:0px solid;" /></a></span>
   <a href = "https://pypi.org/user/Tucnakomet/"><span title="PyPi"><img alt="pypi" src="https://miro.medium.com/max/660/1*2FrV8q6rPdz6w2ShV6y7bw.png" width="40" height="40" style="border:0px solid;" /></a></span>