pyweathercli
pyweathercli is a command line interface to retrieve information on different locations. It allows for configuration of a default location. This allows to not pass a location argument each time. pyweathercli uses Open Weather Map and pyowm to retrieve information, pyfiglet for text encoding and click for the cli creation.
Installing
$ pip install -U pyweathercli
Configuration File
A configuration file can be located in the package file. The file is named under config.json. Below is the diagram.
{
"default_location": "",
"api_key": ""
}
Obtaining an OWM API Key
To obtain an OWM API Key, visit the link here. Click the login button. Then enter your credentials or sign up. You will be greeted with a landing page. On the middle navigation bar, click API Keys, and a default API Key will be shown. You can copy that or make one of your own. Once you obtain your API Key, set it using the --apikey flag during your first use. Example:
$ weather --location "Los Angeles" --apikey "API KEY HERE"
Use
Setting a default location via the command line
$ weather [-d or --default] "Location name"
This will edit the configuration file with a default location name. Doing this will alow the following usage.
$ weather
---------------------------------------------------------
____ _
/ ___| | ___ __ _ _ __
| | | |/ _ \/ _` | '__|
| |___| | __/ (_| | |
\____|_|\___|\__,_|_|
Location: Los Angeles
Clear Sky
Sunrise Time: 2020-05-23 10:32:13+00
Sunset Time: 2020-05-24 00:40:06+00
Temperature: 66°F / 19°C
Heat Index: 66°F / 19°C
Humidity: 93%
Pressure: 32 barometers
Wind: 3mph / 5kph
Visibility Distance: 10m / 16km
---------------------------------------------------------
Use without a default location
$ weather [--location or -l] "Location name"
---------------------------------------------------------
____ _
/ ___| | ___ __ _ _ __
| | | |/ _ \/ _` | '__|
| |___| | __/ (_| | |
\____|_|\___|\__,_|_|
Location: Los Angeles
Clear Sky
Sunrise Time: 2020-05-23 10:32:13+00
Sunset Time: 2020-05-24 00:40:06+00
Temperature: 66°F / 19°C
Heat Index: 66°F / 19°C
Humidity: 93%
Pressure: 32 barometers
Wind: 3mph / 5kph
Visibility Distance: 10m / 16km
---------------------------------------------------------
Metadata
Release files for pyweathercli 0.0.4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| pyweathercli-0.0.4.tar.gz | 3.5 kB | Without provenance | Details for pyweathercli-0.0.4.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| pyweathercli-0.0.4-py3-none-any.whl | Python 3 | none | any | Details for pyweathercli-0.0.4-py3-none-any.whl |
Total release size: 8.3 kB
Release files / pyweathercli-0.0.4.tar.gz
| Download URL | pyweathercli-0.0.4.tar.gz |
|---|---|
| Size | 3.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
a369fbc7e712108d77e204eb5af9f4091138abc5a22722105437306b668a74a0
|
|
BLAKE2b-256 checksum How to use checksums |
aef9b731d17e711f6453fc35b99ca69a05e7820b39236c07c327c8d544788be6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.8.2
|
Release files / pyweathercli-0.0.4-py3-none-any.whl
| Download URL | pyweathercli-0.0.4-py3-none-any.whl |
|---|---|
| Size | 4.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
a3d6408af147cb6ce5dd660d46a9c1f3546dfa7101a9adcff28225644c402b46
|
|
BLAKE2b-256 checksum How to use checksums |
b9ad3c8ce8fa0b02e9c39bda26293f4653393026b8f39b14cc8ed3ab0039b424
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.8.2
|
Security for pyweathercli 0.0.4
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.