bomshell 3.0.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- bomshell-3.0.1/.cookiecutterrc +45 -0
- bomshell-3.0.1/.editorconfig +13 -0
- bomshell-3.0.1/.envrc +1 -0
- bomshell-3.0.1/.github/workflows/publish.yml +21 -0
- bomshell-3.0.1/.gitignore +68 -0
- bomshell-3.0.1/.pre-commit-config.yaml +28 -0
- bomshell-3.0.1/AUTHORS.rst +5 -0
- bomshell-3.0.1/CHANGELOG.rst +8 -0
- bomshell-3.0.1/CLAUDE.md +67 -0
- bomshell-3.0.1/CONTRIBUTING.rst +90 -0
- bomshell-3.0.1/LICENSE +341 -0
- bomshell-3.0.1/PKG-INFO +302 -0
- bomshell-3.0.1/README.rst +258 -0
- bomshell-3.0.1/docs/authors.rst +1 -0
- bomshell-3.0.1/docs/changelog.rst +1 -0
- bomshell-3.0.1/docs/conf.py +49 -0
- bomshell-3.0.1/docs/contributing.rst +1 -0
- bomshell-3.0.1/docs/index.rst +1 -0
- bomshell-3.0.1/docs/installation.rst +7 -0
- bomshell-3.0.1/docs/map1.png +0 -0
- bomshell-3.0.1/docs/map2.png +0 -0
- bomshell-3.0.1/docs/readme.rst +1 -0
- bomshell-3.0.1/docs/reference/bomshell.rst +9 -0
- bomshell-3.0.1/docs/reference/index.rst +7 -0
- bomshell-3.0.1/docs/requirements.txt +3 -0
- bomshell-3.0.1/docs/spelling_wordlist.txt +11 -0
- bomshell-3.0.1/docs/usage.rst +7 -0
- bomshell-3.0.1/justfile +97 -0
- bomshell-3.0.1/pyproject.toml +123 -0
- bomshell-3.0.1/src/bomshell/__init__.py +1 -0
- bomshell-3.0.1/src/bomshell/__main__.py +8 -0
- bomshell-3.0.1/src/bomshell/bom_paths.py +41 -0
- bomshell-3.0.1/src/bomshell/catalog.json +26063 -0
- bomshell-3.0.1/src/bomshell/cli.py +203 -0
- bomshell-3.0.1/src/bomshell/dump_gis.py +47 -0
- bomshell-3.0.1/src/bomshell/fetch.py +57 -0
- bomshell-3.0.1/src/bomshell/fetch_gis.py +89 -0
- bomshell-3.0.1/src/bomshell/forecast.py +96 -0
- bomshell-3.0.1/src/bomshell/knobs.py +39 -0
- bomshell-3.0.1/src/bomshell/output.py +54 -0
- bomshell-3.0.1/src/bomshell/settings.py +23 -0
- bomshell-3.0.1/src/bomshell/visualize.py +289 -0
- bomshell-3.0.1/tests/test_bom_paths.py +23 -0
- bomshell-3.0.1/tests/test_bomshell.py +30 -0
- bomshell-3.0.1/tests/test_cli_forecast.py +115 -0
- bomshell-3.0.1/tests/test_cli_spatial.py +102 -0
- bomshell-3.0.1/tests/test_fetch.py +69 -0
- bomshell-3.0.1/tests/test_fetch_gis.py +40 -0
- bomshell-3.0.1/tests/test_forecast.py +197 -0
- bomshell-3.0.1/tests/test_knobs.py +69 -0
- bomshell-3.0.1/tests/test_visualize.py +139 -0
- bomshell-3.0.1/uv.lock +2211 -0
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
# This file exists so you can easily regenerate your project.
|
|
2
|
+
#
|
|
3
|
+
# `cookiepatcher` is a convenient shim around `cookiecutter`
|
|
4
|
+
# for regenerating projects (it will generate a .cookiecutterrc
|
|
5
|
+
# automatically for any template). To use it:
|
|
6
|
+
#
|
|
7
|
+
# pip install cookiepatcher
|
|
8
|
+
# cookiepatcher gh:ionelmc/cookiecutter-pylibrary project-path
|
|
9
|
+
#
|
|
10
|
+
# See:
|
|
11
|
+
# https://pypi.python.org/pypi/cookiepatcher
|
|
12
|
+
#
|
|
13
|
+
# Alternatively, you can run:
|
|
14
|
+
#
|
|
15
|
+
# cookiecutter --overwrite-if-exists --config-file=project-path/.cookiecutterrc gh:ionelmc/cookiecutter-pylibrary
|
|
16
|
+
|
|
17
|
+
default_context:
|
|
18
|
+
|
|
19
|
+
codacy: 'no'
|
|
20
|
+
codeclimate: 'no'
|
|
21
|
+
codecov: 'yes'
|
|
22
|
+
command_line_interface: 'click'
|
|
23
|
+
command_line_interface_bin_name: 'bomshell'
|
|
24
|
+
coveralls: 'no'
|
|
25
|
+
distribution_name: 'bomshell'
|
|
26
|
+
email: 'sthysel@gmail.com'
|
|
27
|
+
full_name: 'sthysel'
|
|
28
|
+
github_username: 'sthysel'
|
|
29
|
+
landscape: 'no'
|
|
30
|
+
package_name: 'bomshell'
|
|
31
|
+
project_name: 'bomshell'
|
|
32
|
+
project_short_description: 'Retrieve weather data from the Australian Bureau of Meteorology'
|
|
33
|
+
release_date: 'today'
|
|
34
|
+
repo_name: 'bomshell'
|
|
35
|
+
requiresio: 'yes'
|
|
36
|
+
scrutinizer: 'no'
|
|
37
|
+
sphinx_doctest: 'no'
|
|
38
|
+
sphinx_theme: 'sphinx-rtd-theme'
|
|
39
|
+
test_matrix_configurator: 'no'
|
|
40
|
+
test_matrix_separate_coverage: 'no'
|
|
41
|
+
test_runner: 'pytest'
|
|
42
|
+
travis: 'yes'
|
|
43
|
+
version: '0.1.0'
|
|
44
|
+
website: 'http://sthysel.github.io/'
|
|
45
|
+
year: 'now'
|
bomshell-3.0.1/.envrc
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
source .venv/bin/activate
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
name: Publish to PyPI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
tags:
|
|
6
|
+
- "v*"
|
|
7
|
+
|
|
8
|
+
jobs:
|
|
9
|
+
publish:
|
|
10
|
+
runs-on: ubuntu-latest
|
|
11
|
+
environment: pypi
|
|
12
|
+
permissions:
|
|
13
|
+
id-token: write
|
|
14
|
+
steps:
|
|
15
|
+
- uses: actions/checkout@v4
|
|
16
|
+
|
|
17
|
+
- uses: astral-sh/setup-uv@v5
|
|
18
|
+
|
|
19
|
+
- run: uv build
|
|
20
|
+
|
|
21
|
+
- uses: pypa/gh-action-pypi-publish@release/v1
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
*.py[cod]
|
|
2
|
+
|
|
3
|
+
# C extensions
|
|
4
|
+
*.so
|
|
5
|
+
|
|
6
|
+
# Packages
|
|
7
|
+
*.egg
|
|
8
|
+
*.egg-info
|
|
9
|
+
dist
|
|
10
|
+
build
|
|
11
|
+
eggs
|
|
12
|
+
.eggs
|
|
13
|
+
parts
|
|
14
|
+
bin
|
|
15
|
+
var
|
|
16
|
+
sdist
|
|
17
|
+
wheelhouse
|
|
18
|
+
develop-eggs
|
|
19
|
+
.installed.cfg
|
|
20
|
+
lib
|
|
21
|
+
lib64
|
|
22
|
+
venv*/
|
|
23
|
+
pyvenv*/
|
|
24
|
+
.venv/
|
|
25
|
+
|
|
26
|
+
# Installer logs
|
|
27
|
+
pip-log.txt
|
|
28
|
+
|
|
29
|
+
# Unit test / coverage reports
|
|
30
|
+
.coverage
|
|
31
|
+
.tox
|
|
32
|
+
.coverage.*
|
|
33
|
+
nosetests.xml
|
|
34
|
+
coverage.xml
|
|
35
|
+
htmlcov
|
|
36
|
+
|
|
37
|
+
# Translations
|
|
38
|
+
*.mo
|
|
39
|
+
|
|
40
|
+
# Mr Developer
|
|
41
|
+
.mr.developer.cfg
|
|
42
|
+
.project
|
|
43
|
+
.pydevproject
|
|
44
|
+
.idea
|
|
45
|
+
*.iml
|
|
46
|
+
*.komodoproject
|
|
47
|
+
|
|
48
|
+
# Complexity
|
|
49
|
+
output/*.html
|
|
50
|
+
output/*/index.html
|
|
51
|
+
|
|
52
|
+
# Sphinx
|
|
53
|
+
docs/_build
|
|
54
|
+
|
|
55
|
+
# Generated data files
|
|
56
|
+
src/bomshell/data/
|
|
57
|
+
|
|
58
|
+
.DS_Store
|
|
59
|
+
*~
|
|
60
|
+
.*.sw[po]
|
|
61
|
+
.build
|
|
62
|
+
.ve
|
|
63
|
+
.env
|
|
64
|
+
.cache
|
|
65
|
+
.pytest
|
|
66
|
+
.bootstrap
|
|
67
|
+
.appveyor.token
|
|
68
|
+
*.bak
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
repos:
|
|
2
|
+
- repo: https://github.com/pre-commit/pre-commit-hooks
|
|
3
|
+
rev: v4.6.0
|
|
4
|
+
hooks:
|
|
5
|
+
- id: trailing-whitespace
|
|
6
|
+
- id: end-of-file-fixer
|
|
7
|
+
- id: check-yaml
|
|
8
|
+
- id: check-toml
|
|
9
|
+
- id: check-added-large-files
|
|
10
|
+
args: ['--maxkb=2000']
|
|
11
|
+
- id: check-merge-conflict
|
|
12
|
+
- id: debug-statements
|
|
13
|
+
|
|
14
|
+
- repo: https://github.com/astral-sh/ruff-pre-commit
|
|
15
|
+
rev: v0.4.10
|
|
16
|
+
hooks:
|
|
17
|
+
- id: ruff
|
|
18
|
+
args: [--fix]
|
|
19
|
+
- id: ruff-format
|
|
20
|
+
|
|
21
|
+
- repo: local
|
|
22
|
+
hooks:
|
|
23
|
+
- id: ty
|
|
24
|
+
name: ty
|
|
25
|
+
entry: uvx ty check .
|
|
26
|
+
language: system
|
|
27
|
+
types: [python]
|
|
28
|
+
pass_filenames: false
|
bomshell-3.0.1/CLAUDE.md
ADDED
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
# CLAUDE.md
|
|
2
|
+
|
|
3
|
+
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
|
|
4
|
+
|
|
5
|
+
## Project Overview
|
|
6
|
+
|
|
7
|
+
Bomshell is a Python CLI tool for retrieving weather data from the Australian Bureau of Meteorology (BOM). It fetches spatial data from BOM's public FTP server and builds a local SQLite database for weather information queries.
|
|
8
|
+
|
|
9
|
+
## Build and Test Commands
|
|
10
|
+
|
|
11
|
+
Use `just` to run common development tasks:
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
just # List all available recipes
|
|
15
|
+
just install # Install dependencies
|
|
16
|
+
just test # Run tests
|
|
17
|
+
just test-cov # Run tests with coverage
|
|
18
|
+
just lint # Lint code
|
|
19
|
+
just fmt # Format code
|
|
20
|
+
just fix # Auto-fix linting issues
|
|
21
|
+
just typecheck # Run ty
|
|
22
|
+
just pre-commit # Run all pre-commit hooks
|
|
23
|
+
just qa # Run lint + typecheck + test
|
|
24
|
+
just build # Build package
|
|
25
|
+
just clean # Clean build artifacts
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
Version management with bump-my-version:
|
|
29
|
+
|
|
30
|
+
```bash
|
|
31
|
+
just version # Show current version
|
|
32
|
+
just bump-patch # Bump patch version (0.0.X)
|
|
33
|
+
just bump-minor # Bump minor version (0.X.0)
|
|
34
|
+
just bump-major # Bump major version (X.0.0)
|
|
35
|
+
just bump-dry # Dry run to preview changes
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
## Architecture
|
|
39
|
+
|
|
40
|
+
### Entry Point
|
|
41
|
+
- **CLI**: `src/bomshell/cli.py` - Click-based CLI with commands:
|
|
42
|
+
- `bomshell knobs` - Print configuration settings
|
|
43
|
+
- `bomshell spatial fetch/sync/build/csvdump/tabledump` - Spatial data management
|
|
44
|
+
|
|
45
|
+
### Core Modules
|
|
46
|
+
- `settings.py` - Configuration management with dotenv support, XDG base directories
|
|
47
|
+
- `knobs.py` - Configuration registry (environment variables: `BOM_CACHE`, `BOM_FTP_TIMEOUT`, etc.)
|
|
48
|
+
- `fetch_gis.py` - Spatial data fetching from BOM FTP, SQLite database creation
|
|
49
|
+
- `fetch.py` - FTP file downloading utilities
|
|
50
|
+
- `dump_gis.py` - Data export to CSV and formatted tables
|
|
51
|
+
- `bom_paths.py` - BOM FTP server paths and data source documentation
|
|
52
|
+
|
|
53
|
+
### Data Flow
|
|
54
|
+
1. Fetch DBF spatial files from BOM FTP (`ftp.bom.gov.au`)
|
|
55
|
+
2. Store in cache directory (`~/.cache/bomshell/spatial_cache/`)
|
|
56
|
+
3. Build SQLite database (`~/.cache/bomshell/spatial.sqlite`)
|
|
57
|
+
4. Query/export data via CLI
|
|
58
|
+
|
|
59
|
+
### Configuration
|
|
60
|
+
- Config file: `~/.bomshell` (dotenv format)
|
|
61
|
+
- Generate defaults: `bomshell knobs > ~/.bomshell`
|
|
62
|
+
|
|
63
|
+
## Code Style
|
|
64
|
+
- Max line length: 140 characters
|
|
65
|
+
- Python 3.10+ required
|
|
66
|
+
- Uses ruff for linting and formatting
|
|
67
|
+
- Pre-commit hooks enforce QA checks
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
============
|
|
2
|
+
Contributing
|
|
3
|
+
============
|
|
4
|
+
|
|
5
|
+
Contributions are welcome, and they are greatly appreciated! Every
|
|
6
|
+
little bit helps, and credit will always be given.
|
|
7
|
+
|
|
8
|
+
Bug reports
|
|
9
|
+
===========
|
|
10
|
+
|
|
11
|
+
When `reporting a bug <https://github.com/sthysel/bomshell/issues>`_ please include:
|
|
12
|
+
|
|
13
|
+
* Your operating system name and version.
|
|
14
|
+
* Any details about your local setup that might be helpful in troubleshooting.
|
|
15
|
+
* Detailed steps to reproduce the bug.
|
|
16
|
+
|
|
17
|
+
Documentation improvements
|
|
18
|
+
==========================
|
|
19
|
+
|
|
20
|
+
bomshell could always use more documentation, whether as part of the
|
|
21
|
+
official bomshell docs, in docstrings, or even on the web in blog posts,
|
|
22
|
+
articles, and such.
|
|
23
|
+
|
|
24
|
+
Feature requests and feedback
|
|
25
|
+
=============================
|
|
26
|
+
|
|
27
|
+
The best way to send feedback is to file an issue at https://github.com/sthysel/bomshell/issues.
|
|
28
|
+
|
|
29
|
+
If you are proposing a feature:
|
|
30
|
+
|
|
31
|
+
* Explain in detail how it would work.
|
|
32
|
+
* Keep the scope as narrow as possible, to make it easier to implement.
|
|
33
|
+
* Remember that this is a volunteer-driven project, and that code contributions are welcome :)
|
|
34
|
+
|
|
35
|
+
Development
|
|
36
|
+
===========
|
|
37
|
+
|
|
38
|
+
To set up `bomshell` for local development:
|
|
39
|
+
|
|
40
|
+
1. Fork `bomshell <https://github.com/sthysel/bomshell>`_
|
|
41
|
+
(look for the "Fork" button).
|
|
42
|
+
2. Clone your fork locally::
|
|
43
|
+
|
|
44
|
+
git clone git@github.com:your_name_here/bomshell.git
|
|
45
|
+
|
|
46
|
+
3. Create a branch for local development::
|
|
47
|
+
|
|
48
|
+
git checkout -b name-of-your-bugfix-or-feature
|
|
49
|
+
|
|
50
|
+
Now you can make your changes locally.
|
|
51
|
+
|
|
52
|
+
4. When you're done making changes, run all the checks, doc builder and spell checker with `tox <http://tox.readthedocs.io/en/latest/install.html>`_ one command::
|
|
53
|
+
|
|
54
|
+
tox
|
|
55
|
+
|
|
56
|
+
5. Commit your changes and push your branch to GitHub::
|
|
57
|
+
|
|
58
|
+
git add .
|
|
59
|
+
git commit -m "Your detailed description of your changes."
|
|
60
|
+
git push origin name-of-your-bugfix-or-feature
|
|
61
|
+
|
|
62
|
+
6. Submit a pull request through the GitHub website.
|
|
63
|
+
|
|
64
|
+
Pull Request Guidelines
|
|
65
|
+
-----------------------
|
|
66
|
+
|
|
67
|
+
If you need some code review or feedback while you're developing the code just make the pull request.
|
|
68
|
+
|
|
69
|
+
For merging, you should:
|
|
70
|
+
|
|
71
|
+
1. Include passing tests (run ``tox``) [1]_.
|
|
72
|
+
2. Update documentation when there's new API, functionality etc.
|
|
73
|
+
3. Add a note to ``CHANGELOG.rst`` about the changes.
|
|
74
|
+
4. Add yourself to ``AUTHORS.rst``.
|
|
75
|
+
|
|
76
|
+
.. [1] If you don't have all the necessary python versions available locally you can rely on Travis - it will
|
|
77
|
+
`run the tests <https://travis-ci.org/sthysel/bomshell/pull_requests>`_ for each change you add in the pull request.
|
|
78
|
+
|
|
79
|
+
It will be slower though ...
|
|
80
|
+
|
|
81
|
+
Tips
|
|
82
|
+
----
|
|
83
|
+
|
|
84
|
+
To run a subset of tests::
|
|
85
|
+
|
|
86
|
+
tox -e envname -- py.test -k test_myfeature
|
|
87
|
+
|
|
88
|
+
To run all the test environments in *parallel* (you need to ``pip install detox``)::
|
|
89
|
+
|
|
90
|
+
detox
|