Skip to content

Commit

Permalink
Dox
Browse files Browse the repository at this point in the history
  • Loading branch information
palewire committed Jun 6, 2022
1 parent 8eabf09 commit f518ee8
Show file tree
Hide file tree
Showing 11 changed files with 685 additions and 71 deletions.
29 changes: 29 additions & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: "Build documentation"
on:
push:
pull_request:
workflow_dispatch:

jobs:
docs:
name: "Build and deploy"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- uses: ammaraskar/sphinx-action@master
with:
docs-folder: "docs/"

- uses: actions/upload-artifact@v1
with:
name: documentation-html
path: docs/_build/html/

- uses: shallwefootball/s3-upload-action@master
with:
aws_key_id: ${{ secrets.PALEWIRE_DOCS_AWS_ACCESS_KEY_ID }}
aws_secret_access_key: ${{ secrets.PALEWIRE_DOCS_AWS_SECRET_ACCESS_KEY }}
aws_bucket: ${{ secrets.PALEWIRE_DOCS_AWS_BUCKET }}
source_dir: docs/_build/html/
destination_dir: nws-wwa
2 changes: 2 additions & 0 deletions Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ pytest-vcr = "*"
typing-extensions = "*"
pre-commit = "*"
setuptools-scm = "*"
sphinx = "*"
myst-parser = "*"

[packages]
fiona = "*"
Expand Down
187 changes: 183 additions & 4 deletions Pipfile.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

72 changes: 5 additions & 67 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,68 +1,6 @@
Download watch, warning and advisory data from the National Weather Service
### Links

Hourly scrapes powered by a GitHub Action are stored in the `data` directory.

## Installation

```bash
pipenv install nws-wwa
```

## Command-line usage

```bash
Usage: nwswwa [OPTIONS] COMMAND [ARGS]...

A command-line interface for downloading watch, warning and advisory data
from the National Weather Service. Returns GeoJSON.

Options:
--help Show this message and exit.

Commands:
all All watch, warning and advisory data
hazards All hazard data
warnings All warnings data
```

Download data from the National Weather Service.

```bash
nwswwa all
nwswwa hazards
nwswwa warnings
```

## Python usage

Import the library.

```python
import nws_wwa

data = nws_wwa.get_all()
data = nws_wwa.get_hazards()
data = nws_wwa.get_warnings()
```

## Contributing

Install dependencies for development.

```bash
pipenv install --dev
```

Run tests.

```bash
pipenv run python setup.py test
```

## Developing the CLI

The command-line interface is implemented using Click and setuptools. To install it locally for development inside your virtual environment, run the following installation command, as prescribed by the [Click documentation](https://click.palletsprojects.com/en/7.x/setuptools/#setuptools-integration).

```bash
pipenv run pip install --editable .
```
* Docs: [palewi.re/docs/nws-wwa/](https://palewi.re/docs/nws-wwa/)
* Issues: [github.com/datadesk/nws-wwa/issues](https://github.com/datadesk/nws-wwa/issues)
* Packaging: [pypi.python.org/pypi/nws-wwa](https://pypi.python.org/pypi/nws-wwa)
* Testing: [github.com/datadesk/nws-wwa/actions](https://github.com/datadesk/nws-wwa/actions)
20 changes: 20 additions & 0 deletions docs/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Minimal makefile for Sphinx documentation
#

# You can set these variables from the command line, and also
# from the environment for the first two.
SPHINXOPTS ?=
SPHINXBUILD ?= sphinx-build
SOURCEDIR = .
BUILDDIR = _build

# Put it first so that "make" without argument is like "make help".
help:
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

.PHONY: help Makefile

# Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
%: Makefile
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
Loading

0 comments on commit f518ee8

Please sign in to comment.