Skip to content

Commit

Permalink
PyPI v0.1.0 3-Alpha Test Release
Browse files Browse the repository at this point in the history
  • Loading branch information
vatsa287 committed Jul 28, 2020
1 parent 8b36e8d commit d4a43a4
Show file tree
Hide file tree
Showing 18 changed files with 263 additions and 49 deletions.
65 changes: 65 additions & 0 deletions PyPIDocumentation.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
# cli-weather

**cli-weather** is a command line app to get instant weather data based on city name or postalcode right on the command line.
Written in python and powered by **WeatherBIT API**, cli-weather also provides detailed weather data on historic and 16 day forecasts basis and not just the temparature.

With *cli-weather app* you can retrieve current weather observations from over **45,000** live weather stations using WeatherBIT API, and highly localized weather forecasts for any point on the globe using the world's most trusted weather models!

You can look up weather data by many methods including:
- By entering city_name
- By entering postal_code

## Installation

```
pip install cli-weather
```

## Usage

```
cli-weather command [-h] [-c COUNTRY] [-u UNITS] [-d] city_name/postal_code
```

|Command | Description |
|----------------|-------------------------------|
|city | Get weather by city name |
|postalcode | Get weather by postal code |

|Option | Description |
|----------------|-------------------------------|
|-c, --country | Country of entered area |
|-u, --units | Metric, Scientific, Farenheit |
|-d, --detailed | Display detailed weather data |
|-h, --help | Show this message and exit |

## Data sources

* [weatherbit.io](https://weatherbit.io/)

## Dependencies

* [requests](http://docs.python-requests.org/en/latest/) >= 2.4

## Try without using pip

```
Fork this repository
$ git clone "https://github.com/username/cli-weather"
$ cd cli_weather
$ pip install -r requirements.txt
$ python main.py [command] [options]
```

## License

GNU General Public License v3.0

**ver 0.1.0**

3 - Alpha Test Release
- Get weather by city
- Get weather by postalcode
- Change units according as you wish [Metric/Scientific/Farenheit]
- Only temparature by default, detailed information from snowfall to solar radiation
93 changes: 93 additions & 0 deletions cli_weather.egg-info/PKG-INFO
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
Metadata-Version: 2.1
Name: cli-weather
Version: 0.1.0
Summary: Lightweight command line app to get fast weather data right on the command line
Home-page: https://github.com/vatsa287/cli-weather
Author: Shree Vatsa N
Author-email: [email protected]
License: GPL 3.0
Description: # cli-weather

**cli-weather** is a command line app to get instant weather data based on city name or postalcode right on the command line.
Written in python and powered by **WeatherBIT API**, cli-weather also provides detailed weather data on historic and 16 day forecasts basis and not just the temparature.

With *cli-weather app* you can retrieve current weather observations from over **45,000** live weather stations using WeatherBIT API, and highly localized weather forecasts for any point on the globe using the world's most trusted weather models!

You can look up weather data by many methods including:
- By entering city_name
- By entering postal_code

## Installation

```
pip install cli-weather
```

## Usage

```
cli-weather command [-h] [-c COUNTRY] [-u UNITS] [-d] city_name/postal_code
```

|Command | Description |
|----------------|-------------------------------|
|city | Get weather by city name |
|postalcode | Get weather by postal code |

|Option | Description |
|----------------|-------------------------------|
|-c, --country | Country of entered area |
|-u, --units | Metric, Scientific, Farenheit |
|-d, --detailed | Display detailed weather data |
|-h, --help | Show this message and exit |

## Data sources

* [weatherbit.io](https://weatherbit.io/)

## Dependencies

* [requests](http://docs.python-requests.org/en/latest/) >= 2.4

## Try without using pip

```
Fork this repository
$ git clone "https://github.com/username/cli-weather"
$ cd cli_weather
$ pip install -r requirements.txt
$ python main.py [command] [options]

```

## License

GNU General Public License v3.0

**ver 0.1.0**

3 - Alpha Test Release
- Get weather by city
- Get weather by postalcode
- Change units according as you wish [Metric/Scientific/Farenheit]
- Only temparature by default, detailed information from snowfall to solar radiation

Platform: UNKNOWN
Classifier: Development Status :: 3 - Alpha
Classifier: Topic :: Utilities
Classifier: Intended Audience :: Developers
Classifier: Environment :: Console
Classifier: License :: OSI Approved :: GNU General Public License v3 (GPLv3)
Classifier: Operating System :: POSIX :: Linux
Classifier: Operating System :: Microsoft :: Windows
Classifier: Operating System :: MacOS
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 2
Classifier: Programming Language :: Python :: 2.3
Classifier: Programming Language :: Python :: 2.4
Classifier: Programming Language :: Python :: 2.5
Classifier: Programming Language :: Python :: 2.6
Classifier: Programming Language :: Python :: 2.7
Classifier: Programming Language :: Python :: 3
Classifier: Natural Language :: English
Description-Content-Type: text/markdown
12 changes: 12 additions & 0 deletions cli_weather.egg-info/SOURCES.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
README.md
setup.py
cli_weather/__init__.py
cli_weather/get_by_city.py
cli_weather/get_by_postalcode.py
cli_weather/main.py
cli_weather.egg-info/PKG-INFO
cli_weather.egg-info/SOURCES.txt
cli_weather.egg-info/dependency_links.txt
cli_weather.egg-info/entry_points.txt
cli_weather.egg-info/requires.txt
cli_weather.egg-info/top_level.txt
1 change: 1 addition & 0 deletions cli_weather.egg-info/dependency_links.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

3 changes: 3 additions & 0 deletions cli_weather.egg-info/entry_points.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[console_scripts]
cli-weather = cli_weather.main:main

1 change: 1 addition & 0 deletions cli_weather.egg-info/requires.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
requests
1 change: 1 addition & 0 deletions cli_weather.egg-info/top_level.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
cli_weather
Binary file added cli_weather/__init__.pyc
Binary file not shown.
Binary file modified cli_weather/__pycache__/get_by_city.cpython-36.pyc
Binary file not shown.
Binary file modified cli_weather/__pycache__/get_by_postalcode.cpython-36.pyc
Binary file not shown.
47 changes: 23 additions & 24 deletions cli_weather/get_by_city.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ def get_by_city_args(subparsers):
)
city_parser.add_argument(
"city",
help="enter city name to get current temparature"
help="get weather by city name"
)
city_parser.add_argument(
"-c", "--country",
help="country of the city",
help="country of entered area",
default=""
)
city_parser.add_argument(
Expand All @@ -21,7 +21,7 @@ def get_by_city_args(subparsers):
)
city_parser.add_argument(
"-d","--detailed",
help="displays detailed weather data",
help="display detailed weather data",
action="store_true"
)

Expand Down Expand Up @@ -68,27 +68,26 @@ def city_parse(args):
distance = "in"

if args.detailed:
print(
" Have a nice day!\n\n",
"city: {}\n".format(args.city.capitalize()),
"temparature: {} {}\n".format(data[0]['temp'],degree),
"summary: {}\n".format(weather['description']),
"source station ID: {}\n".format(data[0]['station']),
"latitude: {} degrees\n".format(data[0]['lat']),
"longitude: {} degrees\n".format(data[0]['lon']),
"timezone: {}\n".format(data[0]['timezone']),
"last observation time: {}\n".format(data[0]['ob_time']),
"sunrise: {}\n".format(data[0]['sunrise']),
"sunset: {}\n".format(data[0]['sunset']),
"pressure: {} mb\n".format(data[0]['pres']),
"sea level pressure: {} mb\n".format(data[0]['slp']),
"wind speed: {} {}\n".format(data[0]['wind_spd'],speed),
"wind direction: {} degrees\n".format(data[0]['wind_dir']),
"visibility: {} KM\n".format(data[0]['vis']),
"relative humidity: {} %\n".format(data[0]['rh']),
"snowfall: {} {}/hr\n".format(data[0]['snow'],distance),
"estimated solar radiation: {} W/m^2".format(data[0]['solar_rad'])
)
print("Have a nice day!\n")
print("city : {}".format(args.city.capitalize()))
print("temparature : {} {}".format(data[0]['temp'],degree))
print("summary : {}".format(weather['description']))
print("source station ID : {}".format(data[0]['station']))
print("latitude : {} degrees".format(data[0]['lat']))
print("longitude : {} degrees".format(data[0]['lon']))
print("timezone : {}".format(data[0]['timezone']))
print("last observation time : {}".format(data[0]['ob_time']))
print("sunrise : {}".format(data[0]['sunrise']))
print("sunset : {}".format(data[0]['sunset']))
print("pressure : {} mb".format(data[0]['pres']))
print("sea level pressure : {} mb".format(data[0]['slp']))
print("wind speed : {} {}".format(data[0]['wind_spd'],speed))
print("wind direction : {} degrees".format(data[0]['wind_dir']))
print("visibility : {} KM".format(data[0]['vis']))
print("relative humidity : {} %".format(data[0]['rh']))
print("snowfall : {} {}/hr".format(data[0]['snow'],distance))
print("estimated solar radiation: {} W/m^2".format(data[0]['solar_rad']))

elif args.detailed is False:
print("Current temparature in {} is {} {}" .format(city.capitalize(), data[0]['temp'], degree))

Binary file modified cli_weather/get_by_city.pyc
Binary file not shown.
46 changes: 22 additions & 24 deletions cli_weather/get_by_postalcode.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ def get_by_postalcode_args(subparsers):
)
postalcode_parser.add_argument(
"postalcode",
help="enter postal code to get current temparature"
help="get weather by postal code"
)
postalcode_parser.add_argument(
"-c", "--country",
help="country of given postal code",
help="country of entered area",
default=""
)
postalcode_parser.add_argument(
Expand All @@ -21,7 +21,7 @@ def get_by_postalcode_args(subparsers):
)
postalcode_parser.add_argument(
"-d","--detailed",
help="displays sdetailed weather data",
help="display sdetailed weather data",
action="store_true"
)

Expand Down Expand Up @@ -68,27 +68,25 @@ def postalcode_parse(args):
distance = "in"

if args.detailed:
print(
" Have a nice day!\n\n",
"city: {}\n".format(data[0]['city_name'].capitalize()),
"temparature: {} {}\n".format(data[0]['temp'],degree),
"summary: {}\n".format(weather['description']),
"source station ID: {}\n".format(data[0]['station']),
"latitude: {} degrees\n".format(data[0]['lat']),
"longitude: {} degrees\n".format(data[0]['lon']),
"timezone: {}\n".format(data[0]['timezone']),
"last observation time: {}\n".format(data[0]['ob_time']),
"sunrise: {}\n".format(data[0]['sunrise']),
"sunset: {}\n".format(data[0]['sunset']),
"pressure: {} mb\n".format(data[0]['pres']),
"sea level pressure: {} mb\n".format(data[0]['slp']),
"wind speed: {} {}\n".format(data[0]['wind_spd'],speed),
"wind direction: {} degrees\n".format(data[0]['wind_dir']),
"visibility: {} KM\n".format(data[0]['vis']),
"relative humidity: {} %\n".format(data[0]['rh']),
"snowfall: {} {}/hr\n".format(data[0]['snow'],distance),
"estimated solar radiation: {} W/m^2".format(data[0]['solar_rad'])
)
print("Have a nice day!\n")
print("city : {}".format(data[0]['city_name'].capitalize()))
print("temparature : {} {}".format(data[0]['temp'],degree))
print("summary : {}".format(weather['description']))
print("source station ID : {}".format(data[0]['station']))
print("latitude : {} degrees".format(data[0]['lat']))
print("longitude : {} degrees".format(data[0]['lon']))
print("timezone : {}".format(data[0]['timezone']))
print("last observation time : {}".format(data[0]['ob_time']))
print("sunrise : {}".format(data[0]['sunrise']))
print("sunset : {}".format(data[0]['sunset']))
print("pressure : {} mb".format(data[0]['pres']))
print("sea level pressure : {} mb".format(data[0]['slp']))
print("wind speed : {} {}".format(data[0]['wind_spd'],speed))
print("wind direction : {} degrees".format(data[0]['wind_dir']))
print("visibility : {} KM".format(data[0]['vis']))
print("relative humidity : {} %".format(data[0]['rh']))
print("snowfall : {} {}/hr".format(data[0]['snow'],distance))
print("estimated solar radiation: {} W/m^2".format(data[0]['solar_rad']))
elif args.detailed is False:
print("Current temparature in {} is {} {}" .format(data[0]['city_name'].capitalize(), data[0]['temp'], degree))

Binary file added cli_weather/get_by_postalcode.pyc
Binary file not shown.
Binary file added cli_weather/main.pyc
Binary file not shown.
Binary file added dist/cli-weather-0.1.0.tar.gz
Binary file not shown.
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pyweatherbit
json
requests
argparse
requests
41 changes: 41 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
from setuptools import setup

long_description = open('PyPIDocumentation.md').read()

setup(
name='cli-weather',
version='0.1.0',
description='Lightweight command line app to get fast weather data right on the command line',
long_description_content_type='text/markdown',
long_description=long_description,
url='https://github.com/vatsa287/cli-weather',
author='Shree Vatsa N',
author_email='[email protected]',
license='GPL 3.0',
packages=['cli_weather'],
install_requires=['requests'],
entry_points = {
'console_scripts': [
'cli-weather=cli_weather.main:main'
]
},
classifiers=[
"Development Status :: 3 - Alpha",
"Topic :: Utilities",
"Intended Audience :: Developers",
"Environment :: Console",
"License :: OSI Approved :: GNU General Public License v3 (GPLv3)",
"Operating System :: POSIX :: Linux",
"Operating System :: Microsoft :: Windows",
"Operating System :: MacOS",
"Programming Language :: Python",
"Programming Language :: Python :: 2",
"Programming Language :: Python :: 2.3",
"Programming Language :: Python :: 2.4",
"Programming Language :: Python :: 2.5",
"Programming Language :: Python :: 2.6",
"Programming Language :: Python :: 2.7",
"Programming Language :: Python :: 3",
"Natural Language :: English"
],
)

0 comments on commit d4a43a4

Please sign in to comment.