A simple weather information tool.

Overview

pwy

A simple weather information tool.


Table of Contents

Features

  • ASCII art
  • Display weather information
    • The name of the location.
    • Temperature (and what the temperature feels like).
    • Weather and weather description.
    • Wind pressure, humidity, wind direction, and wind speed.
    • Time and timezone of the location.

Dependencies

  • OpenWeatherMap API key
  • Python 3.8
    • requests
    • rich
  • Internet connection

Installation

Pip install

Unix-like | Windows

pip3 install pwy

Manual/Git install

Unix-like | Windows

Download the latest pwy package here and uncompress it. Go to pwy directory.

cd pwy

Install pwy.

pip3 install .

Configuration

Unix-like | Windows

Before you can use pwy, you need to configure pwy. Run the command below and fill the required files, these fields are for the OWM API key, location, unit, and language.

pwy

After you're through, the pwy.json (~/.config/pwy.json for Unix-like and pwy.json for Windows) config file, containing your OWM API key, location, unit, and language, will be generated.

Get your OWM key by signing up.

If you want to edit your pwy configuration.

pwy --config

Usage

Unix-like | Windows

To display weather in your current city (from pwy.json).

pwy

To display weather in your current city.

pwy tokyo

You can also specify what country you are in by.

pwy tokyo,jp

To display weather with specific unit of measurement. By default the unit is Metric system.

pwy tokyo --unit imperial

To display weather with specific language.

pwy tokyo --lang ja

To display help information.

pwy --help

Update

Unix-like | Windows

pip3 install --upgrade pwy

Changelog

View Changelog.

Credits

License

This program is provided under the GPL-3.0 License.

Comments
  • Error when fetching weather

    Error when fetching weather

    With the latest available on pip:

    $ wwy kolkata
    Traceback (most recent call last):
      File "/usr/local/bin/wwy", line 8, in <module>
        sys.exit(main())
      File "/usr/local/lib/python3.8/dist-packages/wwy/__main__.py", line 146, in main
        display_weather_info(info)
      File "/usr/local/lib/python3.8/dist-packages/wwy/__main__.py", line 118, in display_weather_info
        for line in ascii:
    TypeError: 'NoneType' object is not iterable
    
    opened by jarun 8
  • name 'light_rain' is not defined

    name 'light_rain' is not defined

    getting the following error:

    $ wwy -c kolkata  
    Traceback (most recent call last):
      File "/usr/local/bin/wwy", line 8, in <module>
        sys.exit(main())
      File "/usr/local/lib/python3.8/dist-packages/wwy/__main__.py", line 92, in main
        get_ascii(info)
      File "/usr/local/lib/python3.8/dist-packages/wwy/__main__.py", line 69, in get_ascii
        for i in range(len(light_rain)):
    NameError: name 'light_rain' is not defined
    

    Please fix.

    opened by jarun 5
  • Missing ~/.pwrc?

    Missing ~/.pwrc?

    I've used pwy for a while to make a quick check on a sibling living in Japan. I tried it yesterday and got the following

    Traceback (most recent call last):
      File "/home/user/.local/bin/pwy", line 8, in <module>
        sys.exit(main())
      File "/home/user/.local/lib/python3.9/site-packages/pwy/cli.py", line 202, in main
        info = get_weather_data(location, unit, lang)
      File "/home/user/.local/lib/python3.9/site-packages/pwy/cli.py", line 35, in get_weather_data
        f"&appid={get_key()}&units={unit}&lang={lang}")
      File "/home/user/.local/lib/python3.9/site-packages/pwy/cli.py", line 20, in get_key
        with open(f"{home}/.pwyrc") as f:
    FileNotFoundError: [Errno 2] No such file or directory: '/home/user/.pwyrc'
    

    Obviously missing a .pwyrc, but what should I put there? I don't see it on the github page. I tried uninstalling and reinstalling both via pip3 and cloning the repo. Same issue. Any help appreciated.

    opened by gr4kk3r 3
  • Invalid API key

    Invalid API key

    Hi, I've created my API key and I've done pwy --config <api-key>, but when I do, say, pwy montreal, I see the following error:

    Invalid API key.
    Traceback (most recent call last):
      File "/data/dev/pytools/pwy/bin/pwy", line 8, in <module>
        sys.exit(main())
      File "/data/dev/pytools/pwy/lib/python3.9/site-packages/pwy/cli.py", line 202, in main
        info = get_weather_data(location, unit, lang)
      File "/data/dev/pytools/pwy/lib/python3.9/site-packages/pwy/cli.py", line 52, in get_weather_data
        "name": data["name"],
    KeyError: 'name'
    
    opened by farzadmf 3
  • Publish release assets for package building

    Publish release assets for package building

    If you could, I would appreciate it if you could upload zip and/or tar.gz files as releases so this can be built with python-setuptools and installed with a package manager. Please also include the api key in key.py in the compressed assets or add a switch so we can use our own openweathher api keys. Thanks.

    opened by CultofRobots 2
  • NameError: name 'pwy_jsoon' is not defined.

    NameError: name 'pwy_jsoon' is not defined.

    Running on Windows 10 I receive the follow error when attempting to run pwy version 1.4.6:

      File "C:\Users\User\scoop\apps\python\3.10.0\lib\site-packages\pwy\cli.py", line 38, in get_config_data
        data = json.load(pwy_jsoon)
    NameError: name 'pwy_jsoon' is not defined. Did you mean: 'pwy_json'?
    
    opened by patevs 0
  • Support for environment variable with location name

    Support for environment variable with location name

    Will it be possible to support an environment variable (e.g. LOCATION) similar to BROWSER to indicate the location when the positional argument is missing?

    Something in the lines of:

    LOCATION="New York" pyw
    

    Looking for it for better nnn integration. When I do:

    export NNN_HELP= pyw New York
    

    and exec NNN_HELP as a command, I get an error because of the space in New York.

    opened by jarun 3
Releases(2.1.2)
  • 2.1.2(Dec 25, 2022)

    • Changed license from GPLv3 to MIT.
      • Added MIT License notice to source code files
    • Added requirements.txt
    • Removed unused codes
    • Implemented comprehensions
    • Formatted with autopep8
    • Added .vscode settings
    Source code(tar.gz)
    Source code(zip)
  • 1.4.7(Dec 1, 2021)

  • 1.4.5(Nov 8, 2021)

    • Replaced pwyrc with pwy.json.
      • pwy.json
        • Set OWM API key.
        • Set default location.
        • Set default unit.
        • Set default language.
    • Ability to display weather using the pwy command.
      • pwy reads the values set in the pwy.json file.
      • If there is/are arguments, pwy will satisfy the arguments.
    • Minor code cleanup.
    Source code(tar.gz)
    Source code(zip)
  • 1.4.4(Sep 30, 2021)

  • 1.4.3(Sep 26, 2021)

    • Added default value to the arguments and removed the unnecessary if else.
    • Removed the unnecessary f-strings
    • Added sys.exit(1).
    • Moved .pwyrc to ~/.config/pwyrc (in Unix-like OS).
    • Minor code refactor.
    Source code(tar.gz)
    Source code(zip)
  • 1.4.2(Sep 17, 2021)

    • Moved main.py to cli.py.
    • Added _version.py.
    • Added --version argument.
    • Remove key.py.
    • Added --config argument to setup pwy.
    • API key is now stored in .pwyrc.
    Source code(tar.gz)
    Source code(zip)
  • 1.4.0(Jun 26, 2021)

    1.4.0 - 2021.06.26

    • Separated get_ascii() and get_weather_translation().
    • Removed the output labels.
    • Added main.py
    • Added zip and tar.gz archives for manual installation.
    Source code(tar.gz)
    Source code(zip)
Owner
Clint
University of Science and Technology of Southern Philippines, B.Sc. in Information Technology
Clint
Simple bot to receive feedback,same as livegram bot but with more features & full control over bot

Kontak Simple bot to receive feedback,same as livegram bot but with more features & full control over bot Deploy to VPS

Mahin Ahmed 2 Dec 16, 2021
Data from popular CS:GO website hltv.org

Welcome to hltv-data ๐Ÿ‘‹ ๐ŸŽฎ Data from popular CS:GO website hltv.org Install pip install hltv-data Usage The public methods can be reached using HLTVCl

Dariusz Choruลผy 28 Dec 23, 2022
A python package for AxisVM

PyAxisVM The package is under development. Follow us on social media, where we'll announce the first release! Overview The PyAxisVM project offers a h

AxisVM - InterCAD 8 Nov 19, 2022
SEMID - OSINT module with lots of discord functions

SEMID Framework About Semid is a framework with different Discord functions and

Hima 20 Sep 23, 2022
Telegram bot untuk mencari jawaban dibrainly, support inline juga

Brainly-Telebot Bot Untuk Mencari Jawaban Dibrainly Jika ingin clone. Boleh kok Dibuat dengan python menggunakan MTproto Library. Yaitu Pyrogram Bot y

... 7 Mar 17, 2022
My beancount practice as a template

my-beancount-template ไธชไบบ Beancount ๆ–นๆกˆ็š„ๆจกๆฟไป“ๅบ“ ็›ธๅ…ณๅšๅฎข ๅคๅผ่ฎฐ่ดฆๆŒ‡ๅŒ—๏ผˆไธ€๏ผ‰๏ผšWhat and Why๏ผŸ ๅคๅผ่ฎฐ่ดฆๆŒ‡ๅŒ—๏ผˆไบŒ๏ผ‰๏ผšๅš่ดฆๆ–นๆณ•่ฎบ ๅคๅผ่ฎฐ่ดฆๆŒ‡ๅŒ—๏ผˆไธ‰๏ผ‰๏ผšๅฆ‚ไฝ•ๆ‰“้€ ไธๅŠ้€”่€ŒๅบŸ็š„่ฎฐ่ดฆๆ–นๆกˆ ้…็ฝฎ ่ฏฆ็ป†้…็ฝฎ่ฏทๅ‚่€ƒๅšๅฎขไธ‰ใ€‚ๅฟ…้กปไฟฎๆ”น็š„้…็ฝฎๆœ‰๏ผš BotๅŠŸ่ƒฝ๏ผšdata/be

KAAAsS 29 Nov 29, 2022
A Python Script to automate searching of available vaccination centers in the city and hence booking

Cowin Vaccine Availability Notifier Cowin Vaccine Availability Notifier takes your City or PIN code as an input and automatically notifies you via ema

Jayesh Padhiar 7 Sep 05, 2021
Twitter Analysis of MIUUL CEO

Twitter Analysis of MIUUL CEO Business Problem I got last @mvahitkeskin 184 twee

ร‡aฤŸrฤฑ Karadeniz 6 Mar 12, 2022
A simple script that will watch a stream for you and earn the channel points.

Credits Main idea: https://github.com/gottagofaster236/Twitch-Channel-Points-Miner Bet system (Selenium): https://github.com/ClementRoyer/TwitchAutoCo

Alessandro Maggio 1.1k Jan 08, 2023
Reverse engineering the dengue virus (under development construction)

Reverse engineering the dengue virus (under development ๐Ÿšง ) What is dengue? Dengue is a viral infection transmitted to humans through the bite of inf

kjain 4 Feb 09, 2022
Discord.py Bot Series With Python

Discord.py Bot Series YouTube Playlist: https://www.youtube.com/playlist?list=PL9nZZVP3OGOAx2S75YdBkrIbVpiSL5oc5 Installation pip install -r requireme

Step 1 Dec 17, 2021
This is an Advanced Calculator maybe with Discord Buttons in python.

Welcome! This is an Advanced Calculator maybe with Discord Buttons in python. This was the first version of the calculator, made for my discord bot, P

Polsulpicien 18 Dec 24, 2022
A Flask & Twilio Secret Santa app.

๐ŸŽ„ โœจ Secret Santa Twilio โœจ ๐Ÿ“ฑ A contactless Secret Santa game built with Python, Flask and Twilio! Prerequisites ๐Ÿ“ A Twilio account. Sign up here ngr

Sangeeta Jadoonanan 5 Dec 23, 2021
stories-matiasucker created by GitHub Classroom

Stories do Instagram Este projeto tem como objetivo desenvolver uma pequena aplicaรงรฃo que simule os efeitos e funcionalidades ao estilo Instagram. A a

1 Dec 20, 2021
Discord Panel is an AIO panel for Discord that aims to have all the needed tools related to user token interactions, as in nuking and also everything you could possibly need for raids

Discord Panel Discord Panel is an AIO panel for Discord that aims to have all the needed tools related to user token interactions, as in nuking and al

11 Mar 30, 2022
GET-ACQ is a python tool used to gather all companies acquired by a given company domain name.

get-acq ๐Ÿข GET-ACQ is a python tool used to gather all companies acquired by a given company domain name. It is done by calling SecurityTrails API. Us

Milan 7 Dec 19, 2022
Ma2tl - macOS forensic timeline generator using the analysis result DBs of mac apt

ma2tl (mac_apt to timeline) This is a DFIR tool for generating a macOS forensic

Minoru Kobayashi 66 Nov 18, 2022
Autodrive is designed to make it as easy as possible to interact with the Google Drive and Sheets APIs via Python

Autodrive Autodrive is designed to make it as easy as possible to interact with the Google Drive and Sheets APIs via Python. It is especially designed

Chris Larabee 1 Oct 02, 2021
This is Source Code of PdiskUploaderBot

PdiskUploaderBot This is the source code of PdiskUploaderBot. And the developer of this bot is AJTimePyro, His Telegram Channel & Group. You can use t

Abhijeet 8 Oct 20, 2022