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
A discord bot with a leveling system (similar to mee6).

Discord.py A discord bot with a leveling system (like mee6) Pre-requisites Knowing how to get create an app/bot via discord's developer portal. Websit

26 Dec 11, 2022
❤️ DaisyX 2.0 ❤️ A Powerful, Smart And Simple Group Manager ... Written with AioGram , Pyrogram and Telethon...

❤️ DaisyX 2.0 ❤️ A Powerful, Smart And Simple Group Manager ... Written with AioGram , Pyrogram and Telethon... ⭐️ Thanks to everyone who starred Dais

TeamOfDaisyX 44 Oct 06, 2022
For Help/Questions Join in discord

Simple-Nitro-Generator-Source Must have installed python! Discord: $MartoBossX#7777 Server: https://discord.gg/ErynDxTV5Y DONATE: (Crypto) BTC: bc1qg8

1 Jan 08, 2022
OpenSource bot for control groups ...

⭕️ کمک به افراد برای اداره هرچه فان تره گروه 📟 همه گروه های بزرگ نیاز به یه بات خفن دارن تا از گروه مراقبت کنه این بات کارش همینه سعی کرده فیچر خیلی

Mehran Alam Beigi 2 Nov 26, 2021
Total servers you're in!

Discord-Servercount With this script you can check the amount of servers you are in, along with statistics of how many servers you are owner in and in

Nickyux 1 Feb 12, 2022
A Python library for the Buildkite API

PyBuildkite A Python library and client for the Buildkite API. Usage To get the package, execute: pip install pybuildkite Then set up an instance of

Peter Yasi 29 Nov 30, 2022
A combination between python-flask, that fetch and send data from league client during champion select thanks to LCU

A combination between python-flask, that fetch data and send from league client during champion select thanks to LCU and compare picked champs to the gamesDataBase that we need to collect using my ot

Anas Hamrouni 1 Jan 19, 2022
Wrapper for Gismeteo.ru.

pygismeteo Обёртка для Gismeteo.ru. Асинхронная версия здесь. Установка python -m pip install -U pygismeteo Документация https://pygismeteo.readthedoc

Almaz 7 Dec 26, 2022
Celestial - a Python regex Discord chatbot who can talk with you.

Celestial a Python regex Discord chat bot who can talk with you. Invite url: https://discord.com/api/oauth2/authorize?client_id=927573556961869825&per

Jirayu Kaewsing 3 Jan 01, 2023
MusicBot is the original Discord music bot written for Python 3.5+, using the discord.py library

The original MusicBot for Discord (formerly SexualRhinoceros/MusicBot)

Just Some Bots 2.9k Jan 02, 2023
Utility for converting IP Fabric webhooks into a Teams format

IP Fabric Webhook Integration for Microsoft Teams and/or Slack Setup IP Fabric Setup Go to Settings Webhooks Add webhook Provide a name URL will b

Community Fabric 1 Jan 26, 2022
GTPS Status Bot

Python GTPS Status Bot (BETA) Python GTPS Status Bot Require Python How To Use Download This Source Extract The Zip File Install the requirements (Mod

Lamp 4 Oct 11, 2021
Collect links to profiles by username through search engines

Marple Summary Collect links to profiles by username through search engines (currently Google and DuckDuckGo). Quick Start ./marple.py soxoj Results:

125 Dec 19, 2022
Framework to collect and process weather data from wttr.in.

Weathercrawler Automatic extraction and processing framework for weather data from wttr.in Installation tested with: Python 3.7.3 Python 3.9.4 git clo

Maurice Günder 0 Jul 26, 2021
A site devoted to celebrating to matching books with readers and readers with books. Inspired by the Readers' Advisory process in library science, Literati, and Stitch Fix.

Welcome to Readers' Advisory Greetings, fellow book enthusiasts! Visit Readers' Advisory! Menu Technologies Key Features Database Schema Front End Rou

jane martin 6 Dec 12, 2021
Best Buy purchase bot

B3 Best-Buy-Bot. Written in Python NOTICE: Don't be a disgrace to society. Don't use this for any mass buying/reselling purposes. About B3 is a bot th

Dogey11 8 Aug 15, 2022
🚀 An asynchronous python API wrapper meant to replace discord.py - Snappy discord api wrapper written with aiohttp & websockets

Pincer An asynchronous python API wrapper meant to replace discord.py ❗ The package is currently within the planning phase 📌 Links |Join the discord

Pincer 125 Dec 26, 2022
A Simple Google Translate Bot By VndGroup ❤️ Made With Python

VndGroup Google Translator Heroku Deploy ❤️ Functions This Bot Can Translate 95 Languages We Can Set Custom Language Group Support Mandatory Vars [+]

Venuja Sadew 1 Oct 09, 2022
A EddieHub API python package.

EddieHub A EddieHub API python package. Made with Python3 (C) @FayasNoushad Copyright permission under MIT License License - https://github.com/Fayas

Fayas Noushad 5 Sep 22, 2021
Official python API for Phish.AI public and private API to detect zero-day phishing websites

phish-ai-api Summary Official python API for Phish.AI public and private API to detect zero-day phishing websites How it Works (TLDR) Essentially we h

Phish.AI 168 May 17, 2022