# weather - Access weather forecast
## Installation
```
pip install weather
```
## Usage
```python
import weather
forecast=weather.forecast()
forecast.today['6:00'].temp # Get temperature in current location at 6.00
```
### Different places
If you want to get forecast from different place, pass `forecast` an argument.
```python
import weather
forecast=weather.forecast('New York')
forecast.tommorow['11:00'].precip # Get precipitation in New York at 11.00
```
### Different sources
`weather` supports two weather sources:
1. [Yr.No](https://yr.no)
1. [7timer!](https://7timer.info)
If you want to get weather from different source, pass `forecast` argument called `source`.
```python
weather.forecast(service='yrno')
weather.forecast(service='7timer')
```
### Weather properties
<ol>
<li>
<p><code>wind</code>: Instance of <code>Wind()</code></p>
Properties:
<ol>
<li>
<p><code>speed</code>: Integer</p>
Speed in m/s
</li>
<li>
<p><code>direction</code>: Instance of <code>Direction()</code></p>
Properties:
<ol>
<li>
<p><code>angle</code>: Integer</p>
Angle in degrees
</li>
<li>
<p><code>direction</code>: String</p>
Angle in compass point (<code>'N'</code>,<code>'NE'</code>,<code>'E'</code>,<code>'SE'</code>,<code>'S'</code>,<code>'SW'</code>,
<code>'W'</code>, or <code>'NW'</code>)
</li>
</ol>
</li>
</ol>
</li>
<li>
<p><code>temp</code>: Float/Integer</p>
Temperature in °C or °F (not °K) (default °C, see 'Changing units')
</li>
<li>
<p><code>humid</code> (<code>yr.no</code> only, other services will return <code>None</code>): Float/Integer</p>
Humidity in %.
</li>
<li>
<p><code>precip</code> (<code>7timer</code> will return <code>bool</code>): Float/Integer</p>
Precipitation amount in milimeters
</ol>
### Changing units
```python
weather.forecast('New york', unit=weather.CELSIUS)#or weather.FAHRENHEIT
```
### CLI
Just run `weather`:
```[user@localhost ~] weather```
If you want to get all avaliable switches, use `weather -h`:
```python
usage: weather [-h] [--city CITY] [--country COUNTRY] [-d] [-s SERVICE]
[-u] [-a]
Python app for getting weather forecast
options:
-h, --help show this help message and exit
--city CITY City for forecast (if not passed, using current
location)
--country COUNTRY Country for forecast (see above)
-d, --debug Debug
-s SERVICE, --service SERVICE
Service to use ("yrno" or "7timer"). Implied with
"average"(try to optimise the service)
-u, --ugly Toggle JSON output
-a, --api Just print the data (implies JSON output)
```
That says basically enough to use it.
### License
`weather` is licensed under *MIT license*
Raw data
{
"_id": null,
"home_page": "https://github.com/jenca-adam/weather",
"name": "weather2",
"maintainer": "",
"docs_url": null,
"requires_python": "",
"maintainer_email": "",
"keywords": "",
"author": "Adam Jenca",
"author_email": "jenca.adam@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/d2/fa/5896a8ddde94e57c49d05424404d186bf3acbb5148a885d13e3a5679141e/weather2-1.6.2.tar.gz",
"platform": null,
"description": "\n# weather - Access weather forecast\n## Installation\n```\npip install weather\n```\n## Usage\n```python\nimport weather\nforecast=weather.forecast()\nforecast.today['6:00'].temp # Get temperature in current location at 6.00\n```\n### Different places\nIf you want to get forecast from different place, pass `forecast` an argument.\n```python\nimport weather\nforecast=weather.forecast('New York')\nforecast.tommorow['11:00'].precip # Get precipitation in New York at 11.00\n```\n### Different sources\n`weather` supports two weather sources:\n1. [Yr.No](https://yr.no)\n1. [7timer!](https://7timer.info)\nIf you want to get weather from different source, pass `forecast` argument called `source`.\n```python\nweather.forecast(service='yrno')\nweather.forecast(service='7timer')\n```\n### Weather properties\n<ol>\n <li>\n <p><code>wind</code>: Instance of <code>Wind()</code></p>\n Properties:\n <ol>\n <li>\n <p><code>speed</code>: Integer</p>\n Speed in m/s\n </li>\n <li>\n <p><code>direction</code>: Instance of <code>Direction()</code></p>\n Properties:\n <ol>\n <li>\n <p><code>angle</code>: Integer</p>\n Angle in degrees\n </li>\n <li>\n <p><code>direction</code>: String</p>\n Angle in compass point (<code>'N'</code>,<code>'NE'</code>,<code>'E'</code>,<code>'SE'</code>,<code>'S'</code>,<code>'SW'</code>,\n <code>'W'</code>, or <code>'NW'</code>)\n </li>\n </ol>\n </li>\n </ol>\n </li>\n <li>\n <p><code>temp</code>: Float/Integer</p>\n Temperature in \u00b0C or \u00b0F (not \u00b0K) (default \u00b0C, see 'Changing units')\n </li>\n <li>\n <p><code>humid</code> (<code>yr.no</code> only, other services will return <code>None</code>): Float/Integer</p>\n Humidity in %.\n </li>\n <li>\n <p><code>precip</code> (<code>7timer</code> will return <code>bool</code>): Float/Integer</p>\n Precipitation amount in milimeters\n</ol>\n\n### Changing units\n```python\nweather.forecast('New york', unit=weather.CELSIUS)#or weather.FAHRENHEIT\n```\n### CLI\nJust run `weather`:\n ```[user@localhost ~] weather```\nIf you want to get all avaliable switches, use `weather -h`:\n\n```python\nusage: weather [-h] [--city CITY] [--country COUNTRY] [-d] [-s SERVICE]\n [-u] [-a]\n\nPython app for getting weather forecast\n\noptions:\n -h, --help show this help message and exit\n --city CITY City for forecast (if not passed, using current\n location)\n --country COUNTRY Country for forecast (see above)\n -d, --debug Debug\n -s SERVICE, --service SERVICE\n Service to use (\"yrno\" or \"7timer\"). Implied with\n \"average\"(try to optimise the service)\n -u, --ugly Toggle JSON output\n -a, --api Just print the data (implies JSON output)\n\n``` \nThat says basically enough to use it.\n\n### License\n\n`weather` is licensed under *MIT license*\n",
"bugtrack_url": null,
"license": "",
"summary": "Access weather forecast",
"version": "1.6.2",
"project_urls": {
"Homepage": "https://github.com/jenca-adam/weather"
},
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "d2fa5896a8ddde94e57c49d05424404d186bf3acbb5148a885d13e3a5679141e",
"md5": "0984641dba311f7b440af0ee6c2c0df8",
"sha256": "cd0c3f6fda824d24a048022ae0ec41c7bbb391eac1546057247c19dc58451f83"
},
"downloads": -1,
"filename": "weather2-1.6.2.tar.gz",
"has_sig": false,
"md5_digest": "0984641dba311f7b440af0ee6c2c0df8",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 33452,
"upload_time": "2023-11-18T10:12:40",
"upload_time_iso_8601": "2023-11-18T10:12:40.275350Z",
"url": "https://files.pythonhosted.org/packages/d2/fa/5896a8ddde94e57c49d05424404d186bf3acbb5148a885d13e3a5679141e/weather2-1.6.2.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-11-18 10:12:40",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "jenca-adam",
"github_project": "weather",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"lcname": "weather2"
}