Skip to content

Commit

Permalink
Merge pull request #2 from WxBDM/v0.0.3-dev
Browse files Browse the repository at this point in the history
V0.0.3 dev
  • Loading branch information
WxBDM authored Mar 20, 2022
2 parents 0c9c518 + 5fdd88a commit e26cef7
Show file tree
Hide file tree
Showing 21 changed files with 541 additions and 536 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ __pycache__/
*$py.class

deploy/
useragent.ini

# C extensions
*.so
Expand Down
14 changes: 14 additions & 0 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Required
version: 2

# Build documentation in the docs/ directory with Sphinx
sphinx:
configuration: docs/source/conf.py

formats:
- pdf

python:
version: 3.8
install:
- requirements: requirements.txt
32 changes: 15 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# RichWx
A CLI tool to display weather alerts in the terminal using the Rich library. This is a for fun python package that leverages Rich and NWSAPy to display weather information in your terminal. Here's an example of when `richwx alerts TX` is ran:
A CLI tool to display weather alerts in the terminal using the Rich library. This is a for fun python package that leverages Rich, NWSAPy, and Click to display weather information in your terminal. Here's an example of when `richwx alerts state TX` is ran:

![example alert](images/example_alerts.png)
![example alert](images/sample_list_of_alerts.jpg)

To install, it is recommended to create a virtual environment:
To install, it is (highly) recommended to create a virtual environment:

```
python -m venv env
Expand All @@ -15,26 +15,24 @@ or on windows:
python -m venv env
./env/Scripts/activate
```
From here, install it using pip: `pip install richwx`

Open a new terminal and type: `richwx intro`
From here, install it using pip: `pip install richwx`. You can also install it directly into your base environment (i.e. without setting up a virtual environment), but it's generally good practice to not install anything to your local machine's base environment.

You should see a little introduction screen with some capabilities the CLI tool utilizes.
Open a new terminal and type: `richwx intro` - this will print out a nice little intro and confirm for you that the package works as intended. If you get errors, please open an issue.

## User Agent
The user agent is required by the National Weather Service API. It's essentially "metadata" that the maintainers would like to have in the event there's a security issue with the application. This information is not stored anywhere except for outside of your computer.
The user agent is highly encouraged by the National Weather Service API maintainers. It's essentially "metadata" that the maintainers would like to have in the event there's a security issue with the application; they use it as a method to contact you. This information is only stored within the environment. See [the API docs](https://www.weather.gov/documentation/services-web-api) for more information.

You can control what the user agent is set to by checking its value: `richwx check-user-agent`
All user agent-related content can be found under `auth` (i.e. `rich auth ...`).

You can set the value: `richwx set-user-agent [contact]`, where [contact] is your information.
- You can control what the user agent is set to by checking its value: `richwx auth check`.
- You can set the value: `richwx auth set [contact]`, where [contact] is your information.
- To reset the value to it's default, use `richwx auth purge`.

!! IMPORTANT !!
> It's always better safe than sorry, don't put any personal information here that you might not want in the wrong hands. This information is only sent to the API in a header format, but it is saved _locally_ in your virtual environment. See below to purge this information.
If you wish to purge this information: `richwx purge-user-agent`. This will reset the values to their default.
> It's always better safe than sorry, don't put any personal information here that you might not want in the wrong hands. This information is only sent to the API in a header format, but it is saved _locally_ in the current environment.
## Using RichWx
At any point, you can type `--help` to get additional information about the specific command.
At any point, you can type `--help` to get additional information about the specific command. I.e. `richwx alerts --help`.

### Alerts by State
The Alerts leverage the `/alerts` endpoint within the API. Simply
Expand All @@ -44,16 +42,16 @@ by appending ``--help`` to the end of the command.

The only functionality that is implemented is alerts by state. That is: `richwx alerts state [state]`. You can input the full name of the state or the 2 letter abbreviation.

By adding the flag `--show-id`, it will add another column to the output. This will show a bunch of seemily random numbers and letters. However, this is necessary to be able to look at individual details of a specific alert.
By adding the flag `--show-id`, the ID to the specific alert will show it's associated ID. This is necessary to be able to look at individual details of a specific alert.

### Alerts by ID
If you get the alerts by ID (i.e. `richwx alerts id [id]`), you'll be able to pull up specific information about the alert:

![example individual alert](images/individual_alert.png)
![example individual alert](images/sample_individual_alert.jpg)

Developers Note
---------------
That's it. That's the documentation. If you have questions, reach out to me. I don't plan on maintaining this package outside of the weekend I threw this together, but if there's enough community support and features folks want to see, then I'd be happy to further develop the package.
That's it. That's the documentation. If you have questions, reach out to me. If there is enough community support, I will be more than happy to maintain the package and continue development with features the community would like to see.

I do also allow others to contribute to this package and make suggestions. If you would like to make a suggestion, please do not open an issue, but rather post in the [ideas discussion board](https://github.com/WxBDM/richwx/discussions/categories/ideas) on GitHub.

Expand Down
22 changes: 15 additions & 7 deletions changelog.txt
Original file line number Diff line number Diff line change
@@ -1,12 +1,20 @@
Changelog for RichWx

v0.0.3 (Unknown ETA)
- Refactored code for `auth` command.
- Moved emote files around in the repo. They needed a better home.
- Updated README to better reflect the current CLI with more up-to-date examples.
- Removed a secondary progress bar for populating tables with alerts.
- Added emotes to some of the more common alerts.
- Added periods to the end of changelog sentences.

v0.0.2 (Sunday March 14)
- Refactored baseline functionality to be more distinct with what kind of alerts the user is fetching
- Added `richwx alerts id`
- Relabeled user-agent stuff to `auth` (i.e. `richwx user-agent` to `richwx auth ...`)
- Under auth, added `set`, `purge`, `check`
- Refactored baseline functionality to be more distinct with what kind of alerts the user is fetching.
- Added `richwx alerts id`.
- Relabeled user-agent stuff to `auth` (i.e. `richwx user-agent` to `richwx auth ...`).
- Under auth, added `set`, `purge`, `check`.

v0.0.1 (Saturday, March 12)
Initial release of richwx
- Packaged on PyPi
- Functionality: `richwx alerts [state]`
Initial release of richwx!
- Packaged on PyPi.
- Functionality: `richwx alerts [state]`.
Loading

0 comments on commit e26cef7

Please sign in to comment.